Showing 31 of 31 total issues
Function get_icon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_icon(fielddef, state=None):
"""
Return Appropriate mdi-icon_ for `fielddef` at `state`.
.. _mdi-icon: https://materialdesignicons.com/
- 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
Consider simplifying this complex logical expression. Open
if (self.circuit, self.name, self.children) == (msgdef.circuit, msgdef.name, msgdef.children):
return self.replace(
read=self.read or msgdef.read,
prio=self.prio or msgdef.prio,
write=self.write or msgdef.write,
Function __new__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __new__(cls, name, type_, func, unit=None, comment=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __new__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __new__(cls, idx, name, type_, unit=None, comment=None):
Function repr_
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def repr_(obj, args=None, kwargs=None):
"""
Return Python Representation String.
Keyword Args:
- 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 resolve_prio
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def resolve_prio(msgdef, setprio=AUTO):
"""
Resolve priority specification.
Integer values are just passed through.
- 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
Avoid too many return
statements within this function. Open
return None
Function __sub__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __sub__(self, other):
if self.__class__ is other.__class__:
msgdefs = MsgDefs()
othermsgs = tuple(other)
for msgdef in self:
- 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 _split
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _split(line):
values = []
regex = re.compile(r'"(([^"]|"")+)"(,|$)|([^\,]*)(,|$)')
for mat in regex.finditer(line):
groups = mat.groups()
- 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 decodetype
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decodetype(type_):
"""
Decode Type.
>>> decodetype('r')
- 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"