r4fterman/pdf.forms

View on GitHub

Showing 172 of 2,280 total issues

Method initializePanel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void initializePanel() {
        setBorder(BorderFactory.createTitledBorder("Caption"));

        final JLabel positionLabel = new JLabel("Position:");

Severity: Minor
Found in src/main/java/org/pdf/forms/gui/properties/layout/CaptionPanel.java - About 1 hr to fix

    Method setUpWidgetSelection has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private Set<IWidget> setUpWidgetSelection(
                final int x,
                final int y) {
            // if no widget is selected then set up the selection box,
            // otherwise a widget is either about to be moved or resized, so set up for that

      Method buildFileMenu has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static Menu buildFileMenu() {
              return new MenuBuilder().withName("File").withVisible(true)
                      .addItem(new ItemBuilder().withCommand("NEW").withName("New").withVisible(true).build())
                      .addItem(new ItemBuilder().withCommand("OPEN").withName("Open Designer File...").withVisible(true)
                              .build())

        Method setSplitPaneDividerColor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void setSplitPaneDividerColor(final JSplitPane splitPane) {
                final SplitPaneUI splitUI = splitPane.getUI();
                if (splitUI instanceof BasicSplitPaneUI) {
                    // obviously this will not work if the ui does not extend Basic...
                    final int dividerSize = splitPane.getDividerSize();
        Severity: Minor
        Found in src/main/java/org/pdf/forms/widgets/components/SplitComponent.java - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if (o instanceof JavaScriptContent) {
                      final JavaScriptContent that = (JavaScriptContent) o;
                      return Objects.equals(initialize, that.initialize)
                              && Objects.equals(mouseEnter, that.mouseEnter)
                              && Objects.equals(mouseExit, that.mouseExit)
          Severity: Major
          Found in src/main/java/org/pdf/forms/model/des/JavaScriptContent.java - About 1 hr to fix

            Method addCheckBox has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                        final FormObject formObject,
                        final Page page,
                        final String groupName,
                        final int pageHeight,
                        final int cropHeight,
            Severity: Major
            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 1 hr to fix

              Method getResizeTypeForSplitComponent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public int getResizeTypeForSplitComponent(
                          final int mouseX,
                          final int mouseY) {
                      final SplitComponent sc = (SplitComponent) baseComponent;
              Severity: Minor
              Found in src/main/java/org/pdf/forms/widgets/Widget.java - About 55 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method equals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public boolean equals(final Object o) {
                      if (o instanceof JavaScriptContent) {
                          final JavaScriptContent that = (JavaScriptContent) o;
                          return Objects.equals(initialize, that.initialize)
              Severity: Minor
              Found in src/main/java/org/pdf/forms/model/des/JavaScriptContent.java - About 55 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              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,

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

                                    final JLabel eventBoxLabel,
                                    final JLabel scriptLanguageLabel,
                                    final JLabel runAtLabel,
                                    final JSeparator separator,
                                    final JButton saveButton,
                        Severity: Minor
                        Found in src/main/java/org/pdf/forms/gui/editor/JavaScriptEditorPanel.java - About 45 mins to fix

                          Method addWidgets has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private void addWidgets(
                                      final PdfWriter writer,
                                      final List<IWidget> widgets,
                                      final Rectangle pageSize,
                                      final int currentPage,
                          Severity: Minor
                          Found in src/main/java/org/pdf/forms/writer/Writer.java - About 45 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Method addTextField has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                      final int pageHeight,
                                      final int cropHeight,
                                      final int cropX,
                                      final int cropY,
                                      final List<IWidget> widgetsOnPage,
                          Severity: Minor
                          Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 45 mins to fix

                            Method createHorizontalGroup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                        final JLabel eventBoxLabel,
                                        final JLabel scriptLanguageLabel,
                                        final JLabel runAtLabel,
                                        final JSeparator separator,
                                        final JButton saveButton,
                            Severity: Minor
                            Found in src/main/java/org/pdf/forms/gui/editor/JavaScriptEditorPanel.java - About 45 mins to fix

                              Method addListBox has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                          final int pageHeight,
                                          final int cropHeight,
                                          final int cropX,
                                          final int cropY,
                                          final List<IWidget> widgetsOnPage,
                              Severity: Minor
                              Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 45 mins to fix

                                Method decodePDFPage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                            final String pdfPath,
                                            final PdfDecoder pdfDecoder,
                                            final ProgressMonitor progressDialog,
                                            final int pdfPageNumber,
                                            final Page newPage,
                                Severity: Minor
                                Found in src/main/java/org/pdf/forms/gui/commands/PDFImportWorker.java - About 45 mins to fix

                                  Method getId has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private int getId(final Object source) {
                                          logger.info("Action event: {}", source.getClass().getCanonicalName());
                                          if (source instanceof ButtonWithID) {
                                              return ((ButtonWithID) source).getId();
                                          }
                                  Severity: Minor
                                  Found in src/main/java/org/pdf/forms/gui/commands/CommandListener.java - About 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language