Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2022.2

...

The presence of code that has no effect can indicate logic errors that may result in unexpected behavior and vulnerabilities. Unused values in code may indicate significant logic errors.

Unused classes, methods, and variables that are part of an exported library do not violate this guideline. 

Code and values that have no effect can be detected by suitable static analysis.

Automated Detection

ToolVersionCheckerDescription
SonarQube Java Plugin
Parasoft Jtest
Include Page
Parasoft_V
Parasoft_V
CERT.MSC56.CC
CERT.MSC56.SWITCH
CERT.MSC56.VOVR
Avoid conditions that always evaluate to the same value
Avoid switch with unreachable branches
Avoid unused values
PVS-Studio

Include Page
PVS-Studio_V
PVS-Studio_V

V6005V6021V6022V6026V6039
SonarQube
Include Page
SonarQube
Java Plugin
_V
SonarQube
Java Plugin
_V
S1854
 

 



Bibliography

[Coverity 2007]Coverity Prevent User's Manual (3.3.0)
[Fortify 2013]Code Quality, "Dead Code"

...

...