Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current ·  View Page History

Description / Features

The plugin enables analysis of Groovy projects within Sonar.

It leverages CodeNarc for coding rules violations, Gmetrics for cyclomatic complexity and Cobertura for code coverage.

Plugin

0.1

0.2

0.3

0.4

0.50.6

CodeNarc

0.9

0.9

0.13

0.15

0.16.10.17

GMetrics

0.2

0.2

0.3

0.3

0.40.5

cobertura-maven-plugin

(error)

2.4

2.5

2.5

2.5.12.5.1

Installation

  1. Install the JavaScript plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
  2. Restart the Sonar server

Usage

You can analyze your project with the different analyzers.

A list of sample projects is available on github that can be browsed or downloaded:

  1. Groovy project analyzed with Maven: /projects/languages/groovy/groovy-maven
  2. Groovy project analyzed with the Sonar Runner: /projects/languages/groovy/groovy-sonar-runner

Maven Projects

If you project is built with Maven, you need to add the sourceDirectory property to build section of your pom:

and the sonar.language property to the properties section of your pom:

Here is an example of pom.xml file.

Non-Maven Projects

If your project does not use Maven as a build engine, you need to create a sonar-project.properties file to configure your analysis with the Sonar Runner.

Here is an example of sonar-project.properties file.

Advanced Usage

It is possible to reuse previously generated report from CodeNarc by setting the sonar.groovy.codenarc.reportPath property.

Known Limitations

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.

Changelog

Release 0.6 (8 issues)
Type Key Summary Priority Status Resolution
Improvement SONARPLUGINS-2110 Do not execute CodeNarc, if no active rules Major Closed Fixed
Bug SONARPLUGINS-2108 Groovy Plugin not compatible with SCM Activity Plugin Major Closed Fixed
Improvement SONARPLUGINS-2107 Rename default quality profile to "Sonar way" to be consistent with other plugins Major Closed Fixed
Improvement SONARPLUGINS-1745 Update to CodeNarc 0.17 and GMetrics 0.5 Major Closed Fixed
Improvement SONARPLUGINS-1707 On Groovy projects, replace the "distribution of complexity by class" by the "distribution of complexity by file" Major Closed Fixed
Improvement SONARPLUGINS-1631 Refactor the way how Groovy plugin handles resources Major Closed Fixed
Bug SONARPLUGINS-1123 Parsing GMetrics Report - Inner Classes leads to Exception and Termination of build Critical Closed Fixed
Improvement SONARPLUGINS-597 Inner classes are not properly handled by the plugin in GMetrics results parsing Major Closed Fixed

Release 0.5 (3 issues)
Type Key Summary Priority Status Resolution
Improvement SONARPLUGINS-1565 Update to CodeNarc 0.16.1 and GMetrics 0.4 Major Closed Fixed
Improvement SONARPLUGINS-1404 Update to cobertura-maven-plugin 2.5.1 Major Closed Fixed
Bug SONARPLUGINS-596 Error when parsing certain files for duplications Critical Closed Fixed

Release 0.4 (3 issues)
Type Key Summary Priority Status Resolution
Improvement SONARPLUGINS-1359 Update to CodeNarc 0.15 Major Closed Fixed
Improvement SONARPLUGINS-1205 Update to CodeNarc 0.14 Major Closed Fixed
Improvement SONARPLUGINS-1159 Some rule parameters were missed Major Closed Fixed

Release 0.3 (11 issues)
Type Key Summary Priority Status Resolution
New Feature SONARPLUGINS-1137 Allow to import CodeNarc ruleset Major Closed Fixed
Improvement SONARPLUGINS-1108 Update to cobertura-maven-plugin 2.5 Major Closed Fixed
Bug SONARPLUGINS-1107 No messages in violations Major Closed Fixed
Improvement SONARPLUGINS-1106 Update to CodeNarc 0.13 Major Closed Fixed
Bug SONARPLUGINS-872 Groovy Plugin: Report path for sonar.groovy.codenarc.reportPath property is not read correctly Major Closed Fixed
Bug SONARPLUGINS-871 Groovy Plugin: Report path for sonar.groovy.gmetrics.reportPath property is not read correctly Major Closed Fixed
Improvement SONARPLUGINS-754 Migrate to new rules api Major Closed Fixed
Improvement SONARPLUGINS-742 Use cobertura parser provided by sonar-cobertura-plugin and surefire parser provided by sonar-surefire-plugin Major Closed Fixed
Improvement SONARPLUGINS-697 Upgrade to CodeNarc 0.12 and GMetrics 0.3 Major Closed Fixed
Improvement SONARPLUGINS-621 Add rules parameters Major Closed Fixed
Bug SONARPLUGINS-620 Cannot parse lineNumber "" Major Closed Fixed

Release 0.2 (5 issues)
Type Key Summary Priority Status Resolution
Bug SONARPLUGINS-696 NPE in CoberturaSensor, when parsing some reports Major Closed Fixed
New Feature SONARPLUGINS-692 Report results of unit tests Major Closed Fixed
Bug SONARPLUGINS-687 Test files incorrectly handled by GroovySourceImporter Major Closed Fixed
Task SONARPLUGINS-672 Migrate to sonar-dev-maven-plugin from sonar-dev-mojo for integration tests Major Closed Fixed
New Feature SONARPLUGINS-613 Add coverage using Cobertura Major Closed Fixed

Release 0.1 (4 issues)
Type Key Summary Priority Status Resolution
New Feature SONARPLUGINS-582 Integrate Gmetrics for standard metrics Major Closed Fixed
New Feature SONARPLUGINS-581 Integrate CodeNarc coding rules engine Major Closed Fixed
New Feature SONARPLUGINS-580 Create Groovy Plugin Major Closed Fixed
New Feature SONARPLUGINS-194 Provide rules for groovy/grails with codenarc in sonar Major Closed Fixed

Labels
  • None