June 11, 2019 SonarQube static code analysis
SonarQube is a tool to do (static) code analysis on software. Smallworld, a GIS platform, uses the Magik programming language for development of the platform. Development of a SonarQube plugin to do Magik analysis is under way, allowing you to do extensive analysis of your software and continuously monitor for any problems during software development.
Smallworld is a GIS platform by General Electric and used by utilities and telecom companies. Its power lies, among things, in its Version Manager Data Store (VMDS), supporting long transactions. Another powerful feature is support for complex topological models. Smallworld also uses its own programming language: Magik. Magik has similarities with Smalltalk, such as Object Orientation and is a dynamic language. For more details see the Wikipedia page on Magik.
SonarQube is a platform to do continuous inspection of the code of software projects via code analysis. It is an open source product and is extended via plugins to add support for different languages and provide additional functionality. It supports many languages, such as Java and Python. Via code analysis you can derive metrics, such as the ‘size’ of your project, or complexity of the project. These metrics are used to pin-point complex parts of your project which are likely harder to maintain, among things. Likewise, you can use metrics over time to monitor progress of development. (Although more lines of code does not mean a better product per se!)
Another use of code analysis is detection of common issues in the software. An example would be where you use
collection.size = 0, while
collection.empty? is much faster. Or littering your methods with unused variables, making maintenance harder. Detecting these issues is beneficial as you can fix these before it becomes a problem. When you assign an estimated time per issue type you can also do a forecasting on the time and costs of increasing the code quality of your project. Many projects already use code analysis to do automatic detection of problems.
I have started development of a Magik plugin for SonarQube. You can find the Github repository at StevenLooman/sonar-magik. The plugin already provides metrics such as lines of code, lines of comments, and complexity. Detection of common issues is also possible and some checks are built already. The plugin open source and free to use. If you have any use for it, feel free to try it and send me a message if you need any help.