r4fterman/pdf.forms

View on GitHub

Showing 2,278 of 2,280 total issues

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

package org.pdf.forms.gui.properties.object.field;

import static java.util.stream.Collectors.toUnmodifiableList;

import java.awt.event.ActionEvent;
src/main/java/org/pdf/forms/gui/properties/object/field/RadioButtonFieldPanel.java on lines 1..201

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 874.

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

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

package org.pdf.forms.gui.properties.object.field;

import static java.util.stream.Collectors.toUnmodifiableList;

import java.awt.event.ActionEvent;
src/main/java/org/pdf/forms/gui/properties/object/field/CheckBoxFieldPanel.java on lines 1..203

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 874.

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

Widget has 64 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class Widget implements IWidget {

    private final Logger logger = LoggerFactory.getLogger(Widget.class);

    private final org.pdf.forms.model.des.Widget widget;
Severity: Major
Found in src/main/java/org/pdf/forms/widgets/Widget.java - About 1 day to fix

    File Widget.java has 528 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package org.pdf.forms.widgets;
    
    import java.awt.*;
    import java.awt.font.TextAttribute;
    import java.util.Collections;
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/Widget.java - About 1 day to fix

      File VLFrame.java has 521 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package org.pdf.forms.gui;
      
      import java.awt.*;
      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      Severity: Major
      Found in src/main/java/org/pdf/forms/gui/VLFrame.java - About 1 day to fix

        File SizeAndPositionPanel.java has 470 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package org.pdf.forms.gui.properties.layout;
        
        import static java.util.stream.Collectors.toUnmodifiableList;
        import static org.jdesktop.layout.GroupLayout.BASELINE;
        import static org.jdesktop.layout.GroupLayout.DEFAULT_SIZE;

          VLFrame has 51 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class VLFrame extends JFrame implements IMainFrame {
          
              private final Version version;
              private final WidgetFactory widgetFactory;
              private final Configuration configuration;
          Severity: Major
          Found in src/main/java/org/pdf/forms/gui/VLFrame.java - About 7 hrs to fix

            File Writer.java has 458 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package org.pdf.forms.writer;
            
            import static java.util.stream.Collectors.toUnmodifiableMap;
            
            import java.awt.*;
            Severity: Minor
            Found in src/main/java/org/pdf/forms/writer/Writer.java - About 7 hrs to fix

              File FontPropertiesPanel.java has 442 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package org.pdf.forms.gui.properties.font;
              
              import static java.util.stream.Collectors.toUnmodifiableList;
              import static org.jdesktop.layout.GroupLayout.BASELINE;
              import static org.jdesktop.layout.GroupLayout.DEFAULT_SIZE;

                GroupWidget has 47 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class GroupWidget implements IWidget {
                
                    private static int groupNextWidgetNumber = 1;
                
                    private static final int TYPE = IWidget.GROUP;
                Severity: Minor
                Found in src/main/java/org/pdf/forms/widgets/GroupWidget.java - About 6 hrs to fix

                  IWidget has 47 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public interface IWidget {
                  
                      int NONE = -1;
                      int TEXT_FIELD = 0;
                      int TEXT = 1;
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/widgets/IWidget.java - About 6 hrs to fix

                    File Designer.java has 424 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package org.pdf.forms.gui.designer;
                    
                    import java.awt.*;
                    import java.util.Collection;
                    import java.util.HashSet;
                    Severity: Minor
                    Found in src/main/java/org/pdf/forms/gui/designer/Designer.java - About 6 hrs to fix

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

                      package org.pdf.forms.model.des;
                      
                      import java.util.ArrayList;
                      import java.util.List;
                      import java.util.Objects;
                      Severity: Major
                      Found in src/main/java/org/pdf/forms/model/des/FontCaption.java and 1 other location - About 6 hrs to fix
                      src/main/java/org/pdf/forms/model/des/FontValue.java on lines 1..124

                      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 370.

                      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

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

                      package org.pdf.forms.model.des;
                      
                      import java.util.ArrayList;
                      import java.util.List;
                      import java.util.Objects;
                      Severity: Major
                      Found in src/main/java/org/pdf/forms/model/des/FontValue.java and 1 other location - About 6 hrs to fix
                      src/main/java/org/pdf/forms/model/des/FontCaption.java on lines 1..124

                      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 370.

                      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

                      Designer has 43 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class Designer extends PdfDecoder implements IDesigner {
                      
                          private final Logger logger = LoggerFactory.getLogger(Designer.class);
                      
                          private final WidgetSelection widgetSelection;
                      Severity: Minor
                      Found in src/main/java/org/pdf/forms/gui/designer/Designer.java - About 5 hrs to fix

                        File CDropTargetListener.java has 386 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        package org.pdf.forms.gui.hierarchy.tree;
                        
                        import java.awt.*;
                        import java.awt.datatransfer.DataFlavor;
                        import java.awt.datatransfer.Transferable;

                          File WidgetSelection.java has 382 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          package org.pdf.forms.widgets.utils;
                          
                          import static java.util.stream.Collectors.toUnmodifiableSet;
                          
                          import java.awt.*;
                          Severity: Minor
                          Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java - About 5 hrs to fix

                            File WidgetParser.java has 370 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            package org.pdf.forms.widgets.utils;
                            
                            import java.awt.*;
                            import java.util.Collections;
                            import java.util.HashSet;
                            Severity: Minor
                            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 4 hrs to fix

                              IDesigner has 37 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              public interface IDesigner {
                              
                                  Color BACKGROUND_COLOR = new Color(236, 233, 216);
                                  Color PAGE_COLOR = Color.white;
                              
                              
                              Severity: Minor
                              Found in src/main/java/org/pdf/forms/gui/designer/IDesigner.java - About 4 hrs to fix

                                TestDesginer has 37 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                public class TestDesginer implements IDesigner {
                                    @Override
                                    public void displayPage(final Page page) {
                                
                                    }
                                Severity: Minor
                                Found in src/main/java/org/pdf/forms/gui/properties/layout/TestDesginer.java - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language