Groovy Documentation

org.codenarc.rule.grails
[Groovy] Class GrailsSessionReferenceRule

java.lang.Object
  org.codenarc.rule.AbstractRule
      org.codenarc.rule.AbstractAstVisitorRule
          org.codenarc.rule.grails.GrailsSessionReferenceRule

class GrailsSessionReferenceRule
extends AbstractAstVisitorRule

Rule that checks for references to the session object from within Grails controller and taglib classes.

This rule is intended as a "governance" rule to enable monitoring and controlling access to the session from within application source code. Storing objects in the session may inhibit scalability and/or performance and should be carefully considered.

Enabling this rule may make most sense in a team environment where team members exhibit a broad range of skill and experience levels. Appropriate session access can be configured as exceptions to this rule by configuring either the doNotApplyToFilenames or doNotApplyToFilesMatching property of the rule.

This rule sets the default value of applyToFilesMatching to only match files under the 'grails-app/controllers' or 'grails-app/taglib' folders. You can override this with a different regular expression value if appropriate.

deprecated:
This rule is deprecated and disabled (enabled=false) by default
Authors:
Chris Mair
Version:
\$Revision: 553 \$ - \$Date: 2011-01-20 16:07:46 -0500 (Thu, 20 Jan 2011) \$


Field Summary
 
Fields inherited from class AbstractAstVisitorRule
DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME
 
Property Summary
String applyToFilesMatching

Class astVisitorClass

String name

int priority

 
Constructor Summary
GrailsSessionReferenceRule()

 
Method Summary
 
Methods inherited from class AbstractAstVisitorRule
applyTo, getAstVisitor, shouldApplyThisRuleTo
 
Methods inherited from class AbstractRule
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getImportsSortedByLineNumber, getName, getPriority, isReady, packageNameForImport, setName, setPriority, sourceLineAndNumberForImport, sourceLineAndNumberForImport, toString, validate
 

Property Detail

applyToFilesMatching

String applyToFilesMatching


astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 
Constructor Detail

GrailsSessionReferenceRule

GrailsSessionReferenceRule()


 

Groovy Documentation