facebook pixelC and C++ Static Code Analysis Rules
BACK TO LIST

C / C++ rules

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.

      assignBoolToFloat

      Safety
      Minor

      Boolean value assigned to floating point variable.

      moduloofone

      Safety
      Minor

      Modulo of one is always equal to zero

      pointerLessThanZero

      Safety
      Minor

      A pointer can not be negative so it is either pointless or an error to check if it is.

      redundantIfRemove

      Safety
      Minor

      Redundant checking of STL container element existence before removing it.

      returnNonBoolInBooleanFunction

      Safety
      Minor

      Non-boolean value returned from function returning bool

      truncLongCastAssignment

      Safety
      Minor

      int result is assigned to long variable. If the variable is long to avoid loss of information