r4fterman/pdf.forms

View on GitHub

Showing 282 of 2,280 total issues

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

    private JToggleButton createAlignHorizontalLeftButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Left.gif")));
        button.setToolTipText("Horizontal Align Left");
        button.setName("left");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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

    private JToggleButton createAlignHorizontalRightButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Right.gif")));
        button.setToolTipText("Horizontal Align Right");
        button.setName("right");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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

    private JToggleButton createAlignVerticalTopButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Top.gif")));
        button.setToolTipText("Vertical Align Top");
        button.setName("top");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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 JToggleButton createRotate90DegreeButton() {
        final JToggleButton rotateButton = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Anchor Rotation 90.png")));
        rotateButton.setEnabled(false);
        rotateButton.setName("90");
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 204..211
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 213..220
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 231..238

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

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

    private JToggleButton createAlignVerticalCenterButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Middle.gif")));
        button.setToolTipText("Vertical Align Center");
        button.setName("center");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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

    private JToggleButton createAlignVerticalBottomButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Bottom.gif")));
        button.setToolTipText("Vertical Align Bottom");
        button.setName("bottom");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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

    private JToggleButton createAlignHorizontalCenterButton() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Center.gif")));
        button.setToolTipText("Horizontal Align Center");
        button.setName("center");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 187..194

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

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 saveDesignerFile(
            final DesDocument designerDocument,
            final File file) {
        final String fileToSave = file.getAbsolutePath();

src/main/java/org/pdf/forms/gui/commands/SaveDesignerFileCommand.java on lines 48..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 49.

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

    private JToggleButton createAlignHorizontalJustify() {
        final JToggleButton button = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Paragraph Align Justify.gif")));
        button.setToolTipText("Horizontal Align Justify");
        button.setName("justify");
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 133..140
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 142..149
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 151..158
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 160..167
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 169..176
src/main/java/org/pdf/forms/gui/properties/paragraph/ParagraphPropertiesPanel.java on lines 178..185

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

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 addListBox(
            final int pageHeight,
            final int cropHeight,
            final int cropX,
            final int cropY,
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java and 1 other location - About 40 mins to fix
src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java on lines 135..153

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

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 JToggleButton createRotate270DegreeButton() {
        final JToggleButton rotateButton = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Anchor Rotation 270.png")));
        rotateButton.setEnabled(false);
        rotateButton.setName("270");
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 213..220
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 222..229
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 231..238

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

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 saveDesignerFile(
            final File file,
            final DesDocument designerDocument) {
        final String fileToSave = file.getAbsolutePath();

src/main/java/org/pdf/forms/gui/commands/SaveDesignerFileAsCommand.java on lines 32..40

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

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 JToggleButton createRotate0DegreeButton() {
        final JToggleButton rotateButton = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Anchor Rotation 0.png")));
        rotateButton.setEnabled(false);
        rotateButton.setName("0");
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 204..211
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 213..220
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 222..229

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

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 JToggleButton createRotate180DegreeButton() {
        final JToggleButton rotateButton = new JToggleButton(new ImageIcon(getClass()
                .getResource("/org/pdf/forms/res/Anchor Rotation 180.png")));
        rotateButton.setEnabled(false);
        rotateButton.setName("180");
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 204..211
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 222..229
src/main/java/org/pdf/forms/gui/properties/layout/SizeAndPositionPanel.java on lines 231..238

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

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 addComboBox(
            final int pageHeight,
            final int cropHeight,
            final int cropX,
            final int cropY,
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java and 1 other location - About 40 mins to fix
src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java on lines 114..133

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

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 (radioButtonGroups.isEmpty()) {
                /*
                 * there are no radio button groups currently on this page, so we need to
                 * create a new on
                 */
src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java on lines 118..123

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

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 (radioButtonGroups.isEmpty()) {
            buttonGroup = new ButtonGroup(IWidget.RADIO_BUTTON);
            radioButtonGroups.add(buttonGroup);
        } else {
            buttonGroup = radioButtonGroups.get(radioButtonGroups.size() - 1);
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java and 1 other location - About 40 mins to fix
src/main/java/org/pdf/forms/gui/hierarchy/tree/CDropTargetListener.java on lines 375..385

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

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

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

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

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 selectFontNameInComboBox(final Set<IWidget> widgets) {
        final String fontNameToUse = getFontName(widgets);
        if (fontNameToUse.equals("mixed")) {
            setComboValue(this.fontBox, null);
        } else {
src/main/java/org/pdf/forms/gui/toolbars/WidgetPropertiesToolBar.java on lines 210..217

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

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