fossasia/knittingpattern

View on GitHub

Showing 33 of 166 total issues

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, knittingpattern, layout, instruction_to_svg, builder,
Severity: Minor
Found in knittingpattern/convert/KnittingPatternToSVG.py - About 35 mins to fix

    Function test_remove_a_connection has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def test_remove_a_connection(row1, row2, mesh11p, mesh21c, disconnect):
    Severity: Minor
    Found in knittingpattern/test/test_change_row_mapping.py - About 35 mins to fix

      Function place_svg_use_coords has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def place_svg_use_coords(self, x, y, symbol_id, layer_id, group=None):
      Severity: Minor
      Found in knittingpattern/convert/SVGBuilder.py - About 35 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, min_x, min_y, max_x, max_y,
        Severity: Minor
        Found in knittingpattern/convert/AYABPNGBuilder.py - About 35 mins to fix

          Function test_create_new_connection has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def test_create_new_connection(mesh31p, mesh12c, connect, row1, row3):
          Severity: Minor
          Found in knittingpattern/test/test_change_row_mapping.py - About 35 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, type_, version, patterns, parser, comment=None):
            Severity: Minor
            Found in knittingpattern/KnittingPatternSet.py - About 35 mins to fix

              Function assert_row has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def assert_row(row, first_consumed, last_consumed, first_produced,
              Severity: Minor
              Found in knittingpattern/test/test_row_meshes.py - About 35 mins to fix

                Function _make_definition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _make_definition(self, svg_dict, instruction_id):
                        """Create a symbol out of the supplied :paramref:`svg_dict`.
                
                        :param dict svg_dict: dictionary containing the SVG for the
                          instruction currently processed
                Severity: Minor
                Found in knittingpattern/convert/KnittingPatternToSVG.py - 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

                Function _instructions_changed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _instructions_changed(self, change):
                        """Call when there is a change in the instructions."""
                        if change.adds():
                            for index, instruction in change.items():
                                if isinstance(instruction, dict):
                Severity: Minor
                Found in knittingpattern/Row.py - 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

                Function _relative_to_absolute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _relative_to_absolute(self, module_location, folder):
                        """:return: the absolute path for the `folder` relative to
                        the module_location.
                        :rtype: str
                        """
                Severity: Minor
                Found in knittingpattern/Loader.py - 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

                Function folder has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def folder(self, folder):
                        """Load all files from a folder recursively.
                
                        Depending on :meth:`chooses_path` some paths may not be loaded.
                        Every loaded path is processed and returned part of the returned list.
                Severity: Minor
                Found in knittingpattern/Loader.py - 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

                Function rows_before has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def rows_before(self):
                        """The rows that produce meshes for this row.
                
                        :rtype: list
                        :return: a list of rows that produce meshes for this row. Each row
                Severity: Minor
                Found in knittingpattern/Row.py - 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

                Function rows_after has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def rows_after(self):
                        """The rows that consume meshes from this row.
                
                        :rtype: list
                        :return: a list of rows that consume meshes from this row. Each row
                Severity: Minor
                Found in knittingpattern/Row.py - 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