r4fterman/pdf.forms

View on GitHub

Showing 2,278 of 2,280 total issues

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

    private void addParagraphProperties() {
        final ParagraphProperties paragraphProperties = new ParagraphProperties();

        final Optional<ParagraphCaption> paragraphCaption = paragraphProperties.getParagraphCaption();
        paragraphCaption.ifPresent(caption -> caption.setHorizontalAlignment("center"));
Severity: Major
Found in src/main/java/org/pdf/forms/widgets/ButtonWidget.java and 3 other locations - About 55 mins to fix
src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 169..176
src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 159..167
src/main/java/org/pdf/forms/widgets/TextWidget.java on lines 137..144

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

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

    private void addParagraphProperties() {
        final ParagraphProperties paragraphProperties = new ParagraphProperties();

        final Optional<ParagraphCaption> paragraphCaption = paragraphProperties.getParagraphCaption();
        paragraphCaption.ifPresent(caption -> caption.setHorizontalAlignment("left"));
Severity: Major
Found in src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java and 3 other locations - About 55 mins to fix
src/main/java/org/pdf/forms/widgets/ButtonWidget.java on lines 147..155
src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java on lines 169..176
src/main/java/org/pdf/forms/widgets/TextWidget.java on lines 137..144

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

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

    private void addParagraphProperties() {
        final ParagraphProperties paragraphProperties = new ParagraphProperties();

        final Optional<ParagraphCaption> paragraphCaption = paragraphProperties.getParagraphCaption();
        paragraphCaption.ifPresent(caption -> caption.setHorizontalAlignment("left"));
Severity: Major
Found in src/main/java/org/pdf/forms/widgets/CheckBoxWidget.java and 3 other locations - About 55 mins to fix
src/main/java/org/pdf/forms/widgets/ButtonWidget.java on lines 147..155
src/main/java/org/pdf/forms/widgets/RadioButtonWidget.java on lines 159..167
src/main/java/org/pdf/forms/widgets/TextWidget.java on lines 137..144

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

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 writeJavaScript has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

            final PdfWriter writer,
            final Rectangle pageSize,
            final int currentPage,
            final GlobalPdfWriter globalPdfWriter,
            final List<IWidget> widgetsInGroup,
Severity: Major
Found in src/main/java/org/pdf/forms/writer/Writer.java - About 50 mins to fix

    Method parseWidgets has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                final AcroRenderer currentFormRenderer,
                final Page page,
                final int pageHeight,
                final int cropHeight,
                final int cropX,
    Severity: Major
    Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 50 mins to fix

      Method addFormButton has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  final Page page,
                  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 - About 50 mins to fix

        Method getBasicWidget has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    final FormObject formObject,
                    final int type,
                    final int pageHeight,
                    final int cropHeight,
                    final int cropX,
        Severity: Major
        Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 50 mins to fix

          Method getTreeCellRendererComponent has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                      final JTree tree,
                      final Object value,
                      final boolean isSelected,
                      final boolean expanded,
                      final boolean leaf,

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

                @Override
                public boolean equals(final Object o) {
                    if (o instanceof CustomProperties) {
                        final CustomProperties that = (CustomProperties) o;
                        return Objects.equals(recentDesFiles, that.recentDesFiles)
            src/main/java/org/pdf/forms/model/des/DesDocument.java on lines 56..65
            src/main/java/org/pdf/forms/model/des/LayoutProperties.java on lines 49..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 62.

            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 removeClicked(final ActionEvent event) {
                    final String selectedItem = buttonGroupsList.getSelectedValue();
                    if (selectedItem == null) {
                        return;
                    }
            src/main/java/org/pdf/forms/gui/windows/RadioButtonGroupOrganiser.java on lines 157..170

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

            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 removeClicked(final ActionEvent event) {
                    final String selectedItem = buttonGroupsList.getSelectedValue();
                    if (selectedItem == null) {
                        return;
                    }
            src/main/java/org/pdf/forms/gui/windows/CheckBoxButtonGroupOrganiser.java on lines 143..157

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

            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 (width < 0) {
                        width = -width;
            
                        x = x - width + 1;
                        if (x < 0) {
            src/main/java/org/pdf/forms/gui/designer/gui/DesignerSelectionBox.java on lines 77..85

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

            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 boolean equals(final Object o) {
                    if (o instanceof LayoutProperties) {
                        final LayoutProperties that = (LayoutProperties) o;
                        return Objects.equals(sizeAndPosition, that.sizeAndPosition)
            Severity: Major
            Found in src/main/java/org/pdf/forms/model/des/LayoutProperties.java and 2 other locations - About 50 mins to fix
            src/main/java/org/pdf/forms/model/des/DesDocument.java on lines 56..65
            src/main/java/org/pdf/forms/model/properties/CustomProperties.java on lines 52..61

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

            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 (height < 0) {
                        height = -height;
            
                        y = y - height + 1;
                        if (y < 0) {
            src/main/java/org/pdf/forms/gui/designer/gui/DesignerSelectionBox.java on lines 67..75

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

            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 boolean equals(final Object o) {
                    if (o instanceof DesDocument) {
                        final DesDocument desDocument = (DesDocument) o;
                        return Objects.equals(property, desDocument.property)
            Severity: Major
            Found in src/main/java/org/pdf/forms/model/des/DesDocument.java and 2 other locations - About 50 mins to fix
            src/main/java/org/pdf/forms/model/des/LayoutProperties.java on lines 49..58
            src/main/java/org/pdf/forms/model/properties/CustomProperties.java on lines 52..61

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

            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

                @Override
                public String toString() {
                    return new StringJoiner(", ", ObjectProperties.class.getSimpleName() + "[", "]")
                            .add("field=" + field)
                            .add("value=" + value)
            Severity: Minor
            Found in src/main/java/org/pdf/forms/model/des/ObjectProperties.java and 1 other location - About 50 mins to fix
            src/main/java/org/pdf/forms/model/des/Page.java on lines 128..137

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

            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

                @Override
                public String toString() {
                    return new StringJoiner(", ", Page.class.getSimpleName() + "[", "]")
                            .add("properties=" + property)
                            .add("pagedata=" + pageData)
            Severity: Minor
            Found in src/main/java/org/pdf/forms/model/des/Page.java and 1 other location - About 50 mins to fix
            src/main/java/org/pdf/forms/model/des/ObjectProperties.java on lines 76..85

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

            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 resizeSplitVertical(
                        final Set<IWidget> widgets,
                        final IDesigner designerPanel,
                        final int mouseY) {
                    final int y = selectionBoxBounds.y;
            Severity: Minor
            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java and 1 other location - About 50 mins to fix
            src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java on lines 357..367

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

            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 resizeSplitHorizontal(
                        final Set<IWidget> widgets,
                        final IDesigner designerPanel,
                        final int mouseX) {
                    final int x = selectionBoxBounds.x;
            Severity: Minor
            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java and 1 other location - About 50 mins to fix
            src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java on lines 345..355

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

            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 addRadioButtonGroupsToPage(
                        final org.pdf.forms.model.des.Page page,
                        final Page newPage) {
                    final RadioButtonGroups radioButtonGroups = page.getRadioButtonGroups();
                    radioButtonGroups.getButtonGroupNames().forEach(buttonGroupName -> {
            src/main/java/org/pdf/forms/gui/commands/OpenDesignerFileCommand.java on lines 199..208

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

            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