CQM-GodNamespace¶
Namespaces shall not contain too many classes and/or routines
Required inputs: IR, RFG
Any namespace that contains more than 50 classes and routines is a violation of this metric.
Motivation
Packages, directories and namespaces are a means of creating a further abstraction layer within software systems that lies above the level of classes and interfaces. If a package, directory or namespace contains a large number of classes/interfaces, there is a risk that this abstraction can no longer be understood and maintained with a reasonable amount of effort, as the content is too extensive and therefore further decomposition probably seems appropriate.
This rule is based on the CQM Quality Indicator: Gottpaket (p. 204-206).
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 |
|---|---|---|---|
namespace_to_big |
This namespace contains {val} members, it should contain no more than {max_number_of_members} members. |
None |
False |
Options¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
This rule shares the following common metric options: base_view_name
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
allowed_namespaces¶
allowed_namespaces : set[str] = set()
count_routines¶
count_routines : bool = True
count_templates¶
count_templates : bool = True
include_anonymous¶
include_anonymous : bool = False
max_number_of_members¶
max_number_of_members : int | None = 50