r4fterman/pdf.forms

View on GitHub
src/main/java/org/pdf/forms/gui/windows/AboutPanel.java

Summary

Maintainability
A
3 hrs
Test Coverage
A
91%

Method initComponents has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void initComponents() {
        final JLabel projectPageLabel = createUrlLabel(this, VisitWebsiteCommand.GITHUB_PROJECT_PAGE);
        projectPageLabel.setHorizontalAlignment(SwingConstants.CENTER);

        final JLabel pdfFormDesignerLabel = new JLabel("PDF Forms Designer");
Severity: Major
Found in src/main/java/org/pdf/forms/gui/windows/AboutPanel.java - About 2 hrs to fix

    Remove this unused "ORIGINAL_JPEDAL_PAGE" private field.
    Open

        private static final String ORIGINAL_JPEDAL_PAGE = "http://www.jpedal.org";

    If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.

    Note that this rule does not take reflection into account, which means that issues will be raised on private fields that are only accessed using the reflection API.

    Noncompliant Code Example

    public class MyClass {
      private int foo = 42;
    
      public int compute(int a) {
        return a * 42;
      }
    
    }
    

    Compliant Solution

    public class MyClass {
      public int compute(int a) {
        return a * 42;
      }
    }
    

    Exceptions

    The Java serialization runtime associates with each serializable class a version number, called serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization.

    A serializable class can declare its own serialVersionUID explicitly by declaring a field named serialVersionUID that must be static, final, and of type long. By definition those serialVersionUID fields should not be reported by this rule:

    public class MyClass implements java.io.Serializable {
      private static final long serialVersionUID = 42L;
    }
    

    Moreover, this rule doesn't raise any issue on annotated fields.

    Remove this unused "ORIGINAL_VLDOCKING_PAGE" private field.
    Open

        private static final String ORIGINAL_VLDOCKING_PAGE = "http://www.vlsolutions.com/en/products/docking/";

    If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.

    Note that this rule does not take reflection into account, which means that issues will be raised on private fields that are only accessed using the reflection API.

    Noncompliant Code Example

    public class MyClass {
      private int foo = 42;
    
      public int compute(int a) {
        return a * 42;
      }
    
    }
    

    Compliant Solution

    public class MyClass {
      public int compute(int a) {
        return a * 42;
      }
    }
    

    Exceptions

    The Java serialization runtime associates with each serializable class a version number, called serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization.

    A serializable class can declare its own serialVersionUID explicitly by declaring a field named serialVersionUID that must be static, final, and of type long. By definition those serialVersionUID fields should not be reported by this rule:

    public class MyClass implements java.io.Serializable {
      private static final long serialVersionUID = 42L;
    }
    

    Moreover, this rule doesn't raise any issue on annotated fields.

    Remove this unused "ORIGINAL_ITEXT_PAGE" private field.
    Open

        private static final String ORIGINAL_ITEXT_PAGE = "http://www.lowagie.com/iText/";

    If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.

    Note that this rule does not take reflection into account, which means that issues will be raised on private fields that are only accessed using the reflection API.

    Noncompliant Code Example

    public class MyClass {
      private int foo = 42;
    
      public int compute(int a) {
        return a * 42;
      }
    
    }
    

    Compliant Solution

    public class MyClass {
      public int compute(int a) {
        return a * 42;
      }
    }
    

    Exceptions

    The Java serialization runtime associates with each serializable class a version number, called serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization.

    A serializable class can declare its own serialVersionUID explicitly by declaring a field named serialVersionUID that must be static, final, and of type long. By definition those serialVersionUID fields should not be reported by this rule:

    public class MyClass implements java.io.Serializable {
      private static final long serialVersionUID = 42L;
    }
    

    Moreover, this rule doesn't raise any issue on annotated fields.

    Remove this unused "USED_LIBRARIES" private field.
    Open

        private static final Map<String, String> USED_LIBRARIES = Map.of(

    If a private field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will improve maintainability because developers will not wonder what the variable is used for.

    Note that this rule does not take reflection into account, which means that issues will be raised on private fields that are only accessed using the reflection API.

    Noncompliant Code Example

    public class MyClass {
      private int foo = 42;
    
      public int compute(int a) {
        return a * 42;
      }
    
    }
    

    Compliant Solution

    public class MyClass {
      public int compute(int a) {
        return a * 42;
      }
    }
    

    Exceptions

    The Java serialization runtime associates with each serializable class a version number, called serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization.

    A serializable class can declare its own serialVersionUID explicitly by declaring a field named serialVersionUID that must be static, final, and of type long. By definition those serialVersionUID fields should not be reported by this rule:

    public class MyClass implements java.io.Serializable {
      private static final long serialVersionUID = 42L;
    }
    

    Moreover, this rule doesn't raise any issue on annotated fields.

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                                    .add(layout.createParallelGroup(GroupLayout.LEADING)
                                            .add(projectPageLabel, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                                            .add(pdfFormDesignerLabel, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                                            .add(usedLibrariesLabel)
    Severity: Minor
    Found in src/main/java/org/pdf/forms/gui/windows/AboutPanel.java and 1 other location - About 30 mins to fix
    src/main/java/org/pdf/forms/gui/windows/BugReportPanel.java on lines 116..119

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 40.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.LEADING).add(sequentialGroup));

    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 'org.jdesktop.layout.GroupLayout'
    Open

    import org.jdesktop.layout.GroupLayout;

    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 'javax.swing.JLabel'
    Open

    import javax.swing.JLabel;

    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.

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

                                            .add(projectPageLabel, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)

    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.

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

                                            .add(pdfFormDesignerLabel, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)

    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.

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

            final GroupLayout.ParallelGroup usedLibrariesGroup = layout.createParallelGroup(GroupLayout.LEADING)

    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.

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

            final JLabel projectPageLabel = createUrlLabel(this, VisitWebsiteCommand.GITHUB_PROJECT_PAGE);

    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.

    There are no issues that match your filters.

    Category
    Status