r4fterman/pdf.forms

View on GitHub

Showing 2,278 of 2,280 total issues

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    private void writeOutCaption(
            final IWidget widget,
            final Rectangle pageSize,
            final int currentPage,
            final GlobalPdfWriter globalPdfWriter) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java and 2 other locations - About 4 hrs to fix
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 90..143
src/main/java/org/pdf/forms/writer/PdfTextWriter.java on lines 50..104

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

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    private void writeOutCaption(
            final IWidget widget,
            final Rectangle pageSize,
            final int currentPage,
            final GlobalPdfWriter globalPdfWriter) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfTextWriter.java and 2 other locations - About 4 hrs to fix
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 79..132
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 90..143

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

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

    private void writeOutCaption(
            final IWidget widget,
            final Rectangle pageSize,
            final int currentPage,
            final GlobalPdfWriter globalPdfWriter) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java and 2 other locations - About 4 hrs to fix
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 79..132
src/main/java/org/pdf/forms/writer/PdfTextWriter.java on lines 50..104

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

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

File BorderPropertiesPanel.java has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package org.pdf.forms.gui.properties.border;

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

import java.awt.*;

    File ParagraphPropertiesPanel.java has 354 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package org.pdf.forms.gui.properties.paragraph;
    
    import static java.util.stream.Collectors.toUnmodifiableList;
    import static javax.swing.SwingConstants.VERTICAL;
    import static org.jdesktop.layout.GroupLayout.BASELINE;

      Method initializePanel has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void initializePanel() {
              setBorder(BorderFactory.createTitledBorder("Size & Position"));
      
              final JLabel xLabel = new JLabel("X:");
              final JLabel widthLabel = new JLabel("Width:");

        SizeAndPositionPanel has 34 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class SizeAndPositionPanel extends JPanel {
        
            private static final String[] ANCHORS = {
                    "Top Left",
                    "Top Middle",

          IMainFrame has 34 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public interface IMainFrame {
          
              int INSET = 15;
          
              void resetPaletteButtons();
          Severity: Minor
          Found in src/main/java/org/pdf/forms/gui/IMainFrame.java - About 4 hrs to fix

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

                private void initComponents() {
                    final JLabel appearanceLabel = new JLabel("Appearance:");
                    appearanceLabel.setEnabled(false);
            
                    final JComboBox<String> appearanceBox = new JComboBox<>(APPEARANCES);

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

              package org.pdf.forms.model.des;
              
              import java.util.ArrayList;
              import java.util.List;
              import java.util.Objects;
              src/main/java/org/pdf/forms/model/des/BackgroundFill.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/BindingProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphCaption.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphValue.java on lines 1..88

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

              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 5 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/BackgroundFill.java and 4 other locations - About 4 hrs to fix
              src/main/java/org/pdf/forms/model/des/BindingProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/CaptionProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphCaption.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphValue.java on lines 1..88

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

              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 5 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/ParagraphCaption.java and 4 other locations - About 4 hrs to fix
              src/main/java/org/pdf/forms/model/des/BackgroundFill.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/BindingProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/CaptionProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphValue.java on lines 1..88

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

              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 5 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/ParagraphValue.java and 4 other locations - About 4 hrs to fix
              src/main/java/org/pdf/forms/model/des/BackgroundFill.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/BindingProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/CaptionProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphCaption.java on lines 1..88

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

              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 5 locations. Consider refactoring.
              Open

              package org.pdf.forms.model.des;
              
              import java.util.ArrayList;
              import java.util.List;
              import java.util.Objects;
              src/main/java/org/pdf/forms/model/des/BackgroundFill.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/CaptionProperties.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphCaption.java on lines 1..88
              src/main/java/org/pdf/forms/model/des/ParagraphValue.java on lines 1..88

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

              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

              File WidgetPropertiesToolBar.java has 340 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package org.pdf.forms.gui.toolbars;
              
              import static java.util.stream.Collectors.toUnmodifiableList;
              
              import java.awt.*;
              Severity: Minor
              Found in src/main/java/org/pdf/forms/gui/toolbars/WidgetPropertiesToolBar.java - About 4 hrs to fix

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

                    private void initComponents() {
                        final JLabel currentlyEditingLabel = new JLabel("Currently Editing:");
                
                        currentlyEditingBox = new JComboBox<>(EDITING_VALUES);
                        currentlyEditingBox.addActionListener(this::updateCurrentlyEditingBox);

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

                      private void initComponents() {
                          final JLabel paperTypeLabel = new JLabel("Paper Type:");
                  
                          paperTypeBox = new JComboBox<>();
                          paperTypeBox.setModel(new DefaultComboBoxModel<>(PAPER_TYPES));
                  Severity: Major
                  Found in src/main/java/org/pdf/forms/gui/properties/object/page/PagePanel.java - About 4 hrs to fix

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

                    package org.pdf.forms.model.configuration;
                    
                    import java.util.Objects;
                    import java.util.StringJoiner;
                    
                    
                    Severity: Major
                    Found in src/main/java/org/pdf/forms/model/configuration/Item.java and 1 other location - About 3 hrs to fix
                    src/main/java/org/pdf/forms/model/configuration/Window.java on lines 1..73

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

                    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.configuration;
                    
                    import java.util.Objects;
                    import java.util.StringJoiner;
                    
                    
                    Severity: Major
                    Found in src/main/java/org/pdf/forms/model/configuration/Window.java and 1 other location - About 3 hrs to fix
                    src/main/java/org/pdf/forms/model/configuration/Item.java on lines 1..73

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

                    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

                    WidgetPropertiesToolBar has 29 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class WidgetPropertiesToolBar extends VLToolBar {
                    
                        private static final String[] FONT_SIZES = {
                                "6",
                                "8",
                    Severity: Minor
                    Found in src/main/java/org/pdf/forms/gui/toolbars/WidgetPropertiesToolBar.java - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language