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

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

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

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/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

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

    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

Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

            final IWidget widget,
            final Rectangle pageSize,
            final int currentPage,
            final PdfWriter writer,
            final GlobalPdfWriter globalPdfWriter) throws IOException, DocumentException {
Severity: Minor
Found in src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java - About 35 mins to fix

    Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                final IWidget widget,
                final Rectangle pageSize,
                final int currentPage,
                final PdfWriter writer,
                final GlobalPdfWriter globalPdfWriter) {
    Severity: Minor
    Found in src/main/java/org/pdf/forms/writer/PdfTextWriter.java - About 35 mins to fix

      Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  final IWidget widget,
                  final Rectangle pageSize,
                  final int currentPage,
                  final PdfWriter writer,
                  final GlobalPdfWriter globalPdfWriter) throws IOException, DocumentException {
      Severity: Minor
      Found in src/main/java/org/pdf/forms/writer/PdfCheckBoxWriter.java - About 35 mins to fix

        Method addWidgets has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    final PdfWriter writer,
                    final List<IWidget> widgets,
                    final Rectangle pageSize,
                    final int currentPage,
                    final GlobalPdfWriter globalPdfWriter) throws IOException, DocumentException {
        Severity: Minor
        Found in src/main/java/org/pdf/forms/writer/Writer.java - About 35 mins to fix

          Method resizeWidgets has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                      final Set<IWidget> selectedWidgets,
                      final IDesigner designerPanel,
                      final int mouseX,
                      final int mouseY,
                      final int resizeType) {
          Severity: Minor
          Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java - About 35 mins to fix

            Method createParallelGroup has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                        final JLabel labelForTextFieldA,
                        final JTextField textFieldA,
                        final JLabel labelForTextFieldB,
                        final JTextField textFieldB,
                        final GroupLayout groupLayout) {

              Method getBounds has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                          final FormObject formObject,
                          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 - About 35 mins to fix

                Method dragOverPage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                            final DropTargetDragEvent e,
                            final DefaultMutableTreeNode targetNode,
                            final DefaultMutableTreeNode sourceNode,
                            final List<TreeNode> flattenedTreeItems,
                            final Object targetUserObject) {
                Severity: Minor
                Found in src/main/java/org/pdf/forms/gui/hierarchy/tree/CDropTargetListener.java - About 35 mins to fix

                  Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              final IWidget widget,
                              final Rectangle pageSize,
                              final int currentPage,
                              final PdfWriter writer,
                              final GlobalPdfWriter globalPdfWriter) throws IOException, DocumentException {
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/writer/PdfTextFieldWriter.java - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language