Showing 48 of 169 total issues
Function DictDiff
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def DictDiff(a, b):
"""Compares two dictionaries. Intended to be used in a test to
compare the actual return value from some function with a
known-good value.
- 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 parseTagBlock
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parseTagBlock(line):
if not line.startswith("\\"):
return {}, line
tagblock, line = line[1:].split("\\", 1)
tagblock, checksum = tagblock.rsplit("*", 1)
- 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 normalize
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def normalize(nmea=sys.stdin,
Function testManySingleLineVdms
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def testManySingleLineVdms(self):
# Pass a series of independent one line messages through a queue.
# All of these lines should be decoded. The only interaction
# between messages is that the line number is incremented.
# Only do spot checks on the results.
Function put
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put(self, line, line_num=None):
if line_num is not None:
self.line_num = line_num
else:
self.line_num += 1
Function ErrorPrinter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ErrorPrinter(e,
Function decode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def decode(nmea=sys.stdin,
errorcb=ErrorPrinter,
keep_nmea=False,
stats=None,
**kw):
- 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 deeply nested control flow statements. Open
if err is not None:
sys.stdout.write("Field `%s' failed: %s" % (field, json.dumps(msg) + os.linesep))
return_val = False
Function put
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def put(self, line, line_num=None):
"""Add a line to the queue.
Args:
line: str, Text to add to the queue.
- 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 decode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def decode(nmea=sys.stdin,
Function HandleGga
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def HandleGga(line):
try:
fields = GGA_RE.match(line).groupdict()
except TypeError:
return
- 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 open
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def open(name, mode='r', **kwargs):
"""Open a file containing NMEA and instantiate an instance of `NmeaFile()`.
Like Python's `open()`, set the `mode` parameter to 'r' for normal reading or
or 'rU' for opening the file in universal newline mode.
- 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 mangle__eta_day
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def mangle__eta_day(self, res, msg):
if msg['eta_month'] < 1 or msg['eta_day'] == 0 or msg['eta_hour'] == 24:
return
if msg['eta_minute'] == 60:
return
- 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 LineType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def LineType(line):
"""Give the type of NMEA line this is.
Args:
line: str, Text to try to interpret.
- 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
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return TEXT
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return