CodeCheck Documentation CodeCheck Documentation - SciTools' Recommended Checks |
This collection of standards identifies the violations we feel are the greatest hindrance to code safety, readability, best practice and maintainability.
The majority of these checks appear in one form or another in published best practices and generally accepted coding standards.
You can use these checks to get an idea of how cluttered or brilliant the code base is. You might use them as a basis for developing your own standards. Or you can ignore this collection completely and test your code against a published coding standard or select your own checks from the "All Checks" library.
If you can't find the checks you want here, we would be happy to help you develop checks to match your standards. Just send us an email at [email protected].
Check ID | Check Name | Supported | Category | Severity |
---|---|---|---|---|
CPP_CT_BUGPRONE_ASSERT_SIDE_EFFECT | Assert Side Effect | Yes | High | |
CPP_CT_BUGPRONE_BRANCH_CLONE | Branch Clone | Yes | High | |
CPP_CT_BUGPRONE_COPY_CONSTRUCTOR_INIT | Copy Constructor Init | Yes | High | |
CPP_CT_BUGPRONE_INFINITE_LOOP | Infinte Loop | Yes | High | |
CPP_CT_BUGPRONE_MACRO_REPEATED_SIDE_EFFECTS | Macro Side Effects | Yes | High | |
CPP_CT_BUGPRONE_NOT_NULL_TERMINATED_RESULT | Missing Null Terminator | Yes | High | |
CPP_CT_BUGPRONE_REDUNDANT_BRANCH_CONDITION | Redundant Condition | Yes | High | |
CPP_CT_READABILITY_DELETE_NULL_POINTER | Delete Null Pointer | Yes | High | |
CPP_CT_READABILITY_REDUNDANT_CASTING | Redundant Cast | Yes | High | |
CPP_SA_DANGLING_POINTERS | Dangling Pointer | Yes | High | |
CPP_SA_DIV_ZERO | Division by Zero | Yes | High | |
CPP_SA_LEAKS | Memory Leak | Yes | High | |
CPP_SA_NULL_PTR | Null Pointer Dereference | Yes | High | |
CPP_SA_STACK_ADDRESS_ESCAPE | Stack Address Escape | Yes | High | |
CPP_SA_UNDEFINED_CALL | Undefined Call | Yes | High | |
CPP_SA_UNINITIALIZED | Uninitialized Value | Yes | High | |
CPP_SA_VIRTUAL_CALLS | Virtual Call | Yes | High | |
CPP_WARN_ADDRESS_OF_TEMPORARY | Do Not Take the Address of Temporary Objects | Yes | High | |
CPP_WARN_ARRAY_BOUNDS | Array Bounds | Yes | High | |
CPP_WARN_AVAILABILITY | Availability Attribute | Yes | High | |
CPP_WARN_BACKSLASH_NEWLINE_ESCAPE | Backslash Newline Escape | Yes | High | |
CPP_WARN_BITFIELD_CONSTANT_CONVERSION | Bitfield Constant Conversion | Yes | High | |
CPP_WARN_BITFIELD_WIDTH | Do Not Exceed Bit-Field Width | Yes | High | |
CPP_WARN_BOOL_CONVERSION | Bool Conversion | Yes | High | |
CPP_WARN_BUILTIN_MACRO_REDEFINED | Builtin Macro Redefined | Yes | High | |
CPP_WARN_BUILTIN_MEMCPY_CHK_SIZE | Builtin Memcpy Check Size | Yes | High | |
CPP_WARN_CALL_TO_PURE_VIRTUAL_FROM_CTOR_DTOR | Call to Pure Virtual from Constructor or Destructor | Yes | High | |
CPP_WARN_CAST_QUAL_UNRELATED | Cast Qualifiers Unrelated | Yes | High | |
CPP_WARN_CLASS_CONVERSION | Class Conversion | Yes | High | |
CPP_WARN_COMPARE_DISTINCT_POINTER_TYPES | Compare Distinct Pointer Types | Yes | High | |
CPP_WARN_COMPOUND_TOKEN_SPLIT_BY_MACRO | Compound Token Split by Macro | Yes | High | |
CPP_WARN_CONDITIONAL_TYPE_MISMATCH | Conditional Type Mismatch | Yes | High | |
CPP_WARN_CONSTANT_CONVERSION | Constant Conversion | Yes | High | |
CPP_WARN_CONSTANT_LOGICAL_OPERAND | Constant Logical Operand | Yes | High | |
CPP_WARN_CPP11_COMPAT_DEPRECATED_WRITABLE_STRINGS | C++11 Compatibility Deprecated Writable Strings | Yes | High | |
CPP_WARN_DANGLING | Dangling Pointers | Yes | High | |
CPP_WARN_DANGLING_FIELD | Dangling Field | Yes | High | |
CPP_WARN_DANGLING_GSL | Dangling Pointers Found by Guidelines Support Library | Yes | High | |
CPP_WARN_DANGLING_INITIALIZER_LIST | Dangling Initializer List | Yes | High | |
CPP_WARN_DEFAULTED_FUNCTION_DELETED | Defaulted Function Deleted | Yes | High | |
CPP_WARN_DELEGATING_CTOR_CYCLES | Delegating Constructor Cycles | Yes | High | |
CPP_WARN_DELETE_ABSTRACT_NON_VIRTUAL_DTOR | Delete Abstract Non-Virtual Destructor | Yes | High | |
CPP_WARN_DELETE_INCOMPLETE | Delete Incomplete | Yes | High | |
CPP_WARN_DEPRECATED_BUILTINS | Deprecated Builtins | Yes | High | |
CPP_WARN_DEPRECATED_DECLARATIONS | Deprecated Declarations | Yes | High | |
CPP_WARN_DEPRECATED_INCREMENT_BOOL | Deprecated Increment Bool | Yes | High | |
CPP_WARN_DEPRECATED_NON_PROTOTYPE | Deprecated Non-Prototype | Yes | High | |
CPP_WARN_DEPRECATED_REGISTER | Deprecated Register | Yes | High | |
CPP_WARN_DEPRECATED_VOLATILE | Deprecated Volatile | Yes | High | |
CPP_WARN_DIVISION_BY_ZERO | Division by Zero | Yes | High | |
CPP_WARN_DYNAMIC_CLASS_MEMACCESS | Dynamic Class Memory Access | Yes | High | |
CPP_WARN_ENUM_COMPARE | Enum Compare | Yes | High | |
CPP_WARN_ENUM_COMPARE_SWITCH | Enum Compare Switch | Yes | High | |
CPP_WARN_EXCEPTIONS | Exceptions | Yes | High | |
CPP_WARN_EXTERN_C_COMPAT | Extern C Compatibility | Yes | High | |
CPP_WARN_EXTERN_INITIALIZER | Extern Initializer | Yes | High | |
CPP_WARN_EXTRA_QUALIFICATION | Extra Qualification | Yes | High | |
CPP_WARN_FIXED_POINT_OVERFLOW | Fixed Point Overflow | Yes | High | |
CPP_WARN_FLAG_ENUM | Flag Enum | Yes | High | |
CPP_WARN_FORMAT | Format String | Yes | High | |
CPP_WARN_FORMAT_EXTRA_ARGS | Format Extra Args | Yes | High | |
CPP_WARN_FORMAT_INSUFFICIENT_ARGS | Format Insufficient Args | Yes | High | |
CPP_WARN_FORMAT_INVALID_SPECIFIER | Format Invalid Specifier | Yes | High | |
CPP_WARN_FORMAT_SECURITY | Format Security | Yes | High | |
CPP_WARN_FORMAT_ZERO_LENGTH | Format Zero Length | Yes | High | |
CPP_WARN_FORTIFY_SOURCE | Fortify Source | Yes | High | |
CPP_WARN_FREE_NONHEAP_OBJECT | Free Non-Heap Object | Yes | High | |
CPP_WARN_HEADER_GUARD | Header Guard | Yes | High | |
CPP_WARN_IGNORED_ATTRIBUTES | Ignored Attributes | Yes | High | |
CPP_WARN_IGNORED_REFERENCE_QUALIFIERS | Ignored Reference Qualifiers | Yes | High | |
CPP_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION | Implicit Const Int Float Conversion | Yes | High | |
CPP_WARN_IMPLICIT_CONVERSION_FLOATING_POINT_TO_BOOL | Implicit Conversion Floating Point to Bool | Yes | High | |
CPP_WARN_IMPLICIT_EXCEPTION_SPEC_MISMATCH | Implicit Exception Spec Mismatch | Yes | High | |
CPP_WARN_IMPLICIT_FIXED_POINT_CONVERSION | Implicit Fixed Point Conversion | Yes | High | |
CPP_WARN_IMPLICITLY_UNSIGNED_LITERAL | Implicitly Unsigned Literal | Yes | High | |
CPP_WARN_INACCESSIBLE_BASE | Inaccessible Base | Yes | High | |
CPP_WARN_INCOMPATIBLE_EXCEPTION_SPEC | Incompatible Exception Spec | Yes | High | |
CPP_WARN_INCOMPATIBLE_LIBRARY_REDECLARATION | Incompatible Library Redeclaration | Yes | High | |
CPP_WARN_INCOMPATIBLE_POINTER_TYPES | Incompatible Pointer Types | Yes | High | |
CPP_WARN_INCOMPATIBLE_POINTER_TYPES_DISCARDS_QUALIFIERS | Incompatible Pointer Types Discards Qualifiers | Yes | High | |
CPP_WARN_INCONSISTENT_MISSING_OVERRIDE | Inconsistent Missing Override | Yes | High | |
CPP_WARN_INCREMENT_BOOL | Increment Bool | Yes | High | |
CPP_WARN_INJECTED_CLASS_NAME | Injected Class Name | Yes | High | |
CPP_WARN_INLINE_NAMESPACE_REOPENED_NONINLINE | Inline Namespace Reopened Non-Inline | Yes | High | |
CPP_WARN_INSTANTIATION_AFTER_SPECIALIZATION | Instantiation After Specialization | Yes | High | |
CPP_WARN_INT_TO_POINTER_CAST | Int to Pointer Cast | Yes | High | |
CPP_WARN_INT_TO_VOID_POINTER_CAST | Int to Void Pointer Cast | Yes | High | |
CPP_WARN_INTEGER_OVERFLOW | Integer Overflow | Yes | High | |
CPP_WARN_INVALID_NO_BUILTIN_NAMES | Invalid No Builtin Names | Yes | High | |
CPP_WARN_INVALID_NORETURN | Invalid Noreturn Attribute | Yes | High | |
CPP_WARN_INVALID_OFFSETOF | Invalid Offsetof | Yes | High | |
CPP_WARN_INVALID_PP_TOKEN | Invalid Preprocessor Token | Yes | High | |
CPP_WARN_LARGE_BY_VALUE_COPY | Large by Value Copy | Yes | High | |
CPP_WARN_LITERAL_CONVERSION | Literal Conversion | Yes | High | |
CPP_WARN_LITERAL_RANGE | Literal Range | Yes | High | |
CPP_WARN_LOGICAL_NOT_PARENTHESES | Logical Not Parentheses | Yes | High | |
CPP_WARN_MACRO_REDEFINED | Macro Redefined | Yes | High | |
CPP_WARN_MAIN_RETURN_TYPE | Main Return Type | Yes | High | |
CPP_WARN_MANY_BRACES_AROUND_SCALAR_INIT | Many Braces Around Scalar Init | Yes | High | |
CPP_WARN_MAX_UNSIGNED_ZERO | Max Unsigned Zero | Yes | High | |
CPP_WARN_MEMSET_TRANSPOSED_ARGS | Memset Transposed Args | Yes | High | |
CPP_WARN_MEMSIZE_COMPARISON | Memsize Comparison | Yes | High | |
CPP_WARN_MISMATCHED_NEW_DELETE | Mismatched New Delete | Yes | High | |
CPP_WARN_MISSING_DECLARATIONS | Missing Declarations | Yes | High | |
CPP_WARN_MISSING_EXCEPTION_SPEC | Missing Exception Spec | Yes | High | |
CPP_WARN_MULTICHAR | Multiple Characters in Character Literal | Yes | High | |
CPP_WARN_MULTIPLE_MOVE_VBASE | Multiple Move Virtual Base | Yes | High | |
CPP_WARN_NEW_RETURNS_NULL | New Returns Null | Yes | High | |
CPP_WARN_NODEREF | Noderef Attirbute | Yes | High | |
CPP_WARN_NON_C_TYPEDEF_FOR_LINKAGE | Non-C Typedef for Linkage | Yes | High | |
CPP_WARN_NON_LITERAL_NULL_CONVERSION | Non-Literal Null Conversion | Yes | High | |
CPP_WARN_NON_POD_VARARGS | Non-POD (Plain Old Data) Variadic Arguments | Yes | High | |
CPP_WARN_NON_POWER_OF_TWO_ALIGNMENT | Non-Power of Two Alignment | Yes | High | |
CPP_WARN_NONNULL | Null as an Argument | Yes | High | |
CPP_WARN_NONPORTABLE_INCLUDE_PATH | Non-Portable Include Path | Yes | High | |
CPP_WARN_NONTRIVIAL_MEMACCESS | Nontrivial Memory Access | Yes | High | |
CPP_WARN_NULL_ARITHMETIC | Null Arithmetic | Yes | High | |
CPP_WARN_NULL_CHARACTER | Null Character | Yes | High | |
CPP_WARN_NULL_CONVERSION | Null Conversion | Yes | High | |
CPP_WARN_NULL_DEREFERENCE | Null Dereference | Yes | High | |
CPP_WARN_ODR | One Definition Rule | Yes | High | |
CPP_WARN_ORDERED_COMPARE_FUNCTION_POINTERS | Ordered Compare Function Pointers | Yes | High | |
CPP_WARN_OUT_OF_SCOPE_FUNCTION | Out of Scope Function | Yes | High | |
CPP_WARN_OVERLOADED_SHIFT_OP_PARENTHESES | Overloaded Shift Operator Parentheses | Yes | High | |
CPP_WARN_PARENTHESES_EQUALITY | Parentheses Equality | Yes | High | |
CPP_WARN_POINTER_ARITH | Pointer Arithmetic | Yes | High | |
CPP_WARN_POINTER_BOOL_CONVERSION | Pointer Bool Conversion | Yes | High | |
CPP_WARN_POINTER_COMPARE | Pointer Compare | Yes | High | |
CPP_WARN_POINTER_INTEGER_COMPARE | Pointer Integer Compare | Yes | High | |
CPP_WARN_POINTER_SIGN | Pointer Sign | Yes | High | |
CPP_WARN_POINTER_TO_ENUM_CAST | Pointer to Enum Cast | Yes | High | |
CPP_WARN_POINTER_TO_INT_CAST | Pointer to Int Cast | Yes | High | |
CPP_WARN_POINTER_TYPE_MISMATCH | Pointer Type Mismatch | Yes | High | |
CPP_WARN_POTENTIALLY_EVALUATED_EXPRESSION | Potentially Evaluated Expression | Yes | High | |
CPP_WARN_PRAGMA_ONCE_OUTSIDE_HEADER | Pragma once Outside Header | Yes | High | |
CPP_WARN_QUALIFIED_VOID_RETURN_TYPE | Qualified Void Return Type | Yes | High | |
CPP_WARN_REDECLARED_CLASS_MEMBER | Re-Declared Class Member | Yes | High | |
CPP_WARN_REDUNDANT_CONSTEVAL_IF | Redundant Consteval If | Yes | High | |
CPP_WARN_REINTERPRET_BASE_CLASS | Reinterpret Base Class | Yes | High | |
CPP_WARN_REORDER_INIT_LIST | Reorder Initializer List | Yes | High | |
CPP_WARN_RETURN_STACK_ADDRESS | Return Stack Address | Yes | High | |
CPP_WARN_RETURN_TYPE | Return Type | Yes | High | |
CPP_WARN_RETURN_TYPE_C_LINKAGE | Return Type C Linkage | Yes | High | |
CPP_WARN_SELF_ASSIGN_FIELD | Self Assign Field | Yes | High | |
CPP_WARN_SHIFT_COUNT_NEGATIVE | Shift Count Negative | Yes | High | |
CPP_WARN_SHIFT_COUNT_OVERFLOW | Shift Count Overflow | Yes | High | |
CPP_WARN_SHIFT_NEGATIVE_VALUE | Shift Negative Value | Yes | High | |
CPP_WARN_SHIFT_OP_PARENTHESES | Shift Operator Parentheses | Yes | High | |
CPP_WARN_SHIFT_OVERFLOW | Shift Overflow | Yes | High | |
CPP_WARN_SINGLE_BIT_BITFIELD_CONSTANT_CONVERSION | Single Bit Bitfield Constant Conversion | Yes | High | |
CPP_WARN_SIZEOF_ARRAY_ARGUMENT | Sizeof Array Argument | Yes | High | |
CPP_WARN_SIZEOF_ARRAY_DECAY | Sizeof Array Decay | Yes | High | |
CPP_WARN_SIZEOF_ARRAY_DIV | Sizeof Array Division | Yes | High | |
CPP_WARN_SIZEOF_POINTER_DIV | Sizeof Pointer Division | Yes | High | |
CPP_WARN_SIZEOF_POINTER_MEMACCESS | Sizeof Pointer Memory Access | Yes | High | |
CPP_WARN_STATIC_INLINE_EXPLICIT_INSTANTIATION | Static Inline Explicit Instantiation | Yes | High | |
CPP_WARN_STATIC_LOCAL_IN_INLINE | Static Local in Inline | Yes | High | |
CPP_WARN_STATIC_SELF_INIT | Static Self Init | Yes | High | |
CPP_WARN_STRING_COMPARE | String Compare | Yes | High | |
CPP_WARN_STRING_PLUS_CHAR | String Plus Char | Yes | High | |
CPP_WARN_STRING_PLUS_INT | String Plus Int | Yes | High | |
CPP_WARN_STRLCPY_STRLCAT_SIZE | Strlcpy Strlcat Size | Yes | High | |
CPP_WARN_STRNCAT_SIZE | Strncat Size | Yes | High | |
CPP_WARN_SWITCH | Switch Statements | Yes | High | |
CPP_WARN_SWITCH_BOOL | Switch Bool | Yes | High | |
CPP_WARN_TAUTOLOGICAL_CONSTANT_COMPARE | Tautological Constant Compare | Yes | High | |
CPP_WARN_TAUTOLOGICAL_CONSTANT_OUT_OF_RANGE_COMPARE | Tautological Constant Out of Range Compare | Yes | High | |
CPP_WARN_TAUTOLOGICAL_POINTER_COMPARE | Tautological Pointer Compare | Yes | High | |
CPP_WARN_TAUTOLOGICAL_UNDEFINED_COMPARE | Tautological Undefined Compare | Yes | High | |
CPP_WARN_TENTATIVE_DEFINITION_INCOMPLETE_TYPE | Tentative Definition Incomplete Type | Yes | High | |
CPP_WARN_TRIGRAPHS | Trigraphs | Yes | High | |
CPP_WARN_TYPE_SAFETY | Type Safety | Yes | High | |
CPP_WARN_TYPEDEF_REDEFINITION | Typedef Redefinition | Yes | High | |
CPP_WARN_TYPENAME_MISSING | Typename Missing | Yes | High | |
CPP_WARN_UNDEFINED_BOOL_CONVERSION | Undefined Bool Conversion | Yes | High | |
CPP_WARN_UNDEFINED_INLINE | Undefined Inline | Yes | High | |
CPP_WARN_UNDEFINED_INTERNAL | Undefined Internal | Yes | High | |
CPP_WARN_UNDEFINED_VAR_TEMPLATE | Undefined Var Template | Yes | High | |
CPP_WARN_UNEVALUATED_EXPRESSION | Unevaluated Expression | Yes | High | |
CPP_WARN_UNGUARDED_AVAILABILITY_NEW | Unguarded Availability New | Yes | High | |
CPP_WARN_UNICODE | Unicode Escape Sequences | Yes | High | |
CPP_WARN_UNICODE_HOMOGLYPH | Unicode Homoglyph | Yes | High | |
CPP_WARN_UNICODE_WHITESPACE | Unicode Whitespace | Yes | High | |
CPP_WARN_UNICODE_ZERO_WIDTH | Unicode Zero Width | Yes | High | |
CPP_WARN_UNKNOWN_DIRECTIVES | Unknown Directives | Yes | High | |
CPP_WARN_UNKNOWN_ESCAPE_SEQUENCE | Unknown Escape Sequence | Yes | High | |
CPP_WARN_UNQUALIFIED_STD_CAST_CALL | Unqualified Standard Cast Call | Yes | High | |
CPP_WARN_UNSEQUENCED | Unsequenced Modifications | Yes | High | |
CPP_WARN_UNSUPPORTED_AVAILABILITY_GUARD | Unsupported Availability Guard | Yes | High | |
CPP_WARN_UNSUPPORTED_FRIEND | Unsupported Friend | Yes | High | |
CPP_WARN_UNUSED_COMPARISON | Unused Comparison | Yes | High | |
CPP_WARN_UNUSED_RESULT | Unused Result | Yes | High | |
CPP_WARN_UNUSED_VALUE | Unused Value | Yes | High | |
CPP_WARN_UNUSED_VOLATILE_LVALUE | Unused Volatile Lvalue | Yes | High | |
CPP_WARN_USER_DEFINED_LITERALS | User Defined Literals | Yes | High | |
CPP_WARN_VARARGS | Variadic Arguments | Yes | High | |
CPP_WARN_VEXING_PARSE | Vexing Parse Occurrences | Yes | High | |
CPP_WARN_VISIBILITY | Visibility of Declarations | Yes | High | |
CPP_WARN_VOID_POINTER_TO_ENUM_CAST | Void Pointer to Enum Cast | Yes | High | |
CPP_WARN_VOID_POINTER_TO_INT_CAST | Void Pointer to Int Cast | Yes | High | |
CPP_WARN_VOID_PTR_DEREFERENCE | Void Pointer Dereference | Yes | High | |
CPP_WARN_WRITABLE_STRINGS | Writable Strings | Yes | High | |
CPP_WARN_XOR_USED_AS_POW | Xor Used as Power | Yes | High | |
STI_FRIENDS | Unnecessary Friends | Yes | Recommended | High |
STI_SPECIAL_MEMBER_FUNCTIONS | Special Member Functions | Yes | Recommended | High |
STI_UNUSED | Unused Entities | Yes | Recommended | High |