Intel® Inspector Help

Weight Levels

Attention

Static analysis functionality was deprecated in the Intel Inspector 2015 and was removed in the Intel Inspector 2016 and higher.

Weight level is a finer grained kind of severity for static analysis problems. A number between 1 and 100, it combines into a single value the severity level and the probability the problem indicates a true error. Higher numbers indicate greater chance of greater impact. For example:

Static Analysis Problem Type

Weight Level

Unused var value

8

Unreachable statement

10

Array arg shape mismatch

25

Arg type mismatch

65

Uninitialized variable

100

Weight values provide a useful ordering among problems, but the actual weight value is not significant. A problem of weight 80 is not necessarily twice as serious as a problem of weight 40. A problem of weight 80 is more likely to indicate a significant problem than a problem of weight 40, but both must be investigated to determine the actual impact.

Unconditional problems have greater weight than conditional or possible problems. This reflects the fact that unconditional problems are more likely to indicate programmer errors than conditional problems; however, this does not mean the impact of a conditional problem is any less. Consider the following example:

int f1(int value) {
   int divisor = 0;
   if (value >= 0) {
      return (value / divisor);
   }
   return value;
}

int f2(int value) {
   int divisor;
   if (value >= 0) divisor = 0;
   else divisor = 1;
   return (value / divisor);
}

Here the divide expression in f1 would be flagged as an unconditional divide by zero error because it would, if executed, always divide by zero. The divide statement in f2 would be flagged as a possible divide by zero error because the division statement might divide by zero depending on the path executed to reach that statement.

In this case the impact is exactly the same: the application will fail if a non-negative value is passed into either of these functions.

See Also