[7]
Possible Bugs (BD-PB)
|
[1]
Avoid use before initialization (BD-PB-NOTINIT-1)
|
[6]
Avoid null pointer dereferencing (BD-PB-NP-1)
|
[1]
Code Duplication Detection (CDD)
|
[1]
Avoid function duplication (CDD-DUPM-2)
|
[3]
CERT-MSC13_C (REC) Detect and remove unused values (CERT_C-MSC13)
|
[3]
Avoid unnecessary local variables (CERT_C-MSC13-a-3)
|
[4]
CERT-FLP02_C (REC) Avoid using floating-point numbers when precise computation is needed (CERT_C-FLP02)
|
[4]
Floating-point expressions shall not be tested for equality or inequality (CERT_C-FLP02-a-3)
|
[6]
CERT-MSC19_C (REC) For functions that return an array, prefer returning an empty array over a null value (CERT_C-MSC19)
|
[6]
Avoid null pointer dereferencing (CERT_C-MSC19-b-3)
|
[1]
CERT-FLP06_C (REC) Convert integers to floating point for floating-point operations (CERT_C-FLP06)
|
[1]
Implicit conversions from integral to floating type which may result in a loss of information shall not be used (CERT_C-FLP06-a-2)
|
[8]
CERT-INT02_C (REC) Understand integer conversion rules (CERT_C-INT02)
|
[6]
Implicit conversions from wider to narrower integral type which may result in a loss of information shall not be used (CERT_C-INT02-a-2)
|
[2]
Avoid mixing arithmetic of different precisions in the same expression (CERT_C-INT02-b-2)
|
[4]
CERT-FLP00_C (REC) Understand the limitations of floating-point numbers (CERT_C-FLP00)
|
[4]
Floating-point expressions shall not be tested for equality or inequality (CERT_C-FLP00-a-3)
|
[2]
CERT-INT07_C (REC) Use only explicitly signed or unsigned char type for numeric values (CERT_C-INT07)
|
[2]
The plain char type shall be used only for the storage and use of character values (CERT_C-INT07-a-2)
|
[35]
CERT-MEM04_C (REC) Beware of zero-length allocations (CERT_C-MEM04)
|
[35]
The validity of values passed to library functions shall be checked (CERT_C-MEM04-a-2)
|
[7]
CERT-MEM05_C (REC) Avoid large stack allocations (CERT_C-MEM05)
|
[7]
Do not use recursion (CERT_C-MEM05-a-2)
|
[4]
CERT-MEM02_C (REC) Immediately cast the result of a memory allocation function call into a pointer to the allocated type (CERT_C-MEM02)
|
[3]
Assignment operator should have operands of compatible types (CERT_C-MEM02-a-3)
|
[1]
Do not assign function return value to a variable of incompatible type (CERT_C-MEM02-b-3)
|
[117]
CERT-PRE31_C (RULE) Avoid side effects in arguments to unsafe macros (CERT_C-PRE31)
|
[117]
Assertions should not contain function calls nor function-like macro calls (CERT_C-PRE31-c-3)
|
[19]
CERT-MSC01_C (REC) Strive for logical completeness (CERT_C-MSC01)
|
[19]
All 'if...else-if' constructs shall be terminated with an 'else' clause (CERT_C-MSC01-a-2)
|
[16]
CERT-MSC09_C (REC) Character encoding: Use subset of ASCII for safety (CERT_C-MSC09)
|
[16]
Only use characters defined in ISO C standard (CERT_C-MSC09-a-3)
|
[10]
CERT-INT36_C (RULE) Converting a pointer to integer or integer to pointer (CERT_C-INT36)
|
[10]
A conversion should not be performed between a pointer to object type and an integer type other than 'uintptr_t' or 'intptr_t' (CERT_C-INT36-b-3)
|
[8]
CERT-EXP46_C (RULE) Do not use a bitwise operator with a Boolean-like operand (CERT_C-EXP46)
|
[8]
Expressions that are effectively Boolean should not be used as operands to operators other than (&&, ||, !, =, ==, !=, ?:) (CERT_C-EXP46-b-2)
|
[19]
CERT-FIO41_C (RULE) Do not call getc(), putc(), getwc(), or putwc() with a stream argument that has side effects (CERT_C-FIO41)
|
[19]
A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects (CERT_C-FIO41-e-3)
|
[35]
CERT-MEM07_C (REC) Ensure that the arguments to calloc(), when multiplied, do not wrap (CERT_C-MEM07)
|
[35]
The validity of values passed to library functions shall be checked (CERT_C-MEM07-a-2)
|
[311]
CERT-MSC41_C (RULE) Never hard code sensitive information (CERT_C-MSC41)
|
[311]
Do not hard code string literals (CERT_C-MSC41-a-1)
|
[1000]
CERT-API00_C (REC) Functions should validate their parameters (CERT_C-API00)
|
[1000]
The validity of parameters must be checked inside each function (CERT_C-API00-a-3)
|
[20]
CERT-EXP40_C (RULE) Do not modify constant objects (CERT_C-EXP40)
|
[20]
A cast shall not remove any 'const' or 'volatile' qualification from the type of a pointer or reference (CERT_C-EXP40-a-3)
|
[1]
CERT-EXP33_C (RULE) Do not read uninitialized memory (CERT_C-EXP33)
|
[1]
Avoid use before initialization (CERT_C-EXP33-a-1)
|
[6]
CERT-EXP34_C (RULE) Do not dereference null pointers (CERT_C-EXP34)
|
[6]
Avoid null pointer dereferencing (CERT_C-EXP34-a-1)
|
[20]
CERT-EXP32_C (RULE) Do not access a volatile object through a nonvolatile reference (CERT_C-EXP32)
|
[20]
A cast shall not remove any 'const' or 'volatile' qualification from the type of a pointer or reference (CERT_C-EXP32-a-2)
|
[13]
CERT-EXP37_C (RULE) Call functions with the correct number and type of arguments (CERT_C-EXP37)
|
[13]
Identifiers shall be given for all of the parameters in a function prototype declaration (CERT_C-EXP37-a-3)
|
[16]
CERT-EXP36_C (RULE) Do not cast pointers into more strictly aligned pointer types (CERT_C-EXP36)
|
[16]
A cast should not be performed between a pointer to object type and a different pointer to object type (CERT_C-EXP36-a-3)
|
[66]
CERT-EXP39_C (RULE) Do not access a variable through a pointer of an incompatible type (CERT_C-EXP39)
|
[50]
There shall be no implicit conversions from integral to floating type (CERT_C-EXP39-a-3)
|
[16]
A cast should not be performed between a pointer to object type and a different pointer to object type (CERT_C-EXP39-b-3)
|
[3]
CERT-DCL22_C (REC) Use volatile for data that cannot be cached (CERT_C-DCL22)
|
[3]
Avoid unused values (CERT_C-DCL22-a-3)
|
[119]
CERT-EXP00_C (REC) Use parentheses for precedence of operation (CERT_C-EXP00)
|
[119]
Use parenthesis to clarify expression order if operators with precedence lower than arithmetic are used (CERT_C-EXP00-a-3)
|
[20]
CERT-EXP05_C (REC) Do not cast away a const qualification (CERT_C-EXP05)
|
[20]
A cast shall not remove any 'const' or 'volatile' qualification from the type of a pointer or reference (CERT_C-EXP05-a-2)
|
[7]
CERT-EXP02_C (REC) Be aware of the short-circuit behavior of the logical AND and OR operators (CERT_C-EXP02)
|
[7]
The right-hand operand of a logical && or || operator shall not contain side effects (CERT_C-EXP02-a-3)
|
[12]
CERT-DCL19_C (REC) Minimize the scope of variables and functions (CERT_C-DCL19)
|
[12]
Declare variables as locally as possible (CERT_C-DCL19-a-3)
|
[33]
CERT-DCL15_C (REC) Declare file-scope objects or functions that do not need external linkage as static (CERT_C-DCL15)
|
[33]
Objects or functions with external linkage shall be declared in a header file (CERT_C-DCL15-a-3)
|
[257]
CERT-EXP12_C (REC) Do not ignore values returned by functions (CERT_C-EXP12)
|
[257]
The value returned by a function having non-void return type shall be used (CERT_C-EXP12-a-3)
|
[1]
CERT-EXP15_C (REC) Do not place a semicolon on the same line as an if, for, or while statement (CERT_C-EXP15)
|
[1]
Suspicious use of semicolon (CERT_C-EXP15-a-3)
|
[2]
CERT-EXP14_C (REC) Beware of integer promotion when performing bitwise operations on integer types smaller than int (CERT_C-EXP14)
|
[2]
Avoid mixing arithmetic of different precisions in the same expression (CERT_C-EXP14-a-3)
|
[85]
CERT-EXP19_C (REC) Use braces for the body of an if, for, or while statement (CERT_C-EXP19)
|
[85]
The statement forming the body of a 'switch', 'while', 'do...while' or 'for' statement shall be a compound statement (CERT_C-EXP19-a-2)
|
[2]
CERT-STR00_C (REC) Represent characters using an appropriate type (CERT_C-STR00)
|
[2]
The plain char type shall be used only for the storage and use of character values (CERT_C-STR00-a-1)
|
[4]
CERT-STR09_C (REC) Don't assume numeric values for expressions with type plain character (CERT_C-STR09)
|
[4]
Expressions with type (plain) char and wchar_t shall not be used as operands to built-in operators other than =, ==, !=
and the unary & operator (CERT_C-STR09-a-3)
|
[2]
CERT-STR04_C (REC) Use plain char for characters in the basic character set (CERT_C-STR04)
|
[2]
The plain char type shall be used only for the storage and use of character values (CERT_C-STR04-a-3)
|
[1]
CERT-PRE00_C (REC) Prefer inline or static functions to function-like macros (CERT_C-PRE00)
|
[1]
A function should be used in preference to a function-like macro (CERT_C-PRE00-a-3)
|
[263]
CERT-POS54_C (RULE) Detect and handle POSIX library errors (CERT_C-POS54)
|
[257]
The value returned by a function having non-void return type shall be used (CERT_C-POS54-a-1)
|
[6]
Avoid null pointer dereferencing (CERT_C-POS54-c-1)
|
[24]
CERT-ERR30_C (RULE) Set errno to zero before calling a library function known to set errno, and check errno only after the
function returns a value indicating failure (CERT_C-ERR30)
|
[24]
Properly use errno value (CERT_C-ERR30-a-2)
|
[24]
CERT-ERR32_C (RULE) Do not rely on indeterminate values of errno (CERT_C-ERR32)
|
[24]
Properly use errno value (CERT_C-ERR32-a-3)
|
[263]
CERT-ERR33_C (RULE) Detect and handle standard library errors (CERT_C-ERR33)
|
[257]
The value returned by a function having non-void return type shall be used (CERT_C-ERR33-a-1)
|
[6]
Avoid null pointer dereferencing (CERT_C-ERR33-c-1)
|
[129]
CERT-ERR06_C (REC) Understand the termination behavior of assert() and abort() (CERT_C-ERR06)
|
[129]
Do not use assertions (CERT_C-ERR06-a-3)
|
[3]
CERT-DCL01_C (REC) Do not reuse variable names in subscopes (CERT_C-DCL01)
|
[3]
Identifiers declared in an inner local scope should not hide identifiers declared in an outer local scope (CERT_C-DCL01-b-3)
|
[347]
CERT-DCL00_C (REC) Const-qualify immutable objects (CERT_C-DCL00)
|
[347]
Declare parameters or local variable as const whenever possible (CERT_C-DCL00-a-3)
|
[1]
CERT-FLP36_C (RULE) Preserve precision when converting integral values to floating-point type (CERT_C-FLP36)
|
[1]
Implicit conversions from integral to floating type which may result in a loss of information shall not be used (CERT_C-FLP36-a-3)
|
[1]
CERT-FLP32_C (RULE) Prevent or detect domain and range errors in math functions (CERT_C-FLP32)
|
[1]
Validate values passed to library functions (CERT_C-FLP32-a-2)
|
[21]
CERT-ERR50_CPP (RULE) Do not abruptly terminate the program (CERT_CPP-ERR50)
|
[18]
Never allow an exception to be thrown from a destructor, deallocation, and swap (CERT_CPP-ERR50-b-3)
|
[3]
Exceptions shall be raised only after start-up and before termination of the program (CERT_CPP-ERR50-f-3)
|
[3]
CERT-DCL59_CPP (RULE) Do not define an unnamed namespace in a header file (CERT_CPP-DCL59)
|
[3]
There shall be no unnamed namespaces in header files (CERT_CPP-DCL59-a-3)
|
[6]
CERT-MEM51_CPP (RULE) Properly deallocate dynamically allocated resources (CERT_CPP-MEM51)
|
[6]
Both copy constructor and copy assignment operator should be declared for classes with a nontrivial destructor (CERT_CPP-MEM51-c-1)
|
[18]
CERT-DCL57_CPP (RULE) Do not let exceptions escape from destructors or deallocation functions (CERT_CPP-DCL57)
|
[18]
Never allow an exception to be thrown from a destructor, deallocation, and swap (CERT_CPP-DCL57-a-2)
|
[3]
CERT-ERR58_CPP (RULE) Handle all exceptions thrown before main() begins executing (CERT_CPP-ERR58)
|
[3]
Exceptions shall be raised only after start-up and before termination of the program (CERT_CPP-ERR58-a-2)
|
[26]
CERT-STR53_CPP (RULE) Range check element access (CERT_CPP-STR53)
|
[26]
Guarantee that container indices are within the valid range (CERT_CPP-STR53-a-2)
|
[80]
CERT-DCL51_CPP (RULE) Do not declare or define a reserved identifier (CERT_CPP-DCL51)
|
[10]
The names of standard library macros, objects and functions shall not be reused (CERT_CPP-DCL51-d-3)
|
[35]
The names of standard library macros, objects and functions shall not be reused (C90) (CERT_CPP-DCL51-e-3)
|
[35]
The names of standard library macros, objects and functions shall not be reused (C99) (CERT_CPP-DCL51-f-3)
|
[6]
CERT-STR51_CPP (RULE) Do not attempt to create a std::string from a null pointer (CERT_CPP-STR51)
|
[6]
Avoid null pointer dereferencing (CERT_CPP-STR51-a-1)
|
[1]
CERT-OOP52_CPP (RULE) Do not delete a polymorphic object without a virtual destructor (CERT_CPP-OOP52)
|
[1]
Define a virtual destructor in classes used as base classes which have virtual functions (CERT_CPP-OOP52-a-2)
|
[18]
CERT-OOP51_CPP (RULE) Do not slice derived objects (CERT_CPP-OOP51)
|
[18]
Avoid slicing function arguments / return value (CERT_CPP-OOP51-a-3)
|
[6]
CERT-OOP54_CPP (RULE) Gracefully handle self-copy assignment (CERT_CPP-OOP54)
|
[6]
Check for assignment to self in operator= (CERT_CPP-OOP54-a-3)
|
[2]
CERT-DCL60_CPP (RULE) Obey the one-definition rule (CERT_CPP-DCL60)
|
[2]
A class, union or enum name (including qualification, if any) shall be a unique identifier (CERT_CPP-DCL60-a-3)
|
[20]
CERT-EXP55_CPP (RULE) Do not access a cv-qualified object through a cv-unqualified type (CERT_CPP-EXP55)
|
[20]
A cast shall not remove any 'const' or 'volatile' qualification from the type of a pointer or reference (CERT_CPP-EXP55-a-2)
|
[1]
CERT-EXP53_CPP (RULE) Do not read uninitialized memory (CERT_CPP-EXP53)
|
[1]
Avoid use before initialization (CERT_CPP-EXP53-a-1)
|
[5]
CERT-EXP60_CPP (RULE) Do not pass a nonstandard-layout type object across execution boundaries (CERT_CPP-EXP60)
|
[5]
Do not pass a nonstandard-layout type object across execution boundaries (CERT_CPP-EXP60-a-1)
|
[1]
CERT-ERR60_CPP (RULE) Exception objects must be nothrow copy constructible (CERT_CPP-ERR60)
|
[1]
Exception objects must be nothrow copy constructible (CERT_CPP-ERR60-a-3)
|
[26]
CERT-CTR50_CPP (RULE) Guarantee that container indices and iterators are within the valid range (CERT_CPP-CTR50)
|
[26]
Guarantee that container indices are within the valid range (CERT_CPP-CTR50-a-2)
|
[11]
CERT-INT50_CPP (RULE) Do not cast to an out-of-range enumeration value (CERT_CPP-INT50)
|
[11]
An expression with enum underlying type shall only have values corresponding to the enumerators of the enumeration (CERT_CPP-INT50-a-3)
|
[10]
Coding Conventions (CODSTA)
|
[10]
Local variables should not use the same names as member variables (CODSTA-44-1)
|
[40]
Coding Conventions for C++ (CODSTA-CPP)
|
[40]
Constructors allowing for conversion should be made explicit (CODSTA-CPP-04-1)
|
[28]
Initialization (INIT)
|
[28]
All member variables should be initialized in constructor (INIT-06-1)
|
[3]
Metric (METRIC)
|
[1]
McCabe Cyclomatic Complexity (METRIC.CC-3)
|
[2]
Nested Blocks Depth (METRIC.NBD-3)
|
[4]
MISRA C 2004 (MISRA2004)
|
[4]
Floating-point expressions shall not be tested for equality or inequality (MISRA2004-13_3-3)
|
[5]
Object Oriented (OOP)
|
[5]
If a class has virtual functions it shall have a virtual destructor (OOP-23-2)
|
[602]
Optimization (OPT)
|
[602]
Pass objects by reference instead of by value (OPT-14-3)
|