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
A superclass should not be dependant of any of its subclasses |
|
Classes shall not have too few data members and/or routines |
|
Global constants should have unique names |
|
Do not declare non-const data members public |
|
A private filed of a class is not used |
|
Unreachable statements |
|
Parameters of a function shall not get casted to a more specific type |
|
A subclass should not reject most of the routines inherited from its superclass |
|
Classes shall not have too many data members |
|
Classes shall not have too many routines |
|
Namespaces shall not contain too many classes and/or routines |
|
Related routine clusters should be implemented completely or consistently |
|
Classes should have unique names |
|
Duplicate includes |
|
Unused includes |
|
Multiple subclasses contain the same field, which does not exist in their superclass |
|
Multiple subclasses contain the same routine, which does not exist in their superclass |
|
The names of artifacts shall not be too short or too long |
|
The names of files shall not be too short or too long |
|
Public routines should be formally documented |
|
An abstract class has a direct or indirect non-abstract parent class |
|
Files should contain classes with a similar name |
|
Data members shall not hide data members in superclasses |
|
The classes hierarchy should not run against the namespace hierarchy |
|
Namespaces shall not contain too few classes and/or routines |
|
A static data member is accessed via an object |
|
A static routine is called via an object |
|
Files should not contain to many classes |
|
Routines of subclasses should not hide static routines of their parents |
|
Data members that could have more private scopes |
|
Routines that could have more private scopes |
|
A routine of a superclass gets overridden or hidden in most of the subclasses |
|
Overriding should not reduce the functionality or accessibility of a routine |
|
Typical fail-safe mechanisms are misused |
|
Classes should not have public routines that are not called from outside their inheritance hierarchy |
|
Two unrelated classes should not have most of their routines in common |
|
An objects type is checked multiple times inside one routine |
Options
Setting an option for this rule means setting the default for all nested rules.
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
This rule has no individual options.