r4fterman/pdf.forms

View on GitHub

Showing 2,278 of 2,280 total issues

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

    private void addBorder(
            final IWidget widget,
            final BaseField baseField) {
        final Optional<BorderProperties> properties = widget.getWidgetModel().getProperties().getBorder();
        if (properties.isEmpty()) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfButtonWriter.java and 4 other locations - About 2 hrs to fix
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 134..164
src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java on lines 156..184
src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java on lines 171..200
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 145..174

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

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

    private void addBorder(
            final IWidget widget,
            final BaseField baseField) {
        final Optional<BorderProperties> borderProperties = widget.getWidgetModel().getProperties().getBorder();
        if (borderProperties.isEmpty()) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java and 4 other locations - About 2 hrs to fix
src/main/java/org/pdf/forms/writer/PdfButtonWriter.java on lines 75..105
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 134..164
src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java on lines 156..184
src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java on lines 171..200

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

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

    private void addBorder(
            final IWidget widget,
            final BaseField baseField) {
        final Optional<BorderProperties> borderProperties = widget.getWidgetModel().getProperties().getBorder();
        if (borderProperties.isEmpty()) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java and 4 other locations - About 2 hrs to fix
src/main/java/org/pdf/forms/writer/PdfButtonWriter.java on lines 75..105
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 134..164
src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java on lines 156..184
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 145..174

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

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

    private void addBorder(
            final IWidget widget,
            final BaseField baseField) {
        final Optional<BorderProperties> borderProperties = widget.getWidgetModel().getProperties().getBorder();
        if (borderProperties.isEmpty()) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java and 4 other locations - About 2 hrs to fix
src/main/java/org/pdf/forms/writer/PdfButtonWriter.java on lines 75..105
src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java on lines 134..164
src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java on lines 171..200
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 145..174

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

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

    private void addBorder(
            final IWidget widget,
            final BaseField baseField) {
        final Optional<BorderProperties> borderProperties = widget.getWidgetModel().getProperties().getBorder();
        if (borderProperties.isEmpty()) {
Severity: Major
Found in src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java and 4 other locations - About 2 hrs to fix
src/main/java/org/pdf/forms/writer/PdfButtonWriter.java on lines 75..105
src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java on lines 156..184
src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java on lines 171..200
src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java on lines 145..174

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

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

WidgetSelection has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

public class WidgetSelection {

    public static final int BOX_MARGIN = 3;
    private static final int RESIZE_NODE_SIZE = 4;
    private static final int WIDTH = 22;
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java - About 2 hrs to fix

    BorderPropertiesPanel has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class BorderPropertiesPanel extends JPanel {
    
        private static final String[] BORDER_STYLES = {
                "None",
                "Solid",

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

          private void addLayoutProperties() {
              final LayoutProperties layoutProperties = getWidgetModel().getProperties().getLayout();
      
              final SizeAndPosition sizeAndPosition = layoutProperties.getSizeAndPosition();
              sizeAndPosition.setX(1);
      Severity: Major
      Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java and 4 other locations - About 2 hrs to fix
      src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 129..152
      src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 137..160
      src/main/java/org/pdf/forms/widgets/ListBoxWidget.java on lines 140..163
      src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 119..142

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

      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

          private void addLayoutProperties() {
              final LayoutProperties layoutProperties = getWidgetModel().getProperties().getLayout();
      
              final SizeAndPosition sizeAndPosition = layoutProperties.getSizeAndPosition();
              sizeAndPosition.setX(1);
      Severity: Major
      Found in src/main/java/org/pdf/forms/widgets/ListBoxWidget.java and 4 other locations - About 2 hrs to fix
      src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 129..152
      src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 137..160
      src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 119..142
      src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 140..163

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

      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

          private void addLayoutProperties() {
              final LayoutProperties layoutProperties = getWidgetModel().getProperties().getLayout();
      
              final SizeAndPosition sizeAndPosition = layoutProperties.getSizeAndPosition();
              sizeAndPosition.setX(1);
      Severity: Major
      Found in src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java and 4 other locations - About 2 hrs to fix
      src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 137..160
      src/main/java/org/pdf/forms/widgets/ListBoxWidget.java on lines 140..163
      src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 119..142
      src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 140..163

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

      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

          private void addLayoutProperties() {
              final LayoutProperties layoutProperties = getWidgetModel().getProperties().getLayout();
      
              final SizeAndPosition sizeAndPosition = layoutProperties.getSizeAndPosition();
              sizeAndPosition.setX(1);
      Severity: Major
      Found in src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java and 4 other locations - About 2 hrs to fix
      src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 129..152
      src/main/java/org/pdf/forms/widgets/ListBoxWidget.java on lines 140..163
      src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 119..142
      src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 140..163

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

      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

          private void addLayoutProperties() {
              final LayoutProperties layoutProperties = getWidgetModel().getProperties().getLayout();
      
              final SizeAndPosition sizeAndPosition = layoutProperties.getSizeAndPosition();
              sizeAndPosition.setX(1);
      Severity: Major
      Found in src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java and 4 other locations - About 2 hrs to fix
      src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 129..152
      src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 137..160
      src/main/java/org/pdf/forms/widgets/ListBoxWidget.java on lines 140..163
      src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 140..163

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

      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 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void initComponents() {
              final JLabel locationLabel = new JLabel("Location:");
      
              imageLocationBox = new JTextField();
              imageLocationBox.addFocusListener(new FocusAdapter() {

        Method createBordersPanel has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private JPanel createBordersPanel() {
                final JPanel panel = new JPanel();
                panel.setBorder(BorderFactory.createTitledBorder("Borders"));
        
                final JLabel leftEdgesIcon = new JLabel(new ImageIcon(getClass()

          FieldProperties has 22 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class FieldProperties {
          
              private static final String GROUP_NAME = "Group Name";
              private static final String MAX_CHARS = "Max Chars";
              private static final String LIMIT_LENGTH = "Limit Length";
          Severity: Minor
          Found in src/main/java/org/pdf/forms/model/des/FieldProperties.java - About 2 hrs to fix

            WidgetFactory has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class WidgetFactory {
            
                private static final JFrame FRAME = new JFrame();
            
                public static JLabel createResizedComponent(
            Severity: Minor
            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java - About 2 hrs to fix

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

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

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

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

                  WidgetAlignmentAndOrder has 21 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public final class WidgetAlignmentAndOrder {
                  
                      public static final String ALIGN_LEFT = "Align Left";
                      public static final String ALIGN_RIGHT = "Align Right";
                      public static final String ALIGN_TOP = "Align Top";

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

                        @Override
                        public void setUnderlineType(final int type) {
                            switch (type) {
                                case IWidget.UNDERLINE_SINGLE:
                                    standardUnderline = true;
                    src/main/java/org/pdf/forms/widgets/components/PdfTextField.java on lines 82..108

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language