r4fterman/pdf.forms

View on GitHub
src/main/java/org/pdf/forms/model/des/JavaScriptContent.java

Summary

Maintainability
A
1 hr
Test Coverage
F
43%

Consider simplifying this complex logical expression.
Open

        if (o instanceof JavaScriptContent) {
            final JavaScriptContent that = (JavaScriptContent) o;
            return Objects.equals(initialize, that.initialize)
                    && Objects.equals(mouseEnter, that.mouseEnter)
                    && Objects.equals(mouseExit, that.mouseExit)
Severity: Major
Found in src/main/java/org/pdf/forms/model/des/JavaScriptContent.java - About 1 hr to fix

    Method equals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        @Override
        public boolean equals(final Object o) {
            if (o instanceof JavaScriptContent) {
                final JavaScriptContent that = (JavaScriptContent) o;
                return Objects.equals(initialize, that.initialize)
    Severity: Minor
    Found in src/main/java/org/pdf/forms/model/des/JavaScriptContent.java - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Wrong lexicographical order for 'jakarta.xml.bind.annotation.XmlType' import. Should be before 'java.util.function.Consumer'.
    Open

    import jakarta.xml.bind.annotation.XmlType;

    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.

    Parameter name 'o' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
    Open

        public boolean equals(final Object o) {

    Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

    To validate catch parameters please useCatchParameterName.

    To validate lambda parameters please useLambdaParameterName.

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

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

            return Objects.hash(initialize, mouseEnter, mouseExit, change, mouseUp, mouseDown, keystroke);

    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 'jakarta.xml.bind.annotation.XmlType'
    Open

    import jakarta.xml.bind.annotation.XmlType;

    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