How to install:
- Download .jar file
- In intellij idea go to File -> Settings
- Go to Plugins
- Click to settings icon near "Marketplace" and "Installed"
- Click "Install Plugin from disk" and choose .jar
- Restart IDE
Checking rules for now:
- Returning 'null' in method:
public Integer calc(int a, int b) {
if(a < 0 || b < 0) {
return null;
}
// calc
} must be:
public Integer calc(int a, int b) {
if(a < 0 || b < 0) {
// or throw exception
// or new YourEntity extends Number with constructor (int val)
return 0;
}
// calc
} - Method has to have only one 'return' statement!
(There might be better example)
public boolean greatherThan(int a) {
if(a > 0) {
return true;
}
return false;
}must be:
public boolean greatherThan(int a) {
final boolean result;
if(a > 0) {
result = true;
} else {
result = false;
}
return result;
}- Checking for all final class & method variables for immutability.
Also checking when for(int i = 0;) i may be replaced by objects iteration