Page History
Blueriq Model Analyzer
The Model Analyzer consists out of three components. A Plugin, a Scanner and a Quality Gate. The SonarQube Scanners index the gives source code directories and files, so it can run its analysis on those indexed files. Since Blueriq Models live in Blueriq Studio and does not consist out files, we needed to create our own scanner. The scanner creates directories and files in a structure way which represents your Blueriq project structure including repository and branch. Once this file structure is in place, the scanner works just like every other SonarQube Scanner.
Scope of the analysis
The Model Analyzer can only analyze the content of project which are created in the project itself. For more information see Analysis Scope.
Configure analysis
The Blueriq Sonar Scanner needs to be configured to read your Blueriq Model on which the analysis will be run. Blueriq Sonar Scanner takes care of this by reading a application.properties file. See Configuring Sonar Scanner on how to setup your application.properties file.
Running analysis
Anchor | ||||
---|---|---|---|---|
|
To perform an analysis you need to have the Blueriq Sonar Scanner somewhere on you local environment. This Blueriq Sonar Scanner can be found in the zip of the Blueriq Model Analyzer and is called bma-sonar-scanner.jar. To perform an analysis you will need to execute a command from a command prompt. The command consist out of two parts. The first part being the execution of java with the Blueriq Sonar Scanner and the second part is the location of the application.properties.
Example | Explanation |
---|---|
java -jar <location on disk>\bma-sonar-scanner.jar | The <location on disk> needs to be replaced with the location of where the bma-sonar-scanner.jar can be found. |
-Dspring.config.location=file:<location on disk>\application.properties | The <location on disk> needs to be replaced with location of where the application.properties can be found. |
When performing the following executing the following following command java -Dspring.config.location=file:.\application.properties -jar C:\tools\bma-sonar-scanner.jar . The Blueriq Sonar Scanner which is located in C:\tools will be executed with application.properties from the current directory. When this command is executed, Blueriq Sonar Scanner will either download a branch export from the management service or from a configured location, and perform the analysis. When the analysis is done the command prompt will inform that the analysis was successful.
All the required properties must be set, otherwise the command prompt will show which properties aren't set.
Evaluating analysis results
When the analysis has finished the results can be viewed through a web browser of your choice, at http://<your-machine-name>:<port_number> for instance http://localhost:9000/
Analyzed projects are shown under Projects and are clickable to acquire more in depth insight:
Clicking on the project will show a new screen with three tabs to browse through the analysis results:
- Issues
- Measures
- Code
Code
The third tab in the upper left corner, called Code, gives you an overview of your projects and its quality.
Measures
The Blueriq Model Analyzer is capable of calculating the following measures:
Measure | Explanation |
---|---|
Number of modules | Counts the number of modules in you Blueriq Model. |
Number of reusable expressions | Counts the number of reusable expressions in your Blueriq Model. |
Number complex expression | Counts the number of complex expressions in you Blueriq Model. |
You can view the measures of your Blueriq Model by clicking the Measures tab in the upper left corner of your screen, calculated measures are shown in sidebar under the section size:
Module measures
The BMA indexes projects and modules as files in SonarQube. If you want to see module specific measures you will need to open a file in SonarQube and click on show measures.
Issues
The Blueriq Model Analyzer is capable of detecting the following issues:
Rule | Explanation |
---|---|
Elements in flow | This rule counts the number of elements within one flow and reports back an issue when the configured maximum number of elements is exceeded. It is recommended for maintainability issues, to keep the number of elements in flows below this maximum, otherwise the flow is seen as complex. |
Flow viewport | This rule calculates whether or not your flow can be displayed on a standard screen. If not, you are advised to refactor for maintainability reasons. |
Included library in project | This rule searches for libraries in your Blueriq Model and reports back an issue when unused libraries are found. In case a library is connected to the project its modules should be used in the project. If it is connected, but not used the rule will trigger. However, there is an exception: there are libraries that does not contain modules, e.g. the AquimaLibrary which only uses globals. So this rule checks also if a library uses global elements. |
Diamond | This rule checks whether modules are configured in such a way that a diamond, i.e. a closed circuit occurs in your Blueriq Model. If so, it is advised to refactor your model on this. From a modeling point of view this module structure could be curious. Additionally the model can behave unexpected in case specialization is used. |
Expression duplicates | Detects duplicate expressions per module, considering all modules in scope. This is an indication that expressions have to be maintained in multiple places which is bad for maintainability reasons. |
Reusable expression duplicates | This rule checks whether a reusable expression is duplicated somewhere in your Blueriq Model, even across modules within a project which are not in each other's scope. |
Gaps in Decision Table | This rule compares all conditions in a decision table for gaps between conditions. If there is a gap between two conditions an issue will be created. An issue can consist out of multiple warnings since multiple gaps may exist in a decision table. |
Simplify Expression | This rule checks whether boolean logic in an expression can be simplified. If so, the simplified expression is reported as issue. |
You can view the issues of your Blueriq Model by clicking the Issues tab in the upper left corner of your screen:
Also see:
FAQ
I get the following Exception when running the BMA javax.xml.bind.UnmarshalException: Unable to create an instance of ...
- This issue means that you performing an analysis with a branch export which could either be a newer or older version than that is supported by the BMA release you are using.