Skip to end of metadata
Go to start of metadata

Description

The CodeNarc Plugin provides static code analysis for Groovy code. It uses the CodeNarc library. It is actually a port of the Grails CodeNarc plugin created by Burt Beckwith.

Installation

The current version of griffon-codenarc-plugin is 0.6.5. The CodeNarc version is 0.14.
To install just issue the following command

Usage

The plugin provides a script 'codenarc' that will analyze your code and write its results to an HTML file. Run

to perform the analysis.

Customization

The plugin requires no customization to run. By default it will analyze all Groovy files in

  • src/main
  • griffon-app/controllers
  • griffon-app/models
  • griffon-app/views
  • griffon-app/services
    and use a default title and report name. You can restrict which folders are included or add extra ones. The following table lists settings that will be read from griffon-app/conf/Config.groovy and used if available:

Property

Default Value

Meaning

codenarc.reportName

'CodeNarcAntReport.html'

the name of the analysis report file

codenarc.reportLocation

$projectTargetDir

the location of the analysis report file

codenarc.reportType

'html'

the report type; the only valid value is 'html'

codenarc.reportTitle

none

the report title

codenarc.maxPriority1Violations

unlimited

the maximum number of Priority 1 violations allowed; more than this value fails the build

codenarc.maxPriority2Violations

unlimited

the maximum number of Priority 2 violations allowed; more than this value fails the build

codenarc.maxPriority3Violations

unlimited

the maximum number of Priority 3 violations allowed; more than this value fails the build

codenarc.ruleSetFiles

'rulesets/basic.xml,rulesets/exceptions.xml,rulesets/imports.xml,rulesets'

a comma-delimited list of rule file names

codenarc.processSrcGroovy

true

whether to analyze source in src/main/*.groovy

codenarc.processControllers

true

whether to analyze source in griffon-app/controllers

codenarc.processModels

true

whether to analyze source in griffon-app/models

codenarc.processViews

true

whether to analyze source in griffon-app/views

codenarc.processServices

true

whether to analyze source in griffon-app/services

codenarc.processTestUnit

true

whether to analyze source in test/unit

codenarc.processTestIntegration

true

whether to analyze source in test/integration

codenarc.extraIncludeDirs

none

extra source directories to include; for example to include Wizard files, specify

to add the pattern 'griffon-app/wizards/*/.groovy' to the analysis fileset

History

Version

Date

Notes

0.6.5

2011-05-29

Sync with CodeNarc 0.14

0.6.4

2011-03-09

Sync with CodeNarc 0.13

0.6.3

2011-03-05

Sync with CodeNarc 0.13RC1

0.6.2

2011-01-20

Sync with CodeNarc 0.12

0.6.1

2010-12-21

Release sync with Griffon 0.9.2

0.6

2010-11-13

Upgraded codenarc to 0.11

0.5

2010-10-28

Release sync with Griffon 0.9.1; Upgrade to CodeNarc 0.10

0.4

2010-07-22

Release sync with Griffon 0.9

0.3

2010-05-30

Upgraded to codenarc 0.9

0.2

2009-09-09

Upgraded to codenarc 0.7

0.1

2009-05-25

First release

  • No labels