Showing 111 of 152 total issues
Avoid deeply nested control flow statements. Open
Open
if not unix_user_handler_config.is_active():
unix_user_handler_config.admin_username = status_server_config.admin_username
unix_user_handler_config.admin_password = status_server_config.admin_password
Avoid deeply nested control flow statements. Open
Open
for device in devices:
if request.form['submit'] == device.delete_html_key:
self.device_entity_manager.delete_device(
p_session_context=session_context, p_id=device.id)
Avoid deeply nested control flow statements. Open
Open
if self.prometheus_client is not None:
self.prometheus_client.count_forced_logouts(p_username=p_user.username)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, p_version=None, p_revision=None, p_python_version=None,
Function queue_event
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def queue_event(self, p_event, p_to_master=False, p_is_action=False):
if p_is_action:
if p_event.hostname == self._host_name:
self.queue_event_locally(p_event=p_event)
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, p_username, p_reference_time, p_max_lookback_in_days, p_min_activity_duration,
Avoid deeply nested control flow statements. Open
Open
if (pinfo.processname is None or
(pinfo.processname is not None and user.regex_process_name_pattern.match(
pinfo.processname))):
stat_info = user_stat_infos.get(ruleset.context)
Avoid deeply nested control flow statements. Open
Open
if pinfo.end_time is not None:
event = self.create_admin_event_process_start_from_pinfo(p_pinfo=pinfo)
events.append(event)
Avoid deeply nested control flow statements. Open
Open
if current_pinfo is not None:
event = self.create_admin_event_process_end_from_pinfo(
p_pinfo=current_pinfo,
p_reference_time=p_reference_time)
events.append(event)
Avoid deeply nested control flow statements. Open
Open
if current_pinfo is None:
event = admin_event.AdminEvent(
p_event_type=admin_event.EVENT_TYPE_PROCESS_START,
p_hostname=device_info.hostname,
p_hostlabel=device_info.device_name,
Function set_time_extension_for_session
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_time_extension_for_session(self, p_session_context, p_user_name, p_delta, p_session_active,
Function get_admin_info_for_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_admin_info_for_user(self, p_session_context, p_user_infos, p_time_extensions, p_days, p_username):
Function get_process_statistics
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_process_statistics(
Function set_time_extension
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_time_extension(cls, p_session_context, p_username, p_reference_datetime, p_start_datetime, p_time_delta):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, p_is_master, p_host_name, p_client_stats: ClientStats, p_maximum_client_ping_interval=None,
Function get_user_info_for_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_user_info_for_user(self, p_session_context, p_user, p_reference_time,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, p_device_name, p_max_active_ping_delay, p_min_activity_duration, p_sample_size,
Function set_time_extension_for_admin_info_and_session
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def set_time_extension_for_admin_info_and_session(self, p_session_context, p_user_name, p_delta, p_admin_info,
Function read_forward_entries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def read_forward_entries(self):
if self._entries is not None and self._last_table_scan is not None:
if datetime.datetime.now() < self._last_table_scan + datetime.timedelta(seconds=self._config.cache_ttl):
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"