Access of forwarded variable
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 of forwarded variable
Access of moved variable.
Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead.
Array access out of bounds with a conditions
Obsolete function 'asctime_s' called. It is recommended to use 'strftime' instead.
Assert statement calls a function which may have desired side effects: 'IsAddressInSegment'.
Assert statement modifies variable
Bad usage of bitmap operator
Char literal compared with pointer.
Storing getchar() return value in char variable and then comparing with EOF.
Misuse of ++ operator
Comparison of a boolean expression with an integer other than 0 or 1.
Comparison of a boolean value using relational operator (e.g. < ,>, etc)
Detect unused variables
Access container out of bounds
Value of pointer 'count'
Condition is redundant or value is derefenced
Duplicated inherited member
Catching exception in destructor
Function not called with the right arguments
Obsolute function gets() called
Identical condition and return expression
Identical inner 'return' condition is always true.
Return value not used
Conversion of char literal to bool always evaluates to true.
Logical conjunction always evaluates to false
Incorrect string boolean operator
Integer overflow with condition
Format string conversion error
Invalid formatter for float
Invalid formatter for int
Invalid formatter for signed int
Invalid formatter for string
Invalid formatter for signed long long
Invalid formatter for unsigned int
Invalid scanf for float
Invalid scanf for int
Invalid scanf for string
Invalid test for overflow
Direct string comparison. Compare with strcmp() instead
The lock is ineffective because the mutex is locked at the same scope as the mutex itself.
Invalid memset assignment
memset() called to fill 0 bytes.
Iterators to containers from different expressions
Negative container index
Negative index access
Class does not have a copy constructor which is recommended since it has dynamic memory/resource allocation(s).
Class does not have a operator= which is recommended since it has dynamic memory/resource allocation(s).
Either the condition is redundant or there is overflow in pointer subtraction.
Either the condition is redundant or there is possible null pointer dereference
The address of local variable might be accessed at non-zero index.
operator=' should check for assignment to self to avoid problems with dynamic memory.
Member variable is not assigned a value
Opposite inner 'return' condition leads to a dead code block.
Size of pointer used instead of size of its data.
Possible leak in public function.
Variable is reassigned a value before the old one has been used
Repositioning operation performed on a file opened in append mode has no effect.
Redundant assignment of variable to itself.
Expression can have a negative value. That is converted to an unsigned value and used in an unsigned calculation.
Conversion between unsigned and signed values
Calculation inside sizeof().
Division by result of sizeof(). memset() expects a size in bytes
Found function call inside sizeof().
Suspicious usage of 'sizeof' with a numeric constant as parameter.
Using 'sizeof' on array given as function argument returns size of a pointer.
Unnecessary comparison of static strings.
Suspicious condition. The result of find() is an iterator
Missing bounds check for extra iterator increment in loop.
Suspicious pointer subtraction.
Member variable not initialized in the constructor.
Member private variable is not initialized in the constructor.
Label is not used.
Unused label in switch
Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
Ineffective call of function 'empty()'. Call 'clear()' instead.
Return value ignored. Elements remain in container.
Dynamic binding is not used.
printf: invalid parameter position
Either the condition is redundant or there is division by zero
Undefined behaviour, when 'len' is 4 the pointer arithmetic 'cmd+len' is out of bounds
The one definition rule is violated, different classes/structs have the same name.
Member variable not initialized in constructor
Using std::move for returning object by-value from function will affect copy elision optimization
Overlapping read/write of union is undefined behavior
Buffer is too small
Iterators of different containers are used together.
operator should either return reference to 'this' instance or be declared private and left unimplemented.
Wrong parameter for va_start()