Showing 124 of 4,610 total issues
Avoid too many return
statements within this function. Open
try: return self.return_message(repr(prepared_object))
Avoid too many return
statements within this function. Open
except: return self.return_message(str(prepared_object))
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return self.return_message(prepared_object, 'text/html; charset=utf-8')
Avoid too many return
statements within this function. Open
return self.return_message(repr(prepared_object))
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return self.return_message(str(prepared_object))
Avoid too many return
statements within this function. Open
return False
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
logger.debug("run")
if not self.__prepared: self.prepare(self.__parsed_arguments)
self.event_handler.fire_event('BeforeStartup', __name__)
- 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 event_detect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def event_detect(self, pin):
if self.status_input(pin):
self._fire_OnKeyDown(pin, __name__)
if self._pressed_on_key_down: # issue 134
self._fire_OnKeyPressed(pin, __name__)
- 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 sound_devices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sound_devices(self):
try:
all_devices = []
for sound_device in self.lib.enum_snd_dev():
all_devices.append({
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, input_pins, output_pins, conf_pre, conf_post, keyboard_name, polarity = 0, *args, **kwargs):
logger.debug("FileSystem.__init__(input_pins = %s, output_pins = %s, polarity = %s)",
input_pins, output_pins, polarity)
self.keyboard_name = keyboard_name
self._polarity = polarity
- 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 event_detect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def event_detect(self, event):
if self.status_input(event.pin_num):
self._fire_OnKeyDown(event.pin_num, __name__)
if self._pressed_on_key_down: # issue 134
self._fire_OnKeyPressed(event.pin_num, __name__)
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(*args, **kwargs):
files = dict()
try:
if len(kwargs['name']) == 0: kwargs['name'] = ['']
if len(kwargs['value']) == 0: kwargs['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 list_directory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def list_directory(self, path):
dirs = []
files = []
for item in os.listdir(path):
if os.path.isfile(item): files.append(item)
- 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 set_output
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_output(self, pin, value, log_output = True):
if self._ser and self._ser.isOpen():
if log_output: logger.debug('try to write %s to serial usb plain', pin)
self._ser.flushOutput()
self._ser.write(pin + self._output_stop_flag)
- 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 delete_section
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_section(self, section, delete_empty_only = True, log = True):
if section in self.__sections and len(self.__sections[section]) > 0 and delete_empty_only:
logger.warning("could not delete section %s, because it's not empty.", section)
return 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
Function on_state
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_state(self):
logger.debug("on_state (%s)", self.call.info().state_text)
DoorPi().event_handler('OnCallStateChange', __name__, {
'remote_uri': self.call.info().remote_uri,
'state': self.call.info().state_text
- 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"