Groovy Documentation

groovy.org.codenarc.results
[Groovy] Class FileResults

java.lang.Object
  groovy.org.codenarc.results.FileResults
All Implemented Interfaces:
Results

@SuppressWarnings('UnusedMethodParameter')
class FileResults

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

Authors:
Chris Mair


Constructor Summary
FileResults(String path, List violations)

 
Method Summary
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()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

FileResults

FileResults(String path, List violations)


 
Method Detail

findResultsForPath

Results findResultsForPath(String path)
Return the Results object with the specified path.
Returns:
this Results object if the path matches, otherwise null
Parameters:
path - - the path to search for


getChildren

List getChildren()
Return an empty List
Returns:
the List of child Results objects; may be empty


getNumberOfFilesWithViolations

int getNumberOfFilesWithViolations(int maxPriority, boolean recursive = true)
Return 1 if these results include at least one violation
Returns:
the number of files containing violations
Parameters:
maxPriority - - the maximum priority level; ignore violations with priority greater than this
recursive - - ignored


getNumberOfViolationsWithPriority

int getNumberOfViolationsWithPriority(int priority, boolean recursive = true)
Returns:
the number of violations with the specified priority
Parameters:
recursive - - ignored


getPath

String getPath()
Returns:
the path to the file or directory associated with these results


getTotalNumberOfFiles

int getTotalNumberOfFiles(boolean recursive = true)
Return the total number of (Groovy) files analyzed
Returns:
the total number of files (with or without violations)
Parameters:
recursive - - ignored


getViolations

List getViolations()
Returns:
the List of all violations


isFile

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


toString

String toString()


 

Groovy Documentation