Skip to content

CXX Rules

guwirth edited this page Feb 3, 2021 · 11 revisions

The cxx plugin has a few built-in rules. These are available in the repository cxx. Rules for static code analysis are intentionally omitted and users are referred to external tools such as Cppcheck and Clang-Tidy.

category rule id description
api UndocumentedApi To check if public APIs are documented.
error ParsingError To display CXX parser errors.
error ParsingErrorRecovery To display CXX parser errors with resulting error recovery.
file FileEncoding To check if all characters of a file can be represented in a character set.
file MissingNewLineAtEndOfFile To check for files with missing new line at the end.
file TabCharacter To check if a file contains a tab.
metrics ClassComplexity To check the cyclomatic complexity of a class against a threshold.
metrics FileComplexity To check the cyclomatic complexity of a file against a threshold.
metrics FunctionCognitiveComplexity To check the cognitive complexity of a function against a threshold.
metrics FunctionComplexity To check the cyclomatic complexity of a function against a threshold.
metrics TooLongLine To check if a line of source code is too long.
metrics TooManyLinesOfCodeInFile To check if a file has too many lines.
metrics TooManyLinesOfCodeInFunction To check if a function has too many lines.
metrics TooManyParameters To check if a function has too many parameters.
metrics TooManyStatementsPerLine To check the number of statements in a line.
naming ClassName To check a class name against a naming convention.
naming FileName To check a filename against a naming convention.
naming FunctionName To check a function name against a naming convention.
naming MethodName To check a method name against a naming convention.
regex CommentRegularExpression To search for a regular expression within a comment. This rule template can be used to define your own custom rules.
regex FileHeader To check if each file contains a file header.
regex FileRegularExpression To search for a regular expression within a file. This rule template can be used to define your own custom rules.
regex FixmeTagPresence To check if a file contains a FIXME comment.
regex LineRegularExpression To search for a regular expression within a line. This rule template can be used to define your own custom rules.
regex NoSonar To check if a file contains a //NOSONAR comment.
regex TodoTagPresence To check if a file contains a TODO comment.
xpath XPath For defining and checking XPath expressions. This rule template can be used to define your own custom rules.
Clone this wiki locally