r4fterman/pdf.forms

View on GitHub

Showing 172 of 2,280 total issues

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

    @Override
    public boolean equals(final Object o) {
        if (o instanceof Page) {
            final Page page = (Page) o;
            return Objects.equals(property, page.property)
Severity: Minor
Found in src/main/java/org/pdf/forms/model/des/Page.java - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(final Object o) {
        if (o instanceof ObjectProperties) {
            final ObjectProperties that = (ObjectProperties) o;
            return Objects.equals(field, that.field)
Severity: Minor
Found in src/main/java/org/pdf/forms/model/des/ObjectProperties.java - About 35 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 handleBorder has a Cognitive Complexity of 7 (exceeds 5 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 35 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 addCheckBox has a Cognitive Complexity of 7 (exceeds 5 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 35 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 setParagraphProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void setParagraphProperties(final int currentlyEditing) {
        final SplitComponent textField = (SplitComponent) getBaseComponent();

        if (currentlyEditing == IWidget.COMPONENT_BOTH) {
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java - About 35 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 setFontProperties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public void setFontProperties(final int currentlyEditing) {
        final SplitComponent textField = (SplitComponent) getBaseComponent();

        if (currentlyEditing == IWidget.COMPONENT_BOTH) {
Severity: Minor
Found in src/main/java/org/pdf/forms/widgets/TextFieldWidget.java - About 35 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

Avoid too many return statements within this method.
Open

        return null;
Severity: Major
Found in src/main/java/org/pdf/forms/gui/properties/font/FontPropertiesPanel.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return Commands.NONE;
    Severity: Major
    Found in src/main/java/org/pdf/forms/gui/commands/CommandListener.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return "";

        Method sendToBack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private static void sendToBack(
                    final List<IWidget> allWidgets,
                    final int size,
                    final Set<IWidget> selectedWidgets) {
                final Set<IWidget> newSet = new HashSet<>(Set.copyOf(selectedWidgets));
        Severity: Minor
        Found in src/main/java/org/pdf/forms/widgets/utils/WidgetAlignmentAndOrder.java - About 25 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 updateFont has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static void updateFont(
                    final Set<IWidget> widgets,
                    final String fontName,
                    final String fontSize,
                    final int fontStyle) {
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/properties/PropertyChanger.java - About 25 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 calculateRectangleToDraw has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private Rectangle calculateRectangleToDraw(
                    final Rectangle rectangle,
                    final int componentWidth,
                    final int componentHeight) {
                int x = rectangle.x;
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/designer/gui/DesignerSelectionBox.java - About 25 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 sendBackwards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private void sendBackwards(
                    final List<IWidget> allWidgets,
                    final int size,
                    final Set<IWidget> selectedWidgets) {
                final Set<IWidget> copiedSet = Set.copyOf(selectedWidgets);
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/commands/SendBackwardCommand.java - About 25 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 getPropertyElement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static Optional<Element> getPropertyElement(
                    final Element parentElement,
                    final String propertyName) {
                final NodeList properties = parentElement.getElementsByTagName(ELEMENT_PROPERTY);
                for (int i = 0; i < properties.getLength(); i++) {
        Severity: Minor
        Found in src/main/java/org/pdf/forms/utils/XMLUtils.java - About 25 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 dragOverWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private void dragOverWidget(
                    final DropTargetDragEvent event,
                    final DefaultMutableTreeNode targetNode,
                    final DefaultMutableTreeNode sourceNode,
                    final Object targetUserObject) {
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/hierarchy/tree/CDropTargetListener.java - About 25 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 addBorder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private void addBorder(
                    final IWidget widget,
                    final BaseField baseField) {
                final Widget model = widget.getWidgetModel();
                final Optional<BorderProperties> borderProperties = model.getProperties().getBorder();
        Severity: Minor
        Found in src/main/java/org/pdf/forms/writer/Writer.java - About 25 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 sendBackwards has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private static void sendBackwards(
                    final List<IWidget> allWidgets,
                    final int size,
                    final Set<IWidget> selectedWidgets) {
                final Set<IWidget> newSet = new HashSet<>(Set.copyOf(selectedWidgets));
        Severity: Minor
        Found in src/main/java/org/pdf/forms/widgets/utils/WidgetAlignmentAndOrder.java - About 25 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 dragOver has a Cognitive Complexity of 6 (exceeds 5 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();
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/hierarchy/tree/CDropTargetListener.java - About 25 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 sendToBack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private void sendToBack(
                    final List<IWidget> allWidgets,
                    final int size,
                    final Set<IWidget> selectedWidgets) {
                final Set<IWidget> copiedSet = Set.copyOf(selectedWidgets);
        Severity: Minor
        Found in src/main/java/org/pdf/forms/gui/commands/SendToBackCommand.java - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            public boolean equals(final Object o) {
                if (o instanceof Widget) {
                    final Widget widget = (Widget) o;
                    return Objects.equals(property, widget.property)
        Severity: Minor
        Found in src/main/java/org/pdf/forms/model/des/Widget.java - About 25 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