Showing 111 of 152 total issues
Function get_process_statistics
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def get_process_statistics(
p_user_map,
p_process_infos,
p_reference_time,
p_max_lookback_in_days,
- 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 app_control.py
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019-2021 Marcus Rickert
#
# See https://github.com/marcus67/little_brother
Function prepare_services
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def prepare_services(self, p_full_startup=True):
super().prepare_services(p_full_startup=p_full_startup)
# TODO: Activate in memory sqlite backend for clients
- 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 scan_processes
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def scan_processes(self, p_session_context, p_reference_time, p_server_group, p_login_mapping, p_host_name,
p_process_regex_map, p_prohibited_process_regex_map):
events = []
- 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
AppControl
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class AppControl(PersistenceDependencyInjectionMixIn):
def __init__(self, p_config,
p_debug_mode,
p_process_handlers=None,
File app.py
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019-2022 Marcus Rickert
#
# See https://github.com/marcus67/little_brother
File process_handler_manager.py
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019-2021 Marcus Rickert
#
# See https://github.com/marcus67/little_brother
Function retrieve_user_mappings
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_user_mappings(self, p_session_context: SessionContext):
if len(self._usernames_not_found) > 0:
usernames_found = []
- 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 scan_processes
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def scan_processes(self, p_session_context, p_reference_time, p_server_group, p_login_mapping, p_host_name,
p_process_regex_map, p_prohibited_process_regex_map):
current_processes = {}
events = []
- 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 rule_handler.py
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Marcus Rickert
#
# See https://github.com/marcus67/little_brother
ProcessHandlerManager
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ProcessHandlerManager(PersistenceDependencyInjectionMixIn):
def __init__(self,
p_config,
p_is_master,
File process_statistics.py
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019 Marcus Rickert
#
# See https://github.com/marcus67/little_brother
Function set_metrics
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def set_metrics(self):
with SessionContext(p_persistence=self.persistence) as session_context:
if self.prometheus_client is not None:
self.prometheus_client.set_uptime(p_hostname="master", p_uptime=time.time() - self._start_time)
- 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 handle_rule_result_info
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def handle_rule_result_info(self, p_rule_result_info, p_stat_info, p_user):
if p_rule_result_info.activity_allowed():
self.check_issue_logout_warning(p_username=p_user.username, p_rule_result_info=p_rule_result_info)
- 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 process_rule_sets_for_all_users
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def process_rule_sets_for_all_users(self, p_reference_time):
fmt = "Processing rules for all users START..."
self._logger.debug(fmt)
- 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 migrate_ruleset_configs
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def migrate_ruleset_configs(self, p_ruleset_configs):
session = self._persistence.get_session()
for username, configs in p_ruleset_configs.items():
- 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 check_device_activation_status
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def check_device_activation_status(self, p_force_usage_permitted=False):
with SessionContext(p_persistence=self.persistence) as session_context:
for device in self.device_entity_manager.devices(p_session_context=session_context):
usage_permitted = True
set_status = tools.is_valid_ip_address_or_dns_name(device.hostname)
- 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 retrieve_version_infos
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_version_infos(self):
if self._config.check_interval_in_days == 0:
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"
Further reading
ApiViewHandler
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ApiViewHandler(PersistenceDependencyInjectionMixIn):
def __init__(self, p_app):
super().__init__()
Function prepare_services
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def prepare_services(self, p_full_startup=True):
super().prepare_services(p_full_startup=p_full_startup)
# TODO: Activate in memory sqlite backend for clients