CQM-Namespacelet¶
Namespaces shall not contain too few classes and/or routines
Required inputs: IR, RFG
Any namespace that contains less than 3 classes and routines is a violation of this rule.
Motivation
A very small package/ namespace offers no or very little functionality. Thus the sense of the package/namespace seems questionable. However, since a superfluous package/namespace makes it more difficult to understand the overall system, it is better to distribute the functionality contained there to other packages.
This rule is based on the CQM Quality Indicator: Paketchen (p. 258-260).
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_not_enough_members |
This namespace contains only {val} members, it should contain at least {min_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
min_number_of_members¶
min_number_of_members : int | None = 3