r4fterman/pdf.forms

View on GitHub

Showing 2,278 of 2,280 total issues

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

    private void initComponents() {
        allowMultipleLinesBox = new TriStateCheckBox(
                "Allow Multiple Line",
                TriStateCheckBox.State.NOT_SELECTED,
                this::saveAllowedMultipleLines);

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

    package org.pdf.forms.gui.commands;
    
    import java.awt.*;
    import java.util.Set;
    
    
    src/main/java/org/pdf/forms/gui/commands/AlignVerticallyCommand.java on lines 1..54

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

    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.commands;
    
    import java.awt.*;
    import java.util.Set;
    
    
    src/main/java/org/pdf/forms/gui/commands/AlignHorizontallyCommand.java on lines 1..54

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

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

        private void addFontProperties() {
            final FontProperties fontProperties = new FontProperties();
    
            final FontCaption fontCaption = fontProperties.getFontCaption();
            fontCaption.setFontName(getFontHandler().getDefaultFont().getFontName());
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java and 1 other location - About 3 hrs to fix
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 95..115

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

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

        private void addFontProperties() {
            final FontProperties fontProperties = new FontProperties();
    
            final FontCaption fontCaption = fontProperties.getFontCaption();
            fontCaption.setFontName(getFontHandler().getDefaultFont().getFontName());
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java and 1 other location - About 3 hrs to fix
    src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 95..115

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

    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.commands;
    
    import java.awt.*;
    import java.util.Set;
    
    
    src/main/java/org/pdf/forms/gui/commands/AlignTopCommand.java on lines 1..57

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

    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.commands;
    
    import java.awt.*;
    import java.util.Set;
    
    
    src/main/java/org/pdf/forms/gui/commands/AlignLeftCommand.java on lines 1..59

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

    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

        private void updateVerticalAlignment(final ActionEvent evt) {
            final String alignment = ((JComponent) evt.getSource()).getName();
    
            widgets.forEach(widget -> {
                final Object selectedItem = currentlyEditingBox.getSelectedItem();
    src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 232..256

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

    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

        private void updateHorizontalAlignment(final ActionEvent evt) {
            final String alignment = ((JComponent) evt.getSource()).getName();
    
            widgets.forEach(widget -> {
                final Object selectedItem = currentlyEditingBox.getSelectedItem();
    src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 206..230

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

    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

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

        private void initComponents() {
            final JLabel nameLabel = new JLabel();
            nameLabel.setText("Your Name:");
    
            final JLabel emailLabel = new JLabel();
    Severity: Major
    Found in src/main/java/org/pdf/forms/gui/windows/BugReportPanel.java - About 3 hrs to fix

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

          @Override
          public void paintComponent(final Graphics graphics) {
              super.paintComponent(graphics);
      
              final String text = getText();
      src/main/java/org/pdf/forms/widgets/components/PdfCaption.java on lines 27..52
      src/main/java/org/pdf/forms/widgets/components/PdfTextField.java on lines 34..59

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

      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

          @Override
          public void paintComponent(final Graphics graphics) {
              super.paintComponent(graphics);
      
              final String text = getText();
      src/main/java/org/pdf/forms/widgets/components/PdfButton.java on lines 31..56
      src/main/java/org/pdf/forms/widgets/components/PdfTextField.java on lines 34..59

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

      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

          @Override
          public void paintComponent(final Graphics graphics) {
              super.paintComponent(graphics);
      
              final String text = getText();
      src/main/java/org/pdf/forms/widgets/components/PdfButton.java on lines 31..56
      src/main/java/org/pdf/forms/widgets/components/PdfCaption.java on lines 27..52

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

      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

      SizeAndPosition has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @XmlType(name = "sizeandposition")
      public class SizeAndPosition {
      
          private static final String X = "X";
          private static final String Y = "Y";
      Severity: Minor
      Found in src/main/java/org/pdf/forms/model/des/SizeAndPosition.java - About 3 hrs to fix

        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

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

              private void initComponents() {
                  final JLabel questionLabel = new JLabel();
                  questionLabel.setText("How would you like to import the PDF document?");
          
                  final JPanel importTypePanel = new JPanel();
          Severity: Major
          Found in src/main/java/org/pdf/forms/gui/windows/PDFImportChooser.java - About 2 hrs to fix

            TriStateDecorator has 25 methods (exceeds 20 allowed). Consider refactoring.
            Open

                private final class TriStateDecorator implements ButtonModel {
                    private final ButtonModel other;
            
                    private TriStateDecorator(final ButtonModel other) {
                        this.other = other;

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

                  private void initComponents() {
                      typeLabel = new JLabel("Type:");
                      typeLabel.setEnabled(false);
              
                      typeBox = new JComboBox<>(TYPES);

                File WidgetFactory.java has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package org.pdf.forms.widgets.utils;
                
                import java.awt.*;
                import java.awt.image.BufferedImage;
                import java.util.List;
                Severity: Minor
                Found in src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java - About 2 hrs to fix

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

                      private void initComponents() {
                          final JLabel currentlyEditingLabel = new JLabel("Currently Editing:");
                  
                          currentlyEditingBox = createEditingBox();
                          horizontalAlignLeft = createAlignHorizontalLeftButton();
                    Severity
                    Category
                    Status
                    Source
                    Language