GMetrics
Dependency:
compile "org.grails.plugins:gmetrics:0.3.1"
Summary
Installation
grails install-plugin gmetrics
Description
Gmetrics Plugin
The Gmetrics Plugin provides static code analysis for Groovy code. It uses the Gmetrics] library.The GMetrics project provides calculation and reporting of size and complexity metrics for Groovy source code. GMetrics scans Groovy source code, applying a set of metrics, and generates an HTML report of the results.Total and average values for the following metrics are provided:- Cyclomatic Complexity.
- ABC Size/Complexity. Also see the C2 Wiki page.
- Lines per method
- Lines per class
Installation
To integrate the plugin into your application just run the 'install-plugin' Grails script, e.g.grails install-plugin gmetrics
Usage
The plugin provides a script 'gmetrics' that will analyze your code and write its results to an HTML file. Rungrails gmetrics
Customization
The plugin requires no customization to run. By default it will analyze all Groovy files in- src/groovy
- grails-app/controllers
- grails-app/domain
- grails-app/services
- grails-app/taglib
- grails-app/utils
- test/unit
- test/integration
Property | Default Value | Meaning |
---|---|---|
gmetrics.outputFile | target/GMetricsReport.html | the path and name of the analysis report file |
gmetrics.reportType | org.gmetrics.report.BasicHtmlReportWriter | the report type; valid values are 'html', 'xml' and 'text', or the fully-qualified class name of a ReportWriter class |
gmetrics.reportTitle | GMetrics Report | the report title |
gmetrics.processSrcGroovy | true | whether to analyze source in src/groovy |
gmetrics.processControllers | true | whether to analyze source in grails-app/controllers |
gmetrics.processDomain | true | whether to analyze source in grails-app/domain |
gmetrics.processServices | true | whether to analyze source in grails-app/services |
gmetrics.processTaglib | true | whether to analyze source in grails-app/taglib |
gmetrics.processTestUnit | true | whether to analyze source in test/unit |
gmetrics.processTestIntegration | true | whether to analyze source in test/integration |
gmetrics.extraIncludeDirs | none | extra source directories to include; for example to include Quartz job files, specify gmetrics.extraIncludeDirs=['grails-app/jobs'] |
License
Licensed under the Apache License, Version 2.0. See http://www.apache.org/licenses/LICENSE-2.0.History
- January 11, 2011 (Version 0.3.1)
- Change default target to gmetrics from default
- August 11, 2010 (version 0.3)
- Support for version 0.3 of gmetrics
- Change dependency to provided so it is no longer packaged in the war
- June 3, 2010 (version 0.2.1)
- Support for report name and output file name as configurable parameters
- June 1, 2010 (version 0.2)
- released initial version 0.2