Showing 17 of 83 total issues
File CPU12.py
has 1477 lines of code (exceeds 250 allowed). Consider refactoring. Open
##!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__="0.1.0"
Function disasm
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def disasm(addr, memory):
decoder = PostbyteDecoder()
pc = addr
op = memory.getByte(pc)
mnemonic, _, mode, size = opcodeMapPage1.get(op)
- 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
BDMBase
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
class BDMBase(object):
""" .. class:: BDM
BDM Communication base class.
"""
Function dis2
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def dis2(addressFrom, addressTo, memory):
pc = addressFrom
while pc <= addressTo:
operand = ''
deco = preDecode(pc, memory)
- 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 probeHC12
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def probeHC12(port):
couldBeDG128 = False
port.logger.info("Probing for HC12 derivate.")
initRM, initRE, misc = port.readByte(INITRM), port.readByte(INITRE), port.readByte(MISC)
- 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 bdm.py
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "0.1.0"
Function write
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def write(self, data):
startTime = 0
timeSpan = 0
waitCTSToClearTimeout = self.ctsRtsControl and 0.100 or 0.02
- 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 pybdm_hexdump.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Function decodeMove
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def decodeMove(deco):
operand = ""
mode = deco.mode
bytes_ = deco.byte_
if 0x08 <= deco.opcode <= 0x0d: # MOVB
- 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 testFormatParser
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
- 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 main
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Function decode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def decode(cls, postbyte):
if postbyte in cls.cache:
return cls.cache.get(postbyte)
else:
for decoding, masks in cls.DECODINGs:
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, opcode, mnemonic, mode, totalSize, page2, bytes_, rawBytes):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, num, baudrate, bytesize = serial.EIGHTBITS, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE,
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, port):
self._port = port
self.logger = Logger()
if hasattr(self, '__REGISTERS8__'):
for name, reg in self.__REGISTERS8__:
- 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 preDecode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def preDecode(addr, mem):
"""Figures out the total length of bytes following."""
decoder = PostbyteDecoder()
if mem.getByte(addr + 0) == PAGE2:
- 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 parseFormat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
- 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"