pointhi/kicad-footprint-generator

View on GitHub

Showing 65 of 257 total issues

Function __padCornerSelection has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    def __padCornerSelection(self, idx_x, idx_y):
        corner = CornerSelection(0)
        if idx_x == 0:
            if idx_y == 0:
                if self.chamfer_selection[ChamferSelPadGrid.TOP_LEFT]:
Severity: Minor
Found in KicadModTree/nodes/specialized/ChamferedPadGrid.py - About 1 day 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 _createPads has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    def _createPads(self, **kwargs):

        pads = []

        x_start, y_start = self.startingPosition
Severity: Minor
Found in KicadModTree/nodes/specialized/PadArray.py - About 7 hrs 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

File geometric_util.py has 458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# KicadModTree is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
Severity: Minor
Found in KicadModTree/util/geometric_util.py - About 7 hrs to fix

    File ExposedPad.py has 457 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    
    # KicadModTree is free software: you can redistribute it and/or
    # modify it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    Severity: Minor
    Found in KicadModTree/nodes/specialized/ExposedPad.py - About 7 hrs to fix

      File RingPad.py has 375 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # KicadModTree is free software: you can redistribute it and/or
      # modify it under the terms of the GNU General Public License as published by
      # the Free Software Foundation, either version 3 of the License, or
      # (at your option) any later version.
      #
      Severity: Minor
      Found in KicadModTree/nodes/specialized/RingPad.py - About 5 hrs to fix

        File Vector.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # KicadModTree is free software: you can redistribute it and/or
        # modify it under the terms of the GNU General Public License as published by
        # the Free Software Foundation, either version 3 of the License, or
        # (at your option) any later version.
        #
        Severity: Minor
        Found in KicadModTree/Vector.py - About 4 hrs to fix

          Function _generatePad has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              def _generatePad(self):
                  if self.chamfer_size[0] >= self.size[0] or self.chamfer_size[1] >= self.size[1]:
                      raise ValueError('Chamfer size ({}) too large for given pad size ({})'.format(self.chamfer_size, self.size))
          
                  is_chamfered = False
          Severity: Minor
          Found in KicadModTree/nodes/specialized/ChamferedPad.py - About 4 hrs 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

          File Pad.py has 319 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # KicadModTree is free software: you can redistribute it and/or
          # modify it under the terms of the GNU General Public License as published by
          # the Free Software Foundation, either version 3 of the License, or
          # (at your option) any later version.
          #
          Severity: Minor
          Found in KicadModTree/nodes/base/Pad.py - About 3 hrs to fix

            Vector2D has 28 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Vector2D(object):
                r"""Representation of a 2D Vector in space
            
                :Example:
            
            
            Severity: Minor
            Found in KicadModTree/Vector.py - About 3 hrs to fix

              Function lispTokenizer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              def lispTokenizer(input):
                  '''
                  Convert a string of characters into a list of tokens.
                  '''
                  input = input.replace('(', ' ( ').replace(')', ' ) ')
              Severity: Minor
              Found in KicadModTree/util/kicad_util.py - About 3 hrs 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

              File ChamferedPad.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # KicadModTree is free software: you can redistribute it and/or
              # modify it under the terms of the GNU General Public License as published by
              # the Free Software Foundation, either version 3 of the License, or
              # (at your option) any later version.
              #
              Severity: Minor
              Found in KicadModTree/nodes/specialized/ChamferedPad.py - About 3 hrs to fix

                Function __init__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, coordinates=None, y=None, z=None):
                        # we don't need a super constructor here
                
                        # parse constructor
                        if coordinates is None:
                Severity: Minor
                Found in KicadModTree/Vector.py - About 2 hrs 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

                File ChamferedPadGrid.py has 288 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # KicadModTree is free software: you can redistribute it and/or
                # modify it under the terms of the GNU General Public License as published by
                # the Free Software Foundation, either version 3 of the License, or
                # (at your option) any later version.
                #
                Severity: Minor
                Found in KicadModTree/nodes/specialized/ChamferedPadGrid.py - About 2 hrs to fix

                  Vector3D has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Vector3D(Vector2D):
                      r"""Representation of a 3D Vector in space
                  
                      :Example:
                  
                  
                  Severity: Minor
                  Found in KicadModTree/Vector.py - About 2 hrs to fix

                    Function _initFromCenterAndEnd has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _initFromCenterAndEnd(self, **kwargs):
                            self.center_pos = Vector2D(kwargs['center'])
                            if 'start' in kwargs:
                                self.start_pos = Vector2D(kwargs['start'])
                                sp_r, sp_a = self.start_pos.to_polar(
                    Severity: Minor
                    Found in KicadModTree/util/geometric_util.py - About 2 hrs 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

                    File KicadFileHandler.py has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # KicadModTree is free software: you can redistribute it and/or
                    # modify it under the terms of the GNU General Public License as published by
                    # the Free Software Foundation, either version 3 of the License, or
                    # (at your option) any later version.
                    #
                    Severity: Minor
                    Found in KicadModTree/KicadFileHandler.py - About 2 hrs to fix

                      Pad has 22 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Pad(Node):
                          r"""Add a Pad to the render tree
                      
                          :param \**kwargs:
                              See below
                      Severity: Minor
                      Found in KicadModTree/nodes/base/Pad.py - About 2 hrs to fix

                        geometricArc has 22 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class geometricArc():
                            r""" Handle the geometric side of arcs
                        
                            :params:
                                * *center* (``Vector2D``) --
                        Severity: Minor
                        Found in KicadModTree/util/geometric_util.py - About 2 hrs to fix

                          Function _serialize_CustomPadPrimitives has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _serialize_CustomPadPrimitives(self, pad):
                                  all_primitives = []
                                  for p in pad.primitives:
                                      all_primitives.extend(p.serialize())
                          
                          
                          Severity: Minor
                          Found in KicadModTree/KicadFileHandler.py - About 2 hrs 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 getOptionalNumberTypeParam has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def getOptionalNumberTypeParam(
                                  kwargs, param_name, default_value=None,
                                  low_limit=None, high_limit=None, allow_equal_limit=True):
                              r""" Get a named parameter from packed dict and guarantee it is a number (float or int)
                          
                          
                          Severity: Minor
                          Found in KicadModTree/util/paramUtil.py - About 2 hrs 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