Description / Features
This plugin enables the analysis of Groovy projects. To do so, it leverages Squid to calculate basic metrics, CodeNarc for coding rules violations, Gmetrics for cyclomatic complexity and Cobertura for code coverage.
Place the JAR file of the plugin in /extensions/plugins of your Sonar installation. Restart sonar.
If you project is built with Maven, you should add in your pom
to the build section and :
If you project does not use Maven as a build engine, you should create a small pom.xml file at the root of you project and have the following content in it :
To kick-off the analysis, run mvn sonar:sonar
It is possible to reuse some reports already existing for GMetrics and CodeNarc. To do so, use sonar.groovy.gmetrics.reportPath or sonar.groovy.codenarc.reportPath.
- When running the search for duplications, the Groovy lexer will sometimes output some exceptions. It does not stop the Sonar plugin to work, but the will not run comprehensive copy/paste detection on those files. This issue should be fixed in Groovy 1.7. See SONARPLUGINS-596.
- The source directory must be added to the pom.xml, even if the project is built with Maven. This comes from the fact that Sonar does not call gmaven plugin.
- Inner classes are not processed in the current version and will therefore not be reported. See SONARPLUGINS-597.