facebook pixelCodiga Analysis Java Rules, category design
BACK TO LIST

Java rules

The Codiga Code Analysis engine supports hundreds of rules for Java, checking that your code is safe and secure. Start using Codiga today to check your code and automate your code reviews to find issues in every pull request and merge with confidence.

AbstractClassWithoutAnyMethod

Design
Critical

No abstract method which means that the keyword is most likely used to prevent instantiation. Use a private or protected constructor instead.

Learn more

AvoidDeeplyNestedIfStmts

Design
Warning

Deeply nested if..then statements are hard to read

ClassWithOnlyPrivateConstructorsShouldBeFinal

Design
Critical

A class which only has private constructors should be final

CollapsibleIfStatements

Design
Warning

These nested if statements could be combined

FinalFieldCouldBeStatic

Design
Warning

This final field could be made static

ImmutableField

Design
Warning

Private field could be made final; it is only initialized in the declaration or constructor.

LogicInversion

Design
Warning

Use opposite operator instead of the logic complement operator.

SimplifiedTernary

Design
Warning

Ternary operators that can be simplified with || or &&

SimplifyBooleanExpressions

Design
Warning

Avoid unnecessary comparisons in boolean expressions

SimplifyBooleanReturns

Design
Warning

Avoid unnecessary if..then..else statements when returning booleans

SimplifyConditional

Design
Warning

No need to check for null before an instanceof

SwitchDensity

Design
Warning

A high ratio of statements to labels in a switch statement. Consider refactoring.