r4fterman/pdf.forms

View on GitHub

Showing 172 of 2,280 total issues

Method dropData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean dropData(
            final JComponent srcComponent,
            final Transferable transferable,
            final DataFlavor[] flavors) {
        // Ok, now try to display the content of the drop.
Severity: Minor
Found in src/main/java/org/pdf/forms/gui/DefaultTransferHandler.java - About 1 hr 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 handleButtonGroups has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

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

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

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

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

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

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

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

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

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

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

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

                public void drawMulitipleSelectionBox(
                        final Graphics2D g2,
                        final Set<IWidget> selectedWidgets,
                        final boolean drawNodes) {
            
            
            Severity: Minor
            Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java - About 1 hr to fix

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

                  private void initComponents() {
                      final JPanel panel = createBordersPanel();
                      final JPanel backgroundPanel = createBackgroundPanel();
              
                      final GroupLayout layout = new GroupLayout(this);

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

                    @Override
                    public PdfFormField write(
                            final IWidget widget,
                            final Rectangle pageSize,
                            final int currentPage,
                Severity: Minor
                Found in src/main/java/org/pdf/forms/writer/PdfListBoxWriter.java - About 1 hr to fix

                  Method getResizeType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public int getResizeType(
                              final int mouseX,
                              final int mouseY,
                              final Set<IWidget> selectedWidgets) {
                          if (selectionBoxBounds == null || selectedWidgets.isEmpty()) {
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/widgets/utils/WidgetSelection.java - About 1 hr 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 openFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void openFile(
                              final String filePath,
                              final Component component) {
                          if (filePath == null) {
                              return;
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/gui/DefaultTransferHandler.java - About 1 hr 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 dropData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private boolean dropData(
                              final JComponent srcComponent,
                              final Transferable transferable,
                              final DataFlavor[] flavors) {
                          // Ok, now try to display the content of the drop.
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/gui/DefaultTransferHandler.java - About 1 hr to fix

                    Method setupDockingPanes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void setupDockingPanes() {
                            desk.addDockable(designerPanel);
                            dockableNames.put("Designer", designerPanel);
                    
                            final WindowConfiguration windowConfiguration = windowConfigurationFile.getWindowConfiguration();
                    Severity: Minor
                    Found in src/main/java/org/pdf/forms/gui/VLFrame.java - About 1 hr to fix

                      Method executeCommand has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @Override
                          public void executeCommand(final int type) {
                              switch (type) {
                                  case FIRSTPAGE:
                                      designer.displayPreviewPage(1);

                        Method executeCommand has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            public void executeCommand(final int type) {
                                switch (type) {
                                    case FIRSTPAGE:
                                        designer.displayDesignerPage(1);

                          Method writeExternalPDFPagesToPDF has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void writeExternalPDFPagesToPDF(
                                      final File fileToWriteTo,
                                      final Map<Integer, List<IWidget>> widgetsByPageNumber,
                                      final List<org.pdf.forms.model.des.Page> pages,
                                      final Optional<String> javaScript,
                          Severity: Minor
                          Found in src/main/java/org/pdf/forms/writer/Writer.java - About 1 hr to fix

                            Method setVerticalAlignment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @Override
                                public void setVerticalAlignment(final int alignment) {
                                    if (alignment == SwingConstants.CENTER) {
                                        setUI(new BasicTextFieldUI());
                                        return;
                            Severity: Minor
                            Found in src/main/java/org/pdf/forms/widgets/components/PdfTextField.java - About 1 hr to fix

                              Method writeModelToPDF has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private void writeModelToPDF(
                                          final File fileToWriteTo,
                                          final Map<Integer, List<IWidget>> widgetsByPageNumber,
                                          final List<org.pdf.forms.model.des.Page> pages,
                                          final Optional<String> javaScript) {
                              Severity: Minor
                              Found in src/main/java/org/pdf/forms/writer/Writer.java - About 1 hr to fix

                                Method addCheckBox has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private void addCheckBox(
                                            final FormObject formObject,
                                            final Page page,
                                            final String groupName,
                                            final int pageHeight,
                                Severity: Minor
                                Found in src/main/java/org/pdf/forms/widgets/utils/WidgetParser.java - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language