clueless-skywatcher / lentil Goto Github PK
View Code? Open in Web Editor NEWLentil - A simple static code analyzer for Java, in Java
Lentil - A simple static code analyzer for Java, in Java
This checker will check for every instance where underscores are being used. This will check
Constants, i.e. final static fields of a class, and enum fields will be ignored here.
int abc_def = 5; // Violation
int abcDef = 5; // OK
class XYZ_Name // Violation
class XYZName // OK
final static int ABC_DEF = 5 // OK
enum AbcDef { FIELD_1, // OK FIELD_2 // OK }
Category: Bad Practice (BP)
Issue Code: BP0001
Description: Checks whether methods in the code that return booleans are returning null instead.
Examples:
public class BooleanReturnNullExample {
public boolean abcd(){
System.out.println("Not okay");
if (1 == 1){
return true;
} else {
return null;
}
}
public Boolean abcd2(){
System.out.println("Not okay");
if (1 == 2){
return true;
} else {
return null;
}
}
public boolean defg(){
System.out.println("Okay");
return true;
}
}
This code will cause issues to be raised at lines 7 and 16.
Check code: A0001
Check description:
Whenever a variable, class or method is declared with an annotation, check whether the annotations not on the same line as their targets.
Example:
import javax.annotation.Nullable;
@SuppressWarnings(value = "abcd") // OK
public class AnnotationExample {
@Deprecated public void abcd(){ // Violation
@Nullable // OK
String anno;
@Nullable int abc; // Violation
}
@Deprecated // OK
public void abcd2(@Nullable String xyz){ // Still ok since it is a param annotation
}
}
@SuppressWarnings(value = "abcd") class ABCD {
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.