Showing 32 of 32 total issues
Variable 'tableName' must be private and have accessor methods. Open
protected final String tableName;
- Read upRead up
- Exclude checks
Checks visibility of class members. Only static final, immutable or annotatedby specified annotation members may be public; other class members must be privateunless the property protectedAllowed
or packageAllowed
is set.
Public members are not flagged if the name matches the publicmember regular expression (contains "^serialVersionUID$"
by default).
Note thatCheckstyle 2 used to include "^f[A-Z][a-zA-Z0-9]*$"
in the defaultpattern to allow names used in container-managed persistence for Enterprise JavaBeans(EJB) 1.1 with the default settings. With EJB 2.0 it is no longer necessary to havepublic access for persistent fields, so the default has been changed.
Rationale: Enforce encapsulation.
Check also has options making it less strict:
ignoreAnnotationCanonicalNames - the list of annotations which ignore variablesin consideration. If user will provide short annotation name that type will match to anynamed the same type without consideration of package.
allowPublicFinalFields - which allows public final fields.
allowPublicImmutableFields - which allows immutable fields to be declared aspublic if defined in final class.
Field is known to be immutable if:
- It's declared as final
- Has either a primitive type or instance of class user defined to be immutable(such as String, ImmutableCollection from Guava and etc)
Classes known to be immutable are listed in immutableClassCanonicalNames by theircanonical names.
Property Rationale: Forcing all fields of class to have private modifier by default isgood in most cases, but in some cases it drawbacks in too much boilerplate get/set code.One of such cases are immutable classes.
Restriction: Check doesn't check if class is immutable, there's nochecking if accessory methods are missing and all fields are immutable, we only checkif current field is immutable or final. Under the flagallowPublicImmutableFields, the enclosing class must also be final, to encourageimmutability. Under the flag allowPublicFinalFields, the final modifier onthe enclosing class is optional.
Star imports are out of scope of this Check. So if one of type imported viastar import collides with user specified one by its short name -there won't be Check's violation.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Missing a Javadoc comment. Open
private String getIdPlayer(int id) {
- Read upRead up
- Exclude checks
Checks for missing Javadoc comments for a method or constructor.The scope to verify is specified using the Scope
class anddefaults to Scope.PUBLIC
. To verify anotherscope, set property scope to a differentscope.
Javadoc is not required on a method that is tagged with the@Override
annotation. However underJava 5 it is not possible to mark a method required for aninterface (this was corrected under Java 6). HenceCheckstyle supports using the convention of using a single{@inheritDoc}
tag instead of all theother tags.
For getters and setters for the property allowMissingPropertyJavadoc
,the methods must match exactly the structures below.
public void setNumber(final int number){mNumber = number;}public int getNumber(){return mNumber;}public boolean isSomething(){return false;}
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
NCSS for this method is 41 (max allowed is 40). Open
public void processJoin(Player player) {
- Read upRead up
- Exclude checks
Determines complexity of methods, classes and files bycounting the Non Commenting Source Statements (NCSS). Thischeck adheres to the specification for theJavaNCSS-Toolwritten by Chr. Clemens Lee.
Roughly said the NCSS metric is calculated bycounting the source lines which are not comments, (nearly)equivalent to counting the semicolons and opening curly braces.
The NCSS for a class is summarized from the NCSSof all its methods, the NCSS of its nested classes and thenumber of member variable declarations.
The NCSS for a file is summarized from the ncss of all its top level classes,the number of imports and the package declaration.
Rationale: Too large methods and classes are hard to read andcostly to maintain. A large NCSS number often means that amethod or class has too many responsibilities and/orfunctionalities which should be decomposed into smaller units.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (PASSWORD_CHANGED)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Distance between variable 'isFirstLogin' declaration and its first usage is 16, but allowed 3. Consider making that variable final if you still need to store its value in advance (before method calls that might have side effects on the original value). Open
boolean isFirstLogin = (auth.getLastLogin() == null);
- Read upRead up
- Exclude checks
Checks the distance between declaration of variable and its first usage.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (CHANGE_MAIL)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Missing a Javadoc comment. Open
private PlayerAuth buildAuthFromResultSet(ResultSet row) throws SQLException {
- Read upRead up
- Exclude checks
Checks for missing Javadoc comments for a method or constructor.The scope to verify is specified using the Scope
class anddefaults to Scope.PUBLIC
. To verify anotherscope, set property scope to a differentscope.
Javadoc is not required on a method that is tagged with the@Override
annotation. However underJava 5 it is not possible to mark a method required for aninterface (this was corrected under Java 6). HenceCheckstyle supports using the convention of using a single{@inheritDoc}
tag instead of all theother tags.
For getters and setters for the property allowMissingPropertyJavadoc
,the methods must match exactly the structures below.
public void setNumber(final int number){mNumber = number;}public int getNumber(){return mNumber;}public boolean isSomething(){return false;}
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (QUITLOC)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
//TODO ljacqu 20160717: We shouldn't output namedBanned.size() but the actual total that was deleted
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Missing a Javadoc comment. Open
private int verifyCode(byte[] key, long t) throws NoSuchAlgorithmException, InvalidKeyException {
- Read upRead up
- Exclude checks
Checks for missing Javadoc comments for a method or constructor.The scope to verify is specified using the Scope
class anddefaults to Scope.PUBLIC
. To verify anotherscope, set property scope to a differentscope.
Javadoc is not required on a method that is tagged with the@Override
annotation. However underJava 5 it is not possible to mark a method required for aninterface (this was corrected under Java 6). HenceCheckstyle supports using the convention of using a single{@inheritDoc}
tag instead of all theother tags.
For getters and setters for the property allowMissingPropertyJavadoc
,the methods must match exactly the structures below.
public void setNumber(final int number){mNumber = number;}public int getNumber(){return mNumber;}public boolean isSomething(){return false;}
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (ADD_MAIL)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Missing a Javadoc comment. Open
private void updateSpecificsOnSave(int id, String name, Connection con) throws SQLException {
- Read upRead up
- Exclude checks
Checks for missing Javadoc comments for a method or constructor.The scope to verify is specified using the Scope
class anddefaults to Scope.PUBLIC
. To verify anotherscope, set property scope to a differentscope.
Javadoc is not required on a method that is tagged with the@Override
annotation. However underJava 5 it is not possible to mark a method required for aninterface (this was corrected under Java 6). HenceCheckstyle supports using the convention of using a single{@inheritDoc}
tag instead of all theother tags.
For getters and setters for the property allowMissingPropertyJavadoc
,the methods must match exactly the structures below.
public void setNumber(final int number){mNumber = number;}public int getNumber(){return mNumber;}public boolean isSomething(){return false;}
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: unused
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
//TODO ljacqu 20151229: Restructure this into smaller portions
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Missing a Javadoc comment. Open
private List<Integer> getXAuthPlayers() {
- Read upRead up
- Exclude checks
Checks for missing Javadoc comments for a method or constructor.The scope to verify is specified using the Scope
class anddefaults to Scope.PUBLIC
. To verify anotherscope, set property scope to a differentscope.
Javadoc is not required on a method that is tagged with the@Override
annotation. However underJava 5 it is not possible to mark a method required for aninterface (this was corrected under Java 6). HenceCheckstyle supports using the convention of using a single{@inheritDoc}
tag instead of all theother tags.
For getters and setters for the property allowMissingPropertyJavadoc
,the methods must match exactly the structures below.
public void setNumber(final int number){mNumber = number;}public int getNumber(){return mNumber;}public boolean isSomething(){return false;}
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (QUITLOC)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (QUITLOC)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (QUITLOC)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
NCSS for this method is 46 (max allowed is 40). Open
private void checkTablesAndColumns() throws SQLException {
- Read upRead up
- Exclude checks
Determines complexity of methods, classes and files bycounting the Non Commenting Source Statements (NCSS). Thischeck adheres to the specification for theJavaNCSS-Toolwritten by Chr. Clemens Lee.
Roughly said the NCSS metric is calculated bycounting the source lines which are not comments, (nearly)equivalent to counting the semicolons and opening curly braces.
The NCSS for a class is summarized from the NCSSof all its methods, the NCSS of its nested classes and thenumber of member variable declarations.
The NCSS for a file is summarized from the ncss of all its top level classes,the number of imports and the package declaration.
Rationale: Too large methods and classes are hard to read andcostly to maintain. A large NCSS number often means that amethod or class has too many responsibilities and/orfunctionalities which should be decomposed into smaller units.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Comment matches to-do format 'TODO(?! #\d+:)|FIXME'. Open
// TODO: send an update when a messaging service will be implemented (UNREGISTER)
- Read upRead up
- Exclude checks
Checks for TODO:
comments. Actuallyit is a genericregularexpression matcher on Java comments. To check for otherpatterns in Java comments, set the format
property.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.