Showing 48 of 169 total issues
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return TAGB
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return
Function checksumStr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def checksumStr(data):
"""Take a NMEA 0183 string and compute the checksum.
@param data: NMEA message. Leading ?/! and training checksum are optional
@type data: str
@return: hexadecimal 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 test_all_types
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_all_types(self):
for msg_type, msg_fields in MSG_TYPE_FIELDS.items():
# Check type field individually since the other tests force it to be correct
assert not validate_messages([{'field': 'val'}])
- 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 Parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def Parse(data):
"""Unpack a TAG Block line or return None.
Makes sure that the line matches the regex and the checksum matches.
- 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 __call__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, msg):
res = {}
self.mangle(res, msg)
method = 'mangle__%s' % (msg['id'],)
if hasattr(self, method):
- 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"