Permalink
Browse files

2008-09-30 Sebastien Pouliot <sebastien@ximian.com>

	* AvoidLackOfCohesionOfMethodsRule.cs: Change field visibility 
	to private.
	* ConsiderUsingStopwatchRule.cs: More explicit solution text.


svn path=/trunk/mono-tools/; revision=114536
  • Loading branch information...
1 parent 80ce021 commit c178cb8e4b9f73c7f399e121ecf366dda39eae73 Sebastien Pouliot committed Oct 1, 2008
@@ -47,8 +47,14 @@ namespace Gendarme.Rules.Maintainability {
[Problem ("The methods in this class lacks cohesion (higher score are better). This leads to code harder to understand and maintain.")]
[Solution ("You can apply the Extract Class or Extract Subclass refactoring.")]
- public class AvoidLackOfCohesionOfMethodsRule : Rule, ITypeRule
- {
+ public class AvoidLackOfCohesionOfMethodsRule : Rule, ITypeRule {
+
+ private double successCoh = 0.5;
+ private double lowCoh = 0.4;
+ private double medCoh = 0.2;
+ private int method_minimum_count = 2;//set at 2 to remove 'uninteresting' types
+ private int field_minimum_count = 1;//set at 1 to remove 'uninteresting' types
+ //this shouldn't be set to another value than MinimumMethodCount/2
public RuleResult CheckType (TypeDefinition type)
{
@@ -138,21 +144,18 @@ public double SuccessLowerLimit
get { return successCoh; }
set { successCoh = value; }
}
- protected double successCoh = 0.5;
public double LowSeverityLowerLimit
{
get { return lowCoh; }
set { lowCoh = value; }
}
- protected double lowCoh = 0.4;
public double MediumSeverityLowerLimit
{
get { return medCoh; }
set { medCoh = value; }
}
- protected double medCoh = 0.2;
public int MinimumMethodCount
{
@@ -163,7 +166,6 @@ public int MinimumMethodCount
method_minimum_count = value;
}
}
- protected int method_minimum_count = 2;//set at 2 to remove 'uninteresting' types
public int MinimumFieldCount
{
@@ -174,8 +176,5 @@ public int MinimumFieldCount
field_minimum_count = value;
}
}
- protected int field_minimum_count = 1;//set at 1 to remove 'uninteresting' types
- //this shouldn't be set to another value than MinimumMethodCount/2
-
}
}
@@ -1,3 +1,9 @@
+2008-09-30 Sebastien Pouliot <sebastien@ximian.com>
+
+ * AvoidLackOfCohesionOfMethodsRule.cs: Change field visibility
+ to private.
+ * ConsiderUsingStopwatchRule.cs: More explicit solution text.
+
2008-09-29 Sebastien Pouliot <sebastien@ximian.com>
* AvoidLackOfCohesionOfMethodsRule.cs: Be consistent when reporting
@@ -72,7 +72,7 @@ namespace Gendarme.Rules.Maintainability {
/// <remarks>This rule is available since Gendarme 2.0</remarks>
[Problem ("This method uses difference between two DateTime.Now calls to retrieve processing time. Developer's intent may not be very clear.")]
- [Solution ("Use System.Diagnostics.Stopwatch.")]
+ [Solution ("Use the System.Diagnostics.Stopwatch type to improve code readability.")]
[EngineDependency (typeof (OpCodeEngine))]
public class ConsiderUsingStopwatchRule : Rule, IMethodRule {

0 comments on commit c178cb8

Please sign in to comment.