6.2.12.3. CQM

Code-Quality-Management Stylechecks

Stylechecks based on the 2006 book Code-Quality-Management. Includes checks on various source code characteristics.

Reference

Simon, Frank/ Seng, Olaf/ Mohaupt, Thomas (2006): Code-Quality-Management: Technische Qualität industrieller Softwaresysteme transparent und vergleichbar gemacht, 1st ed., Heidelberg, Germany: dpunkt.verlag GmbH.

Nested Rules

CQM-ClassIncest

A superclass should not be dependant of any of its subclasses

CQM-Classlet

Classes shall not have too few data members and/or routines

CQM-ConstantsRain

Global constants should have unique names

CQM-DataCapsuleBreakUp

Do not declare non-const data members public

CQM-DeadFields

A private filed of a class is not used

CQM-DeadImplementation

Unreachable statements

CQM-GeneralParameter

Parameters of a function shall not get casted to a more specific type

CQM-GenerationalConflict

A subclass should not reject most of the routines inherited from its superclass

CQM-GodClassMember

Classes shall not have too many data members

CQM-GodClassRoutine

Classes shall not have too many routines

CQM-GodNamespace

Namespaces shall not contain too many classes and/or routines

CQM-HalfHeartedOperation

Related routine clusters should be implemented completely or consistently

CQM-IdentitySplit

Classes should have unique names

CQM-IncludeChaos

Duplicate includes

CQM-IncludeLie

Unused includes

CQM-IncompleteInheritanceField

Multiple subclasses contain the same field, which does not exist in their superclass

CQM-IncompleteInheritanceRoutine

Multiple subclasses contain the same routine, which does not exist in their superclass

CQM-IncorrectNameLength

The names of artifacts shall not be too short or too long

CQM-IncorrectNameLengthFile

The names of files shall not be too short or too long

CQM-InformalDocumentation

Public routines should be formally documented

CQM-LateAbstraction

An abstract class has a direct or indirect non-abstract parent class

CQM-MaskingFile

Files should contain classes with a similar name

CQM-MemberHiding

Data members shall not hide data members in superclasses

CQM-NamespaceHierarchyBreakUp

The classes hierarchy should not run against the namespace hierarchy

CQM-Namespacelet

Namespaces shall not contain too few classes and/or routines

CQM-ObjectPlaceboMember

A static data member is accessed via an object

CQM-ObjectPlaceboRoutine

A static routine is called via an object

CQM-OverbookedFile

Files should not contain to many classes

CQM-PolymorphismPlacebo

Routines of subclasses should not hide static routines of their parents

CQM-PotentialPrivacyMember

Data members that could have more private scopes

CQM-PotentialPrivacyRoutine

Routines that could have more private scopes

CQM-RejectedInheritanceImplementation

A routine of a superclass gets overridden or hidden in most of the subclasses

CQM-RejectedInheritanceInterface

Overriding should not reduce the functionality or accessibility of a routine

CQM-RiskyCode

Typical fail-safe mechanisms are misused

CQM-SecretRelation

Classes should not have public routines that are not called from outside their inheritance hierarchy

CQM-SignatureLikeClasses

Two unrelated classes should not have most of their routines in common

CQM-SimulatedPolymorphism

An objects type is checked multiple times inside one routine

Options