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]:
- Read upRead up
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
- Read upRead up
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.
#
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
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.
#
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.
#
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
- Read upRead up
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.
#
Vector2D
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Vector2D(object):
r"""Representation of a 2D Vector in space
:Example:
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(')', ' ) ')
- Read upRead up
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.
#
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:
- Read upRead up
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.
#
Vector3D
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Vector3D(Vector2D):
r"""Representation of a 3D Vector in space
:Example:
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(
- Read upRead up
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.
#
geometricArc
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class geometricArc():
r""" Handle the geometric side of arcs
:params:
* *center* (``Vector2D``) --
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
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)
- Read upRead up
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 _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())
- Read upRead up
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"