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

        for (int i = 0; i < numberOfRecentDocs; i++) {
            final JMenuItem menuItem = addDocumentToMenuEntry(recentDocs.get(i), i);
            menu.add(menuItem);

            menuItem.addActionListener(e -> {
Severity: Major
Found in src/main/java/org/pdf/forms/gui/VLFrame.java and 1 other location - About 1 hr to fix
src/main/java/org/pdf/forms/gui/VLFrame.java on lines 466..478

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

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

        for (int i = 0; i < numberOfRecentDocs; i++) {
            final JMenuItem menuItem = addDocumentToMenuEntry(recentDocs.get(i), i);
            menu.add(menuItem);

            menuItem.addActionListener(e -> {
Severity: Major
Found in src/main/java/org/pdf/forms/gui/VLFrame.java and 1 other location - About 1 hr to fix
src/main/java/org/pdf/forms/gui/VLFrame.java on lines 485..496

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

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

    private void handleBorder(
            final FormObject formObject,
            final IWidget widget) {
        final Map<String, String> border = Optional.ofNullable(formObject.getBorder())
                .map(map -> (Map<String, String>) map)
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 1 hr to fix

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

        private IWidget createListBox(
                final Widget widget,
                final Rectangle bounds) {
            final PdfList pdfList = new PdfList(fontHandler);
    
    
    src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java on lines 219..234

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

    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 IWidget createComboBox(
                final Widget widget,
                final Rectangle bounds) {
            final PdfComboBox pdfComboBox = new PdfComboBox(fontHandler);
    
    
    src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java on lines 236..248

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

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

        public RadioButtonWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final org.pdf.forms.model.des.Widget widget,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java and 2 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 60..77
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 60..77

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

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

        public TextFieldWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final org.pdf.forms.model.des.Widget widget,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java and 2 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 60..77
    src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 57..74

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

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

        public CheckBoxWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final org.pdf.forms.model.des.Widget widget,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java and 2 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 57..74
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 60..77

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

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

        public RadioButtonWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final FontHandler fontHandler) {
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java and 3 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 33..58

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

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

        public ComboBoxWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final FontHandler fontHandler) {
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java and 3 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 30..55
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 33..58

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

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

        public CheckBoxWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final FontHandler fontHandler) {
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java and 3 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 30..55
    src/main/java/org/pdf/forms/widgets/TextFieldWidget.java on lines 33..58

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

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

        public TextFieldWidget(
                final int type,
                final JComponent baseComponent,
                final JComponent component,
                final FontHandler fontHandler) {
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java and 3 other locations - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/ComboBoxWidget.java on lines 32..58
    src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 30..55

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

    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 addTextField(
                final int pageHeight,
                final int cropHeight,
                final int cropX,
                final int cropY,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java and 1 other location - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java on lines 180..204

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

    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 addPushButton(
                final int pageHeight,
                final int cropHeight,
                final int cropX,
                final int cropY,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java and 1 other location - About 1 hr to fix
    src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java on lines 155..178

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

    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

            if (!yBox.getText().equals("mixed")) {
                final String yText = yBox.getText().replace("cm", "");
                final double customY = asDouble(yText);
                yBox.setText(customY + " cm");
    
    
    src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 299..306

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

    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

            if (!xBox.getText().equals("mixed")) {
                final String xText = xBox.getText().replace("cm", "");
                final double customX = asDouble(xText);
                xBox.setText(customX + " cm");
    
    
    src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 308..315

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

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

        private void writeOutCaption(
                final IWidget widget,
                final Rectangle pageSize,
                final int currentPage,
                final GlobalPdfWriter globalPdfWriter) {
    Severity: Minor
    Found in src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java - About 1 hr to fix

      Method writeOutCaption has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void writeOutCaption(
                  final IWidget widget,
                  final Rectangle pageSize,
                  final int currentPage,
                  final GlobalPdfWriter globalPdfWriter) {
      Severity: Minor
      Found in src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java - About 1 hr to fix

        Method writeOutCaption has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void writeOutCaption(
                    final IWidget widget,
                    final Rectangle pageSize,
                    final int currentPage,
                    final GlobalPdfWriter globalPdfWriter) {
        Severity: Minor
        Found in src/main/java/org/pdf/forms/writer/PdfTextWriter.java - About 1 hr to fix

          Method writeOutCaption has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void writeOutCaption(
                      final IWidget widget,
                      final Rectangle pageSize,
                      final int currentPage,
                      final GlobalPdfWriter globalPdfWriter) {
          Severity: Minor
          Found in src/main/java/org/pdf/forms/writer/PdfComboBoxWriter.java - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language