diff --git a/pmd/rulesets/codesize.xml b/pmd/rulesets/codesize.xml index cd033bf444..a5e4d57e89 100644 --- a/pmd/rulesets/codesize.xml +++ b/pmd/rulesets/codesize.xml @@ -11,20 +11,8 @@ The Code Size Ruleset contains a collection of rules that find code size related message="Avoid really long methods." class="net.sourceforge.pmd.rules.design.LongMethodRule"> -Excessive Method Length usually means that the method is doing -too much. There is usually quite a bit of Cut and Paste there -as well. Try to reduce the method size by creating helper methods, -and removing cut and paste. - -Default value is 2.5 sigma greater than the mean. - -There are three parameters available: -minimum - Minimum Length before reporting. -sigma - Std Deviations away from the mean before reporting. -topscore - The Maximum Number of reports to generate. - -At this time, only one can be used at a time. - +Violations of this rule usually indicate that the method is doing +too much. Try to reduce the method size by creating helper methods and removing any copy/pasted code. 3 @@ -32,13 +20,12 @@ At this time, only one can be used at a time. @@ -50,21 +37,8 @@ public void doSomething() { message="Avoid really long parameter lists." class="net.sourceforge.pmd.rules.design.LongParameterListRule"> -This checks to make sure that the Parameter Lists in the project aren't -getting too long. If there are long parameter lists, then that is -generally indicative that another object is hiding around there. - -Basically, try to group the parameters together. - -Default value is 2.5 sigma greater than the mean. - -NOTE: In version 0.9 and higher, their are three parameters available: -minimum - Minimum Length before reporting. -sigma - Std Deviations away from the mean before reporting. -topscore - The Maximum Number of reports to generate. - -At this time, only one can be used at a time. - +Long parameter lists can indicate that a new object should be created to + wrap the numerous parameters. Basically, try to group the parameters together. 3 @@ -72,10 +46,12 @@ At this time, only one can be used at a time. @@ -84,22 +60,12 @@ public void addData( Long Class files are indications that the class may be trying to do too much. Try to break it down, and reduce the size to something -managable. - -Default value is 2.5 sigma greater than the mean. - -NOTE: In version 0.9 and higher, their are three parameters available: -minimum - Minimum Length before reporting. -sigma - Std Deviations away from the mean before reporting. -topscore - The Maximum Number of reports to generate. - -At this time, only one can be used at a time. - +manageable. 3 @@ -109,11 +75,7 @@ At this time, only one can be used at a time. @@ -126,8 +88,9 @@ public class Foo { class="net.sourceforge.pmd.rules.CyclomaticComplexity"> Complexity is determined by the number of decision points in a method plus one for the -method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Scale: -1-4 (low complexity) 5-7 (moderate complexity) 8-10 (high complexity) 10+ (very high complexity) +method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, +1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, + and 11+ is very high complexity. 3 @@ -135,59 +98,38 @@ method entry. The decision points are 'if', 'while', 'for', and 'case labels'. -A large amount of public methods and attributes declared in an object can indicate the class may need -to be broken up as increased effort will be required to thoroughly test such a class. +A large number of public methods and attributes declared in a class can indicate the + class may need to be broken up as increased effort will be required to thoroughly test it. 3 @@ -228,9 +170,9 @@ public class Foo { message="Too many fields" class="net.sourceforge.pmd.rules.design.TooManyFields"> -Classes that have too many fields could be redesigned to have less fields -and some nested object grouping some of the information collected on the -many fields. +Classes that have too many fields could be redesigned to have fewer fields, possibly + through some nested object grouping of some of the information. For example, a class with + city/state/zip fields could instead have one Address field. 3 @@ -238,7 +180,7 @@ many fields. -