Package: groovy.org.codenarc.results

## [Groovy] Class FileResults

- groovy.org.codenarc.results.FileResults

- All Implemented Interfaces and Traits:
    Results

      @SuppressWarnings('UnusedMethodParameter')
      class FileResults

  Represents the results of applying a set of rules against a single sourcefile

  Authors:
    Chris Mair

- - ### Constructor Summary

    Constructors
    Constructor and description
    `FileResults (String path, List violations)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Results` | `findResultsForPath(String path)` Return the Results object with the specified path.
    `` | `List` | `getChildren()` Return an empty List
    `` | `int` | `getNumberOfFilesWithViolations(int maxPriority, boolean recursive = true)` Return 1 if these results include at least one violation
    `` | `int` | `getNumberOfViolationsWithPriority(int priority, boolean recursive = true)` @param recursive - ignored
    `` | `String` | `getPath()` @return the path to the file or directory associated with these results
    `` | `int` | `getTotalNumberOfFiles(boolean recursive = true)` Return the total number of (Groovy) files analyzed
    `` | `List` | `getViolations()` @return the List of all violations
    `` | `boolean` | `isFile()` @return true (this object represents the results for a single file)
    `` | `String` | `toString()`

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### FileResults(String path, List violations)

  - ### Method Detail

    - #### Results findResultsForPath(String path)

      Return the Results object with the specified path.

      Parameters:
        `path` - - the path to search for
      Returns:
        this Results object if the path matches, otherwise null

    - #### List getChildren()

      Return an empty List

      Returns:
        the List of child Results objects; may be empty

    - #### int getNumberOfFilesWithViolations(int maxPriority, boolean recursive = true)

      Return 1 if these results include at least one violation

      Parameters:
        `maxPriority` - - the maximum priority level; ignore violations with priority greater than this
        `recursive` - - ignored
      Returns:
        the number of files containing violations

    - #### int getNumberOfViolationsWithPriority(int priority, boolean recursive = true)

      Parameters:
        `recursive` - - ignored
      Returns:
        the number of violations with the specified priority

    - #### String getPath()

      Returns:
        the path to the file or directory associated with these results

    - #### int getTotalNumberOfFiles(boolean recursive = true)

      Return the total number of (Groovy) files analyzed

      Parameters:
        `recursive` - - ignored
      Returns:
        the total number of files (with or without violations)

    - #### List getViolations()

      Returns:
        the List of all violations

    - #### boolean isFile()

      Returns:
        true (this object represents the results for a single file)

    - #### String toString()