Nested “enum”s should not be declared static squid
Noncompliant Code Example
public class Flower {
static enum Color { // Noncompliant; static is redundant here
RED, YELLOW, BLUE, ORANGE
}
// ...
}
Compliant Solution
public class Flower {
enum Color { // Compliant
RED, YELLOW, BLUE, ORANGE
}
// ...
}
@FunctionalInterface annotation should be used to flag Single Abstract Method interfaces
Noncompliant Code Example
public interface Changeable<T> {
public void change(T o);
}
Compliant Solution
@FunctionalInterface
public interface Changeable<T> {
public void change(T o);
}
Modifiers should be declared in the correct order
The Java Language Specification recommends listing modifiers in the following order:
Annotations
public
protected
private
abstract
static
final
transient
volatile
synchronized
native
strictfp
Not following this convention has no technical impact, but will reduce the code’s readability because most developers are used to the standard order.
Noncompliant Code Example
static public void main(String[] args) { // Noncompliant
}
Compliant Solution
public static void main(String[] args) { // Compliant
}
Functions should not be too complex
maximumFunctionComplexityThreshold
The maximum authorize