CQM-ObjectPlaceboRoutine¶
A static routine is called via an object
Required inputs: IR
A static routine is called via an object instance instead of the object type.
Motivation
If a static routine is addressed via an object, this suggests that it is a routine that can only be accessed by means of an object and therefore also uses the object's own data members. In particular this can lead to the fact that the object is created only for the access to the static characteristics and is thus actually superfluous. It would be correct to address the routine directly via the class.
This rule is based on the CQM Quality Indicator: Objektplacebo (Methode) (p. 255-257).
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.
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
object_access |
This static routine is accessed via an object. |
None |
False |
Options
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.