damianwajser/spring-rest-commons-options

View on GitHub
src/main/java/com/github/damianwajser/model/validators/Validator.java

Summary

Maintainability
A
0 mins
Test Coverage

Change the visibility of this constructor to "protected".
Open

    public Validator(Annotation annotation) {

Abstract classes should not have public constructors. Constructors of abstract classes can only be called in constructors of their subclasses. So there is no point in making them public. The protected modifier should be enough.

Noncompliant Code Example

public abstract class AbstractClass1 {
    public AbstractClass1 () { // Noncompliant, has public modifier
        // do something here
    }
}

Compliant Solution

public abstract class AbstractClass2 {
    protected AbstractClass2 () {
        // do something here
    }
}

Line is longer than 100 characters (found 106).
Open

        return Optional.ofNullable((String) AnnotationUtils.getValue(this.annotation, "message"));

Checks for long lines.

Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Extra separation in import group before 'com.fasterxml.jackson.annotation.JsonGetter'
Open

import com.fasterxml.jackson.annotation.JsonGetter;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Wrong lexicographical order for 'com.fasterxml.jackson.annotation.JsonIgnore' import. Should be before 'org.springframework.core.annotation.AnnotationUtils'.
Open

import com.fasterxml.jackson.annotation.JsonIgnore;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Extra separation in import group before 'org.apache.commons.lang3.builder.ToStringBuilder'
Open

import org.apache.commons.lang3.builder.ToStringBuilder;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Wrong lexicographical order for 'com.fasterxml.jackson.annotation.JsonGetter' import. Should be before 'org.springframework.core.annotation.AnnotationUtils'.
Open

import com.fasterxml.jackson.annotation.JsonGetter;

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

There are no issues that match your filters.

Category
Status