Package com.spertus.jacquard.pmdgrader
Class PmdGrader
java.lang.Object
com.spertus.jacquard.common.Grader
com.spertus.jacquard.pmdgrader.PmdGrader
A grader that makes use of the linked 
 PMD Source Code Analyzer Project.
- 
Method Summary
Modifier and TypeMethodDescriptionstatic PmdGradercreateFromRules(double penaltyPerViolation, double maxPenalty, String ruleSetPath, String ruleName0, String... moreRuleNames) Creates a PMD-based grader for the specified rules.static PmdGradercreateFromRuleSetPaths(double penaltyPerViolation, double maxPenalty, String... ruleSetPaths) Creates a PMD-based grader for the specified rule sets.getCallableMultiTarget(Target... targets) Gets aCallablethrough which this grader can be called on multiple targets.getCallableSingleTarget(Target target) Gets aCallablethrough which this grader can be called on a single target.Methods inherited from class com.spertus.jacquard.common.Grader
grade, grade, gradeAll, makeExceptionResult, makeExceptionResultList, makeFailureResult, makeFailureResultList, makePartialCreditResult, makeSuccessResult, makeSuccessResultList 
- 
Method Details
- 
createFromRuleSetPaths
public static PmdGrader createFromRuleSetPaths(double penaltyPerViolation, double maxPenalty, String... ruleSetPaths) Creates a PMD-based grader for the specified rule sets. The ruleSetPaths argument should be one or more paths to rule sets in the PMD resource directory (such as "category/java/quickstart.xml") or in one of the client project's resource directories.- Parameters:
 penaltyPerViolation- the penalty per violation, which should be a positive numbermaxPenalty- the maximum penaltyruleSetPaths- the path to one or more rule sets- Returns:
 - new PMD grader
 - Throws:
 ClientException- if any rule set path is invalid- See Also:
 
 - 
createFromRules
public static PmdGrader createFromRules(double penaltyPerViolation, double maxPenalty, String ruleSetPath, String ruleName0, String... moreRuleNames) Creates a PMD-based grader for the specified rules. The ruleSetPath argument should be the path to a rule set in the PMD resource directory (such as "category/java/quickstart.xml") or in one of the client project's resource directories. The rule names should be provided without a preceding path, such as "MissingOverride".- Parameters:
 penaltyPerViolation- the penalty per violation, which should be a positive numbermaxPenalty- the maximum penaltyruleSetPath- the path to a rule setruleName0- the first rule in the set to usemoreRuleNames- additions rules in the set to use- Returns:
 - new PMD grader
 - Throws:
 ClientException- if any rule set path is invalid or a rule cannot be found
 - 
getCallableSingleTarget
Description copied from class:GraderGets aCallablethrough which this grader can be called on a single target.- Specified by:
 getCallableSingleTargetin classGrader- Parameters:
 target- the target- Returns:
 - a 
Callablethrough which this grader can be called 
 - 
getCallableMultiTarget
Description copied from class:GraderGets aCallablethrough which this grader can be called on multiple targets. The default implementation just appends the results of successive calls toGrader.getCallableSingleTarget(Target), but subclasses may provide their own implementations to handle multiple targets specially.- Overrides:
 getCallableMultiTargetin classGrader- Parameters:
 targets- the targets- Returns:
 - a 
Callablethrough which this grader can be called 
 
 -