r4fterman/pdf.forms

View on GitHub

Showing 172 of 2,280 total issues

WidgetFactory has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

public class WidgetFactory {

    private static final JFrame FRAME = new JFrame();

    public static JLabel createResizedComponent(
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/utils/WidgetFactory.java - About 2 hrs to fix

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

        private void initComponents() {
            final JComboBox<String> appearanceBox = new JComboBox<>(APPEARANCES);
            appearanceBox.setEnabled(false);
    
            final JLabel appearanceLabel = new JLabel("Appearance:");

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

          private void initComponents() {
              final JComboBox<String> appearanceBox = new JComboBox<>(APPEARANCES);
              appearanceBox.setEnabled(false);
      
              final JLabel appearanceLabel = new JLabel("Appearance:");

        WidgetAlignmentAndOrder has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public final class WidgetAlignmentAndOrder {
        
            public static final String ALIGN_LEFT = "Align Left";
            public static final String ALIGN_RIGHT = "Align Right";
            public static final String ALIGN_TOP = "Align Top";

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

              private void initComponents() {
                  addComponentListener(new ComponentAdapter() {
                      @Override
                      public void componentShown(final ComponentEvent evt) {
                          shown();

            File WidgetAlignmentAndOrder.java has 255 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package org.pdf.forms.widgets.utils;
            
            import java.awt.*;
            import java.util.HashSet;
            import java.util.List;

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

                  private void initComponents() {
                      final JLabel label = new JLabel("Radio Button Groups");
              
                      buttonGroupsList = new JList<>();
                      buttonGroupsList.setModel(new DefaultListModel<>());

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

                    private void initComponents() {
                        final JLabel label = new JLabel("CheckBox Button Groups");
                
                        buttonGroupsList = new JList<>(new DefaultListModel<>());
                
                

                  Method writeJavaScript has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void writeJavaScript(
                              final PdfWriter writer,
                              final Rectangle pageSize,
                              final int currentPage,
                              final GlobalPdfWriter globalPdfWriter,
                  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 initializePanel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void initializePanel() {
                          final org.jdesktop.layout.GroupLayout groupLayout = new org.jdesktop.layout.GroupLayout(this);
                          setLayout(groupLayout);
                          setBorder(BorderFactory.createTitledBorder("Margins"));
                  
                  
                  Severity: Minor
                  Found in src/main/java/org/pdf/forms/gui/properties/layout/MarginPanel.java - About 1 hr to fix

                    Method writeOutCaption has 43 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/Writer.java - About 1 hr to fix

                      Method writeOutCaption has 42 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/PdfListBoxWriter.java - About 1 hr to fix

                        Method createBackgroundPanel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private JPanel createBackgroundPanel() {
                                final JPanel panel = new JPanel();
                                panel.setBorder(BorderFactory.createTitledBorder("Background Fill"));
                        
                                final JLabel styleLabel = new JLabel("Style:");

                          Method dragGestureRecognized has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @Override
                              public void dragGestureRecognized(final DragGestureEvent event) {
                                  final Point ptDragOrigin = event.getDragOrigin();
                                  final TreePath path = getPathForLocation(ptDragOrigin.x, ptDragOrigin.y);
                                  if (path == null) {
                          Severity: Minor
                          Found in src/main/java/org/pdf/forms/gui/hierarchy/tree/CTree.java - About 1 hr to fix

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

                                private void initComponents() {
                                    final JLabel nameLabel = new JLabel("Name:");
                            
                                    nameField = new JTextField();
                                    nameField.addFocusListener(new FocusAdapter() {

                              Method writeJavaScript has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private void writeJavaScript(
                                          final PdfWriter writer,
                                          final Rectangle pageSize,
                                          final int currentPage,
                                          final GlobalPdfWriter globalPdfWriter,
                              Severity: Minor
                              Found in src/main/java/org/pdf/forms/writer/Writer.java - About 1 hr to fix

                                Method dragOver has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    @Override
                                    public void dragOver(final DropTargetDragEvent event) {
                                        // This is where the ghost image is drawn.
                                        // Even if the mouse is not moving, this method is still invoked 10 times per second
                                        final Point point = event.getLocation();

                                  Method setFontProperties has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected void setFontProperties(final IPdfComponent component) {
                                          final Optional<FontProperties> font = getWidgetModel().getProperties().getFont();
                                          if (font.isEmpty()) {
                                              return;
                                          }
                                  Severity: Minor
                                  Found in src/main/java/org/pdf/forms/widgets/Widget.java - About 1 hr to fix

                                    Method initializeWindow has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private ToolBarContainer initializeWindow(
                                                final Rule horizontalRuler,
                                                final Rule verticalRuler,
                                                final FontHandler fontHandler) {
                                            addWindowListener(new FrameCloser());
                                    Severity: Minor
                                    Found in src/main/java/org/pdf/forms/gui/VLFrame.java - About 1 hr to fix

                                      Method handleButtonGroups has 37 lines of code (exceeds 25 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language