The following contains additional information and answers to commonly asked questions on the plugins configuration, setup and usage.
dependencies
The following dependencies need to be installed to be able to run the MB-Precise plugin against your Message Broker code.
Java
MB-Precise is a Sonarqube plugin, that runs on Sonar. Sonar runs on Java. Java needs to be downloaded and installed.
After installing Java, Sonarqube needs to be installed. MB-Precise has been tested with different versions of Sonarqube. 4.3.1+ is the current supported version. It is available for download from here:
Download Sonarqube
Once Sonarqube is started and running, you can either run the analysis from either a command prompt via Sonar-runner, which is available here:
Download Sonar-Runner
Or via the Jenkins Sonar plugin.
The last step is to copy the Mb_precise-x.jar into the ‘extensions\plugins’ folder on the Sonarqube server and restart the server.
More details can be found here:
More information
sonar-project.properties
When starting the plugin via Sonar-runner:
http://docs.codehaus.org/display/SONAR/Analyzing+with+SonarQube+Runner
It uses the sonar-project.properties configuration file.
There are a number of additional properties that have been added that are used by the plugin:
sonar.mb.flow.timeout.seconds
This is threshold for how long the MQGet and other nodes with timeouts should wait. This check tries to prevent long processes that can block the EG.
sonar.mb.flow.timeout.seconds=15 |
sonar.mb.flow.diagram.output
This property tells the plugin where to generate diagrams and documentation to. It is an absolute path. The following would send all diagrams to the “C:\test\demos\generated” directory.
sonar.mb.flow.diagram.output=C:\\test\\demos\\generated\\ |
sonar.mb.header.company
This optional property tells the plugin what the common code heading block for ESQL should contain. This could be the company name and some copyright details. Is similar to what the maven plugin does:
http://mojo.codehaus.org/license-maven-plugin/check-file-header-mojo.html
sonar.mb.header.company=Richards Test Company |
sonar.mb.msgflow.notes
This optional parameter gets the plugin to check all flows for a “Note”. These notes are away to enforce a documentation standard against your code.
sonar.mb.msgflow.notes=true |
sonar.mb.queue.defn.path
The plugin attempts to match the MQ queue and topic definitions used in the code (in ESQL and Msgflow files) against those in a MQ configuration file. This property is a relative path from where Sonar is running from to your MQ configuration file.
The following line tells the plugin that the MQ queue and topic configuration can be found in the .\MB-Precise-Demo\queues.conf file.
sonar.mb.queue.defn.path=.\\MB-Precise-Demo\\queues.conf |
If this is not configured a violation is raised. To disable this check/violation, disable the following violation as from the sonar quality profile for Message Broker:
MQ Definition file has not been configured or doesn’t refer to a valid file |
sonar.mb.esql.complexity
This is threshold for when a particular ESQL file is flagged as being complex. Its a numerical whole value and can be tuned as required.
sonar.mb.esql.complexity=16 |
sonar.mb.esql.functionsize
This is threshold for when a particular ESQL function is flagged as being too long. Its a numerical whole value and can be tuned as required.
sonar.mb.esql.functionsize=32 |
sonar.mb.esql.maxlinesize
This is threshold for when a particular line of ESQL is too long. Usually it has to able to be read without excessive scrolling.
Its a numerical whole value and can be tuned as required.
sonar.mb.esql.maxlinesize=99 |
sonar.mb.jdbc.*
This allows the plugin to connect to an active SQL/Relational datasource and validate that the tables and fields referenced in the code exist in the database. It also checks that queries are accessing tables against valid indexes.
sonar.mb.jdbc.driver=org.postgresql.Driver sonar.mb.jdbc.url=http://localhost:9000/DemoDB sonar.mb.jdbc.user=sa sonar.mb.jdbc.password=password123 |