JD.UN.PMET

JD.UN.PMET occurs if no call for method is found in the analyzed context. This checker is triggered only by private methods.

Vulnerability and risk

Unused methods can be used as back doors. They also increase code footprint in memory. Additionally, they increase the size of source code which decreases maintainability.

Mitigation and prevention

Remove unused private methods.

Example 1

Copy
      static class MyClass {
         private void foo(){
             System.err.println("Hello, World!");
         }
     }

JD.UN.PMET is reported for method declaration on line 10: Private method 'foo' is unused.

Related checkers