CQM-InformalDocumentation¶
Public routines should be formally documented
Required inputs: IR
Motivation
Source code documentation mechanisms - such as Doxygen - provide a uniform, well-known standard that can be used to document the code and, for example, generate easily readable API documentation in the form of HTML pages. Newer IDEs such as Eclipse can already generate such documentation skeletons automatically. If programmers do not adhere to the specified mechanisms or if no such mechanisms are specified, there can be no manageable, comprehensive documentation that can be edited with tools and is up-to-date.
This rule is based on the CQM Quality Indicator: informelle Dokumentation (p. 222-224).
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 |
|---|---|---|---|
missing_doxygen_comment_before_def |
No Doxygen comment before definition. |
None |
False |
missing_doxygen_comment_for_def |
No Doxygen comment for definition. |
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
add_extra_info¶
add_extra_info : bool = False
allow_inherited¶
allow_inherited : bool = False
allow_missing_documentation_on_private¶
allow_missing_documentation_on_private : bool = True
private.
allow_missing_documentation_on_protected¶
allow_missing_documentation_on_protected : bool = True
protected.
doxygen_start¶
doxygen_start : set[str] = {'/**', '///'}
doxygen_trailer¶
doxygen_trailer : set[str] = set()
{'///<'}, that indicate trailing Doxygen
comments.
If this set is not empty, also trailing comments are accepted and leading comments
must not look like trailing Doxygen comments.
ignore_defaulted¶
ignore_defaulted : bool = False
ignore_deleted¶
ignore_deleted : bool = False
ignore_redefinitions¶
ignore_redefinitions : bool = False
ignore_tool_comments¶
ignore_tool_comments : bauhaus.analysis.config.SearchPattern | None = None
lines_after¶
lines_after : int = 2
lines_before¶
lines_before : int = 4
node_types¶
node_types : set[bauhaus.ir.PIR_Class_Name] = {'Routine_Definition'}
stop_tokens¶
stop_tokens : set[str] = {'#define', '#include', ';', '{', '}'}
#include as stop token, leading comments in a file have
been frequently mistaken as comments of the first definition. The former default
value did not include #include. Other sensible stop tokens may be
#pragma, #if, #idef, #ifndef and
#endif.