Methods (MET)
Rules
- MET00-J. Validate method arguments
- MET01-J. Never use assertions to validate method arguments
- MET02-J. Do not use deprecated or obsolete classes or methods
- MET03-J. Methods that perform a security check must be declared private or final
- MET04-J. Do not increase the accessibility of overridden or hidden methods
- MET05-J. Ensure that constructors do not call overridable methods
- MET06-J. Do not invoke overridable methods in clone()
- MET07-J. Never declare a class method that hides a method declared in a superclass or superinterface
- MET08-J. Preserve the equality contract when overriding the equals() method
- MET09-J. Classes that define an equals() method must also define a hashCode() method
- MET10-J. Follow the general contract when implementing the compareTo() method
- MET11-J. Ensure that keys used in comparison operations are immutable
- MET12-J. Do not use finalizers
- MET13-J. Do not assume that reassigning method arguments modifies the calling environment
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| MET00-J | High | Likely | No | No | P9 | L2 |
| MET01-J | Medium | Probable | No | Yes | P8 | L2 |
| MET02-J | Low | Unlikely | Yes | No | P2 | L3 |
| MET03-J | Medium | Probable | No | No | P4 | L3 |
| MET04-J | Medium | Probable | Yes | No | P8 | L2 |
| MET05-J | Medium | Probable | Yes | No | P8 | L2 |
| MET06-J | Medium | Probable | Yes | No | P8 | L2 |
| MET07-J | Low | Unlikely | Yes | No | P2 | L3 |
| MET08-J | Low | Unlikely | No | No | P1 | L3 |
| MET09-J | Low | Unlikely | Yes | No | P2 | L3 |
| MET10-J | Medium | Unlikely | No | No | P2 | L3 |
| MET11-J | Low | Probable | Yes | No | P4 | L3 |
| MET12-J | Medium | Probable | Yes | No | P8 | L2 |
| MET13-J | Medium | Likely | No | No | P6 | L2 |


