Showing 100 of 4,610 total issues
Function get_list
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_list(self, section, key, default = [], separator = ',', log = True, store_if_not_exists = True):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, input_pins, keyboard_name, conf_pre, conf_post, *args, **kwargs):
Function get_boolean
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_boolean(self, section, key, default = False, log = True, store_if_not_exists = True):
Function get_integer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_integer(self, section, key, default = -1, log = True, store_if_not_exists = True):
Function insert_event_log
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_event_log(self, event_id, fired_by, event_name, start_time, additional_infos):
Function rename_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rename_key(self, section, old_key, new_key, default = '', log = True):
Function out_triggered
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def out_triggered(pin, start_value, end_value, timeout, stop_pin):
Function set_value
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_value(self, section, key, value, log = True, password = False):
Function get_float
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_float(self, section, key, default = -1, log = True, store_if_not_exists = True):
Function get_from_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_from_config(self, config, log = True):
if log: logger.trace("get_from_config")
for section in config.sections():
self.__sections[section] = {}
for key, value in config.items(section):
- 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 events_by_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def events_by_source(self):
events_by_source = {}
for event in self.events:
for source in self.events[event]:
if source in events_by_source:
- 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 is_admin_number
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def is_admin_number(self, remote_uri):
logger.debug("is_admin_number (%s)",remote_uri)
for admin_number in self.whitelist:
if admin_number == "*":
logger.info("admin numbers are deactivated by using '*' as single number")
- 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 create_virtual_resource
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_virtual_resource(self, path, raw_parameters):
return_object = {}
try:
if path.path == '/mirror':
return_object = self.create_mirror()
- 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_modified
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_modified(self, event):
if 'FileModifiedEvent' not in str(event): return
if self.__reset_file:
if self.__reset_file == event.src_path:
self.__reset_file = None
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run(self, silent_mode = False):
if not silent_mode:
logger.trace('run %s with args %s and kwargs %s',
self.__class__.__name__,
self.__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 main_as_daemon
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def main_as_daemon(argv):
if argv[1] is 'reload':
print('not implemeted yet - use restart instead')
return 1
if argv[1] in ['stop']:
- 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 register_action
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def register_action(self, event_name, action_object, *args, **kwargs):
if ismethod(action_object) and callable(action_object):
action_object = SingleAction(action_object, *args, **kwargs)
elif isfunction(action_object) and callable(action_object):
action_object = SingleAction(action_object, *args, **kwargs)
- 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_incoming_call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def on_incoming_call(self, call):
# SIP-Status-Codes: http://de.wikipedia.org/wiki/SIP-Status-Codes
# 200 = OK
# 401 = Unauthorized
# 403 = Forbidden
- 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
else: return self.real_resource(parsed_path.path)
Avoid too many return
statements within this function. Open
return "no actions for this event"