CodeNarc - CodeNarc - Enhanced Classpath Rules

##### General

- Home
- Downloads
- Javadocs
- Mailing Lists
- Bug Tracker
- SourceForge Project
- GitHub Project

##### Running

- Ant Task Usage
- Command-Line
- Run as a Test
- Other Tools/Frameworks

##### Using

- Creating a RuleSet
- Creating a Rule
- Configuring Rules
- Starter RuleSet (All)

##### Report Types

- HTML Report
- XML Report
- Text and IDE Reports

##### Sample Reports

- Sample HTML Report
- Sample XML Report

##### Rules

- Rule Index
- Basic Rules
- Braces Rules
- Concurrency Rules
- Convention Rules
- Design Rules
- DRY Rules
- Enhanced Rules
- Exceptions Rules
- Formatting Rules
- Generic Rules
- Grails Rules
- Groovyism Rules
- Imports Rules
- JDBC Rules
- JUnit Rules
- Logging Rules
- Naming Rules
- Size/Complexity Rules
- Security Rules
- Serialization Rules
- Unnecessary Rules
- Unused Rules

##### Developing

- Developer Guide

##### Project Documentation

- Project Information
- Project Reports

## CodeNarc - Enhanced Classpath Rules

Several newer rules use a later compilation phase for parsing of the Groovy source code, allowing CodeNarc to use a richer and more complete Abstract Syntax Tree (AST). The downside is that the later compiler phase requires CodeNarc to have the application classes being analyzed, as well as any referenced classes, on the classpath.

NOTE: If a rule requiring a later compiler phase is included in the active CodeNarc ruleset and enabled and one or more of the required classes is not on the classpath, then CodeNarc will log a Log4J WARN message for each source file that contains the missing references.

### Grails-CodeNarc Plugin

The Grails CodeNarc Plugin supports the new enhanced classpath rules out of the box. You are free to include these rules in your CodeNarc ruleset when you use the Grails CodeNarc plugin.

### CodeNarc Ant Task - Expanding the Classpath

TBD...

CodeNarc users that use the Ant Task directly will need to adjust their Ant scripts to expand the classpath, if they want to take advantage of these special new rules.

See the CodeNarc Ant Task for more information on configuring the Ant task.

### CodeNarc - Other Tools and Frameworks - Expanding the Classpath?

Other tools/frameworks that use CodeNarc will most likely not be able to use these new rules initially, because the tool classpath will not support it. The hope is that the other CodeNarc tools will eventually be enhanced to provide the expanded classpath to CodeNarc – either optionally or always – so that they can also take advantage of these new rules.

See the CodeNarc - Integration with Other Tools / Frameworks for links to other tools and frameworks that use CodeNarc.

TBD...

### Now what?

We also expect to continue to introduce more of these "special" enhanced-classpath rules, since that greatly expands the capabilities for CodeNarc rules.

Anyone who does not want to use the new rules or is unable to expand the classpath as required, can just omit these special rules from the CodeNarc ruleset or else disable the rules.