MISRA C++ 2023 Rules in CppDepend
Understanding CppDepend Support for MISRA C++ 2023 Compliance
In today's rapidly evolving automotive industry, the importance of reliable and safe software cannot be overstated. The Motor Industry Software Reliability Association (MISRA) plays a crucial role in establishing best practices for developing safety-related electronic systems in road vehicles and other embedded systems. As a collaborative effort between vehicle manufacturers, component suppliers, and engineering consultancies, MISRA aims to ensure the highest standards in software reliability.
One essential tool for achieving MISRA C++ compliance is CppDepend, which helps developers adhere to these stringent guidelines. In this comprehensive guide, we will explore the pivotal role of MISRA in the automotive industry and how CppDepend can support developers in creating safer, more reliable software for vehicles and embedded systems.
MISRA C++ 2023 is the current version of the guidelines, merging and superseding MISRA C++ 2008 and AUTOSAR C++14. For the official guideline texts, see misra.org.uk.
Using MISRA C++ 2023 Rules in CppDepend
MISRA C++ 2023 rules are enabled out of the box. After analyzing your project, open the Queries and Rules Explorer and expand the Misra C++ 2023 group under Coding Standards to browse all the rules.

Each rule shows the number of issues found. Click a rule to see the matching issues in the result panel below, with the file name, line, estimated debt and severity for each violation. Double-click an issue to jump straight to the corresponding source code.
List of MISRA C++ 2023 Rules
CppDepend offers support for 137 MISRA C++ 2023 rules.
To gain a deeper understanding of each rule and its rationale, please consult the official MISRA C++ 2023 guidelines.
- 6 Language independent issues
- 3 General principles
- 11 Lexicals conventions
- 14 Basic concepts
- 6 Standard conversions
- 23 Expressions
- 11 Statements
- 8 Declarations
- 5 Declarators
- 4 Classes
- 6 Derived classes
- 1 Member access control
- 2 Special member functions
- 6 Constructors
- 3 Overloading
- 1 Templates
- 8 Exception handling
- 5 Preprocessing directives
- 14 Language support library
Language independent issues
Rule 0-0-1 — A function shall not contain unreachable statements
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_unreachable" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 0-0-2 — Controlling expressions should not be invariant
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="CppCheck" && issue.Type=="knownConditionTrueFalse" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 0-2-1 — Variables with limited visibility should be used at least once
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="Clang" && issue.Type=="warn_unused_variable" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 0-2-2 — A named function parameter shall be used at least once
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="Clang" && issue.Type=="warn_unused_parameter" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 0-3-1 — Floating-point arithmetic should be used appropriately
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="Clang" && issue.Type.Contains("float_") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 0-3-2 — A function call shall not violate the function’s preconditions
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="CppCheck" && issue.Type=="wrongmathcall" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}General principles
Rule 4-1-2 — Deprecated features should not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.Type.Contains("deprecated") || issue.Type.Contains("llvmlibc-restrict-system-libc-headers") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 4-1-3 — There shall be no occurrence of undefined or critical unspecified behaviour
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="Clang" && issue.Type.Contains("shift-") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 4-6-1 — Operations on a memory location shall be sequenced appropriately
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues
where issue.ToolName=="Clang" && issue.Type.Contains("warn_unsequenced") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Lexicals conventions
Rule 5-0-1 — Trigraphs shall not be used
This coding standard is computed with the following query:
//<Rule>MISRA-5-0-1</RuleID>
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="trigraph_ignored" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-7-1 — The character sequence /* shall not be used within a C-style comment
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_nested_block_comment" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-7-3 — Line-splicing shall not be used in // comments
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="ext_multi_line_line_comment" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-10-1 — User-defined identifiers shall have an appropriate form.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && (issue.Type=="warn_user_literal_reserved" || issue.Type=="warn_variable_underscore") && !issue.Name.Contains("__range") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-1 — Within character literals and non raw-string literals, \ shall only be used to form a defined escape sequence or universal character name
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="ext_unknown_escape" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-2 — Octal escape sequences, hexadecimal escape sequences and universal character names shall be terminated
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_literal_improper" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-3 — Octal constants shall not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_octal_not_allowed" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-4 — Unsigned integer literals shall be appropriately sufixed
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_compliant_auto" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-5 — The lowercase form of L shall not be used as the first character in a literal suffix
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_lowercase_suffix" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-6 — An integer-literal of type long long shall not use a single L or l in any suffix
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_literal_long_long" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 5-13-7 — String literals with different encoding prefixes shall not be concatenated
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_literal_concat" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Basic concepts
Rule 6-0-1 — Block scope declarations shall not be visually ambiguous
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_block_ambiguous" || issue.Type=="warn_redundant_parens_around_declarator"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-0-2 — When an array with external linkage is declared, its size should be explicitly specified
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_external_array"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-0-3 — The only declarations in the global namespace should be main, namespace declarations and extern "C" declarations
This coding standard is computed with the following query:
warnif count > 0
from method in JustMyCode.Methods
where method.SimpleName != "main"
&& method.SimpleName != "wmain"
&& method.SimpleName != "_tmain"
&& method.SimpleName != "WinMain"
&& method.SimpleName != "wWinMain"
&& method.SimpleName != "DllMain"
&& method.SimpleName != "ServiceMain"
&& method.SimpleName != "DriverEntry"
&& method.IsGlobal
&& !method.IsExternC
&& method.ParentNamespace.Name == ""
select new {
method,
Debt = 10.ToMinutes().ToDebt(),
Severity = Severity.High
}Rule 6-0-4 — The identifier main shall not be used for a function other than the global function main
This coding standard is computed with the following query:
warnif count > 0
from method in JustMyCode.Methods where method.SimpleName=="main" && method.IsGlobal && method.ParentNamespace.Name!=""
select new { method,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-2-4 — A header file shall not contain definitions of functions or objects that are non-inline and have external linkage
This coding standard is computed with the following query:
warnif count > 0
from m in JustMyCode.Methods where m.NbLinesOfCode>0 && !m.IsInline
&& m.SourceDecls.First().SourceFile.FileNameExtension.StartsWith("h")
select new { m,IncludeFile=m.SourceDecls.First().SourceFile.FilePathString,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High }Rule 6-4-1 — A variable declared in an inner scope shall not hide a variable declared in an outer scope
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_decl_shadow"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-4-2 — Derived classes shall not conceal functions that are inherited from their bases
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_overloaded_virtual"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-5-1 — A function or object with external linkage should be introduced in a header file
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_missing_prototype"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-5-2 — Internal linkage should be specified appropriately
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_internal_linkage"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-7-1 — Local variables shall not have static storage duration
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_local_static"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-7-2 — Global variables shall not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_global_variable"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 6-8-1 — An object shall not be accessed outside of its lifetime
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="CppCheck" && issue.Type=="deallocuse"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-8-2 — A function must not return a reference or a pointer to a local variable with automatic storage duration
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="CppCheck" && issue.Type=="returnDanglingLifetime" || issue.Type=="returnReference"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 6-8-4 — Member functions returning references to their object should be refqualified appropriately
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_ref_this"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Standard conversions
Rule 7-0-1 — There shall be no conversion from type bool.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang-Tidy" && issue.Type=="readability-implicit-bool-conversion"
&& issue.Description.Contains("'bool' ->")
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 7-0-2 — There shall be no conversion to type bool
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang-Tidy" && issue.Type=="readability-implicit-bool-conversion"
&& issue.Description.Contains("-> 'bool'")
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 7-0-3 — The numerical value of a character shall not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_num_char"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 7-0-4 — The operands of bitwise operators and shift operators shall be appropriate
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang-Tidy" && issue.Type=="hicpp-signed-bitwise"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 7-11-1 — nullptr shall be the only form of the null-pointer-constant
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_zero_as_null_pointer_constant"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 7-11-2 — An array passed as a function argument shall not decay to a pointer
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang-Tidy" && issue.Type=="cppcoreguidelines-pro-bounds-array-to-pointer-decay,hicpp-no-array-decay"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Expressions
Rule 8-0-1 — Parentheses should be used to make the meaning of an expression appropriately explicit
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang"
&& (issue.Type=="warn_logical_and_in_logical_or" || issue.Type=="warn_addition_in_bitshift")
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-1-1 — A non-transient lambda shall not implicitly capture this
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang"
&& issue.Type=="warn_deprecated_this_capture"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-1-2 — Variables should be captured explicitly in a non-transient lambda
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang"
&& issue.Type=="warn_transient_lambda"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-1 — A virtual base class shall only be cast to a derived class by means of dynamic_cast
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang"
&& issue.Type=="warn_reinterpret_different_from_static"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-2 — C-style casts and functional notation casts shall not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_old_style_cast" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-3 — A cast shall not remove any const or volatile qualification from the type accessed via a pointer or by reference
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_remove_const" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-4 — A cast shall not convert a pointer to a function to any other pointer type, including a pointer to function type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_cxx98_compat_cast_fn_obj" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-5 — reinterpret_cast shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_reinterpret_cast" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-6 — An object with integral, enumerated, or pointer to void type shall not be cast to a pointer type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_cast_to_pointer" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-7 — A cast should not convert a pointer type to an integral type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_cast_int_to_pointer" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-8 — An object pointer type shall not be cast to an integral type other than std::uintptr_t or std::intptr_t
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_cast_to_pointer_exception" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-9 — The operand to typeid shall not be an expression of polymorphic.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_typeid_polymorphic" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-2-10 — Functions shall not call themselves, either directly or indirectly.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="misc-no-recursion" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-2-11 — An argument passed via ellipsis shall have an appropriate type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_ellipsis" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-3-1 — The built-in unary - operator should not be applied to an expression of unsigned type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_minus_operator" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-3-2 — The built-in unary + operator should not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_plus_operator" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 8-7-1 — Pointer arithmetic shall not form an invalid pointer.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where
(issue.Type=="warn_ptr_arith_exceeds_bounds" || issue.Type=="warn_unsafe_buffer_operation") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-7-2 — Subtraction between pointers shall only be applied to pointers that address elements of the same array.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_array_substraction" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-9-1 — >, >=, <, <= shall not be applied to objects of pointer type, except where they point to the same array.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="CppCheck" && issue.Type=="comparePointers" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-14-1 — The right-hand operand of a logical && or || operator should not contain persistent side effects.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_side_effects" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-18-1 — An object or subobject must not be copied to an overlapping object.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_impcast_integer_precision" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-18-2 — The result of an assignment operator should not be used
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_condition_is_assignment" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 8-19-1 — The comma operator shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_comma_operator" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Statements
Rule 9-2-1 — An explicit type conversion shall not be an expression statement
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_functional_conversion" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-3-1 — The body of an iteration-statement or a selection-statement shall be a compound-statement
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_compound_statement"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 9-4-1 — All if ... else if constructs shall be terminated with an else statement.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_elseif_statement"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-4-2 — A switch statement shall be a well-formed switch statement.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_switch_structure" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-5-1 — Legacy for statements should be simple.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_for_structure" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-5-2 — A for-range-initializer shall contain at most one function call.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_forrange_structure" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-6-1 — The goto statement should not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_goto" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-6-2 — Any label referenced by a goto statement shall be declared in the same block, or in a block enclosing the goto statement.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_jump_out_of_scope" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-6-3 — The goto statement shall jump to a label declared later in the function body.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_goto_label" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-6-4 — A function declared with the [[noreturn]] attribute shall not return.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_falloff_noreturn_function" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 9-6-5 — A function with non-void return type shall return a value on all paths.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_falloff_nonvoid_function" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Declarations
Rule 10-0-1 — A declaration should not declare more than one variable or member variable.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_multivariables_decl" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-1-1 — The target type of a pointer or lvalue reference parameter should be const-qualified appropriately.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang-Tidy" && issue.Type=="readability-non-const-parameter" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-1-2 — The volatile qualifier shall be used appropriately.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_volatile" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-2-1 — An enumeration shall be defined with an explicit underlying type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_enum_type" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-2-2 — Unscoped enumerations should not be declared.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_enum_scoped" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-2-3 — The numeric value of an unscoped enumeration with no fixed underlying type shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_enum_scoped_num" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 10-3-1 — There shall be no unnamed namespaces in header files.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_namesapce_header"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 10-4-1 — The asm declaration shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_asm_used"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Declarators
Rule 11-3-1 — Variables of array type should not be declared.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_array_declared"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 11-3-2 — The declaration of an object should contain no more than two levels of pointer indirection.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_many_pointers"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 11-6-1 — All variables should be initialized.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_misra_uninit_var"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 11-6-2 — The value of an object must not be read before it has been set.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_uninit_var"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 11-6-3 — Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_misra_enums"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Classes
Rule 12-2-1 — Bit-fields should not be declared.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_bitfield"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 12-2-2 — A bit-field shall have an appropriate type.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_bitfield_type"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 12-2-3 — A named bit-field with signed integer type shall not have a length of one bit.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_bitfield_size"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 12-3-1 — The union keyword shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_union_used"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Derived classes
Rule 13-1-1 — Classes should not be inherited virtually.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_virtual_inheritance"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 13-3-2 — An accessible base class shall not be both virtual and non-virtual in the same hierarchy.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_notvirtual_inheritance"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 13-3-1 — User-declared member functions shall use the virtual, override and final specifiers appropriately.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_virtual_override_final"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 13-3-2 — Parameters in an overriding virtual function shall not specify different default arguments.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_override_params"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 13-3-3 — The parameters in all declarations or overrides of a function shall either be unnamed or have identical names.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_override_compatibility"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 13-3-4 — A comparison of a potentially virtual pointer to member function shall only be with nullptr
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_compare_member_nullptr"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Member access control
Rule 14-1-1 — Non-static data members should be either all private or all public
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_class_public_private"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Special member functions
Rule 15-0-1 — Special member functions shall be provided appropriately
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_class_structure"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-0-2 — User-provided copy and move member functions of a class should have appropriate signatures
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_move_signature"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Constructors
Rule 15-1-1 — An object’s dynamic type shall not be used from within its constructor or destructor
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_dynamic_constructor_destructor"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-1-2 — All constructors of a class should explicitly initialize all of its virtual base classes and immediate base classes
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_constructor_bases"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-1-3 — Conversion operators and constructors that are callable with a single argument shall be explicit
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_explicit"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-1-4 — All direct, non-static data members of a class should be initialized before the class object is accessible
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_init_members"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-1-5 — A class shall only define an initializer-list constructor when it is the only constructor
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_only_constructor"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 15-8-1 — User-provided copy assignment operators and move assignment operators shall handle self-assignment
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_copy_move_assignment"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Overloading
Rule 16-5-1 — The logical AND and logical OR operators shall not be overloaded
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_overload_operators"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 16-5-2 — The address-of operator shall not be overloaded
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_overload_addressof"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 16-6-1 — Symmetrical operators should only be implemented as non-member functions
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_symetric_operators"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Templates
Rule 17-8-1 — Function templates shall not be explicitly specialized
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_template_specialisation"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Exception handling
Rule 18-1-1 — An exception object shall not have pointer type
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_exception_pointer"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 18-1-2 — An empty throw shall only occur within the compound-statement of a catch handler
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_empty_throw"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 18-3-1 — There should be at least one exception handler to catch all otherwise unhandled exceptions
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_catch_main"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High}Rule 18-3-2 — An exception of class type shall be caught by const reference or reference.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="catchExceptionByValue"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 18-3-3 — Handlers for a function-try-block of a constructor or destructor shall not refer to non-static members from their class or its bases.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_tryfunction_access"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 18-4-1 — Exception-unfriendly functions shall be noexcept.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_exception_noexcept"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 18-5-1 — A noexcept function should not attempt to propagate an exception to the calling function.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_propagation_noexcept"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 18-5-2 — Program-terminating functions should not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_terminating_functions"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Preprocessing directives
Rule 19-0-1 — A line whose first token is # shall be a valid preprocessing directive.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_pp_invalid_directive"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 19-0-2 — Function-like macros shall not be defined.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_macro_function"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 19-1-3 — All identifers used in the controlling expression of #if or #elif preprocessing directives shall be defined prior to evaluation.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_pp_undef_identifier"
select new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.High
}Rule 19-3-1 — The # and ## operators should not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_pp_hash_used" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 19-3-4 — Parentheses shall be used to ensure macro arguments are expanded appropriately.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="bugprone-macro-parentheses" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Language support library
Rule 21-2-1 — The library functions atof, atoi, atol and atoll from <cstdlib> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_cstdlib" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-2-2 — The string handling functions from <cstring>, <cstdlib>, <cwchar> and <cinttypes> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_unsafe_buffer_libc_call" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-2-3 — The library function system from <cstdlib> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_exit_called" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-2-4 — The macro offsetof shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_offsetof_called" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-6-2 — Dynamic memory shall be managed automatically.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_memory_management" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-6-3 — Advanced memory management shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.ToolName=="Clang" && issue.Type=="warn_advanced_memory_management" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-6-4 — If a project defines either a sized or unsized version of a global operator delete, then both shall be defined.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type.Contains("cert-dcl54-cpp") select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-6-5 — A pointer to an incomplete class type shall not be deleted.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_delete_incomplete" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-10-1 — The features of <cstdarg> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_cstdarg" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-10-2 — The standard header file <csetjmp> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_csetjump" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 21-10-3 — The facilities provided by the standard header file <csignal> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_signal" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 24-5-1 — The character handling functions from <cctype> and <cwctype> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_cctype" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 24-5-2 — The C++ Standard Library functions memcpy, memmove and memcmp from <cstring> shall not be used.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_cstring" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Rule 25-5-1 — The setlocale and std::locale::global functions shall not be called.
This coding standard is computed with the following query:
warnif count > 0
from issue in ImportedIssues where issue.Type=="warn_locale" select
new { issue, FileName = issue.SourceDecl.SourceFile.FileName,Line = issue.BeginLine ,issue.FilePath,
Debt = 10.ToMinutes().ToDebt(),
Severity =Severity.Medium
}Try CppDepend Today
Start your 14-day free trial with full access to all documentation features. No credit card required.
