CQL Code Formatter TEST

 
WARN IF Count > 0 IN SELECT METHODS WHERE NbBCInstructions > 200 ORDER BY NbBCInstructions DESC
// METHODS WHERE NbBCInstructions > 200 are extremely complex and 
// should be split in smaller methods 
// (except if they are automatically generated by a tool).

WARN IF Count > 0 IN SELECT METHODS WHERE BCCyclomaticComplexity > 40 ORDER BY BCCyclomaticComplexity DESC
// METHODS WHERE BCCyclomaticComplexity > 20 are hard to understand and maintain.
// METHODS WHERE BCCyclomaticComplexity > 40 are extremely complex and should be split 
// in smaller methods (except if they are automatically generated by a tool).


WARN IF Count > 0 IN SELECT METHODS WHERE 
   !NameLike "^\[A-Z\]" AND 
   !(IsClassConstructor OR IsConstructor OR 
     IsPropertyGetter  OR IsPropertySetter OR
     IsIndexerGetter OR IsIndexerSetter OR
     IsEventAdder OR IsEventRemover OR
     IsOperator)

WARN IF Count > 0 IN SELECT METHODS WHERE NbParameters > 5 ORDER BY NbParameters DESC
// METHODS WHERE NbParameters > 5 might be painful to call and might degrade performance. 
// You should prefer using additional properties/fields to the declaring type to handle 
// numerous states. Another alternative is to provide a class or structure dedicated to 
// handle arguments passing (for example see the class System.Diagnostics.ProcessStartInfo 
// and the method System.Diagnostics.Process.Start(ProcessStartInfo))
 
WARN IF Count > 0 IN SELECT METHODS WHERE NbVariables > 15 ORDER BY NbVariables DESC
// METHODS WHERE NbVariables > 8 are hard to understand and maintain.
// METHODS WHERE NbVariables > 15 are extremely complex and should be split in 
// smaller methods (except if they are automatically generated by a tool).

WARN IF Count > 0 IN SELECT TYPES WHERE NbMethods > 20 ORDER BY LCOM DESC
// TYPES WHERE NbMethods > 20 might be hard to understand and maintain 
// but there might be cases where it is relevant to have a high value for NbMethods. 
// For example, the System.Windows.Forms.DataGridView standard class has more than 1000 methods.

WARN IF Count > 0 IN SELECT TYPES WHERE NbFields > 20 AND !IsEnumeration 
// TYPES WHERE NbFields > 20 AND !IsEnumeration might be hard to understand and maintain 
// but there might be cases where it is relevant to have a high value for NbFields. 
// For example, the System.Windows.Forms.Control standard class has more than 200 fields. 
// The value of the metric SizeOfInst might be a better indicator of complex type.

WARN IF Count > 0 IN SELECT TYPES WHERE SizeOfInst > 64 ORDER BY SizeOfInst DESC
// TYPES WHERE SizeOfInst > 64 might degrade performance (depending on the number of 
// instances created at runtime) and might be hard to maintain. 
// However it is not a rule since sometime there is no alternative 
// (the size of instances of the System.Net.NetworkInformation.SystemIcmpV6Statistics 
// standard class is 2064 bytes).

WARN IF Count > 0 IN SELECT TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10 ORDER BY LCOM DESC
// TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10 might be problematic. 
// However, it is very hard to avoid such non-cohesive types. The LCOMHS metric
// is often considered as more efficient to detect non-cohesive types.

WARN IF Count > 0 IN SELECT TYPES WHERE LCOMHS > 1.0 AND NbFields > 10 AND NbMethods >10 ORDER BY LCOMHS DESC
// TYPES WHERE LCOMHS > 1.0 AND NbFields > 10 AND NbMethods >10 should be avoided. 
// Note that this constraint is stronger than the constraint 
// TYPES WHERE LCOM > 0.8 AND NbFields > 10 AND NbMethods >10.

SELECT TYPES WHERE DepthOfInheritance > 6 ORDER BY DepthOfInheritance DESC
// TYPES WHERE DepthOfInheritance > 6 might be hard to maintain. However it is not 
// a rule since sometime your classes might inherit from tier classes which have a 
// high value for depth of inheritance. For example, the average depth of inheritance 
// for framework classes which derive from System.Windows.Forms.Control is 5.3.

WARN IF Count > 0 IN SELECT TYPES WHERE (SizeOfInst > 200 ) ORDER BY SizeOfInst DESC
// Type with big instances can be problematic 
// (Obviously the SizeOfInst metric does not do a deep traverse.
//  Any instance reference field wBCl count for 4 bytes.
//  It is also unable to cop with generic types properly)

WARN IF Percentage > 5 IN SELECT METHODS WHERE IsUsingBoxing OR IsUsingUnboxing
// With generics, boxing and unboxing should be very rare.

WARN IF Percentage > 15 IN SELECT ASSEMBLIES WHERE NormDistFromMainSeq > 0.7 ORDER BY NormDistFromMainSeq DESC

WARN IF Count > 0 IN SELECT ASSEMBLIES WHERE RelationalCohesion < 1.5 OR RelationalCohesion > 4.0
// As classes inside an assembly should be strongly related, 
// the cohesion should be high. On the other hand, a value which is too high may 
// indicate over-coupling. A good range for RelationalCohesion is 1.5 to 4.0.
 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.