arrayIndexThenCheck
Access array beyond boundaries
C and C++ are really performant languages and can be very error-prone. We all had core dumps and made pointer arithmetic errors! Thankfully, Codiga has hundreds of static analysis rules to flag potential errors in your C/C++ code, automate code reviews and merge with confidence.
Access array beyond boundaries
Obsolete function 'std::asctime' called. It is recommended to use 'strftime' instead.
Boolean value assigned to floating point variable.
Mismatching assignment and comparison
Exception should be caught by reference.
Clarify calculation precedence for '+' and '?'.
Suspicious condition (bitwise operator + comparison)
Code not handled
Detect conditions that are always true
Skipping configuration 'RLIMIT\_AS;RLIMIT\_CPU;RLIMIT\_DATA;RLIMIT\_NPROC;RLIMIT\_VMEM' since the value of 'RLIMIT\_NPROC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
Argument 'false&&static\_cast<bool>(!!(desc.version()==100))' to function isTrue is always 0
Parameter can be declared with const
Parameter can be declared with const.
Detect variables that could be const
C-style pointer casting
Duplicate assign expression
Consecutive return
Detect duplicate conditions
Duplicate conditions
Duplicate expressions
Duplicate Ternary operator
Duplicate ternary value
Rethrowing exception in an exception
Virtual function is a public in a base class and became not-public in derived. It's violate a substitutability a principle in OOP.
Argument value is always known, could use a const
Condition value is always known
Container is always empty
Iterating over a container that is always empty.
Function overrides a function in a base class but is not marked with a 'override' specifier.
Modulo of one is always equal to zero
Expression is always false because 'else if' condition matches previous condition
Using NaN/Inf in a computation.
Class does not have a constructor although it has private member variables.
Class has a constructor with 1 argument that is not explicit.
Invalid equal operator
operator=' should return reference to 'this' instance.
Opposite expression on both sides of expression
A pointer can not be negative so it is either pointless or an error to check if it is.
A pointer can not be negative so it is either pointless or an error to check if it is not.
Variable is reassigned a value before the old one has been used.
Redundant condition
Redundant checking of STL container element existence before removing it.
Redundant initialization. The initialized value is overwritten before it is read.
Redundant pointer operation on 'CB' - it's already a pointer.
Non-boolean value returned from function returning bool
Same iterators expression are used for algorithm.
Local variable shadows outer argument
Local variable shadows outer function
Local variable shadows outer variable
Local variable shadows outer variable
Template recursion threshold reached
int result is assigned to long variable. If the variable is long to avoid loss of information
int result is returned as long value. If the return value is long to avoid loss of information
Detect variables that are not assigned (e.g. dead code)
Expression can be replaced to avoid loss of precision.
Statements following return ; dead code
Class is unsafe
Public interface is not safe.
Checking if unsigned expression is less than zero.
Unsigned expression can't be negative so it is unnecessary to test it.
Variable is allocated memory that is never used.
Label is not used.
Label is not used, a pre-processor configuration prevents it to be shown.
Unused private function
Instance of object is destroyed immediately.
struct member is never used.
Unused variable
Assignment of function parameter has no effect outside the function.
Consider using std::generate algorithm instead of a raw loop.
Uninitialized variable
Non-standard character literal
We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.