Package: groovy.org.codenarc

## [Groovy] Class CodeNarcRunner

- groovy.org.codenarc.CodeNarcRunner

- Helper class to run CodeNarc.

  The following properties must be configured before invoking the `execute()` method:
  - `rulesetfiles` - The path to the Groovy or XML RuleSet definition files, relative to the classpath. This can be a single file path, or multiple paths separated by commas.
  - `sourceAnalyzer` - An instance of a `org.codenarc.analyzer.SourceAnalyzer` implementation.
  - `reportWriters` - The list of `ReportWriter` instances. A report is generated for each element in this list. At least one `ReportWriter` must be configured.
  NOTE: This is an internal class. Its API is subject to change.
  Authors:
    Chris Mair

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `List` | `reportWriters`
    `String` | `ruleSetFiles`
    `SourceAnalyzer` | `sourceAnalyzer`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected RuleSet` | `createRuleSet()` Create and return the RuleSet that provides the source of Rules to be applied.
    `` | `Results` | `execute()` The main entry point for this class.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Property Detail

    - #### List reportWriters

    - #### String ruleSetFiles

    - #### SourceAnalyzer sourceAnalyzer

  - ### Method Detail

    - #### protected RuleSet createRuleSet()

      Create and return the RuleSet that provides the source of Rules to be applied. The returned RuleSet may aggregate multiple underlying RuleSets.

      Returns:
        a single RuleSet

    - #### Results execute()

      The main entry point for this class. Runs CodeNarc and returns the results. Processing steps include:

      1. Parse the `ruleSetFiles` property to create a RuleSet.
      2. Configure the RuleSet from the "codenarc.properties" file, if that file is found on the classpath.
      3. Apply the configured `SourceAnalyzer`.
      4. Generate a report for each configured `ReportWriter`.
      5. Return the `Results` object representing the analysis results.
      returns:
        the `Results` object containing the results of the CodeNarc analysis.