Showing 111 of 152 total issues
Function get_current_active_pinfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_current_active_pinfo(self, p_hostname, p_username):
max_start_time = None
most_recent_pinfo = 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 build_url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_url(self):
if self._config.database_driver != persistence_base.DATABASE_DRIVER_SQLITE:
if self._config.database_user is None:
raise configuration.ConfigurationException("No database user configured!")
- 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 pick_text_for_ruleset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pick_text_for_ruleset(self, p_rule_result_info):
t = gettext.translation('messages', localedir=self._locale_dir,
languages=[p_rule_result_info.locale], fallback=True)
- 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 update_active_entries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_active_entries(self, p_ip_address: str, p_blocked_ip_addresses: List[str],
p_forward_entries: Dict[str, FirewallEntry], p_comment: str):
# Use the devices blocked ip addresses if they defined else use the globally defined addresses
effective_list_of_ip_addresses = self._config.target_ip \
- 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 request_time_extension
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request_time_extension(self, p_session_context: SessionContext, p_user: User,
p_time_extension_length: int, p_reference_date: datetime.date=None):
optional_time_available= self.get_optional_time_available_in_minutes(p_session_context=p_session_context,
p_user=p_user, p_reference_date=p_reference_date)
- 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_client_device_configs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def migrate_client_device_configs(self, p_client_device_configs, persistent_user2device=None):
session = self._persistence.get_session()
for device_name, old_device in p_client_device_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 get_user_status_infos
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_user_status_infos(self, p_session_context, p_process_infos, p_include_history=True):
user_infos = {}
reference_time = datetime.datetime.now()
- 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 format_text_array
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def format_text_array(self, value):
text = ""
for part in 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 get_day_info_for_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_day_info_for_user(self, p_admin_info, p_username: str,
p_reference_date: datetime.datetime, p_rule_set) -> view_info.ViewInfo:
if p_rule_set is not None:
key_rule_override = rule_override.get_key(p_username=p_username,
- 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 save_for_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_for_user(self, p_forms, p_session_context, p_user):
changed = False
form = p_forms[p_user.html_key]
a_persistent_user = self.user_entity_manager.get_by_username(
- 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
return self.invalid_secret_error()
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return t.gettext(self.text_need_break).format(**p_rule_result_info.args)
Avoid too many return
statements within this function. Open
return t.gettext(self.text_min_break).format(**p_rule_result_info.args)
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return self.wrong_parameter_format_error(p_parameter_name=constants.API_URL_PARAM_EXTENSION_LENGTH,
Avoid too many return
statements within this function. Open
return self.request_time_extension(p_session_context=session_context, p_user=user,
Function get_current_rule_result_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_current_rule_result_info(self, p_reference_time, p_process_infos, p_username):
rule_result_info = None
with SessionContext(p_persistence=self.persistence) as session_context:
- 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_regex_map
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_regex_map(self):
with SessionContext(p_persistence=self.persistence) as session_context:
if self._process_regex_map is None:
self._process_regex_map = {}
- 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_optional_time_available_in_minutes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_optional_time_available_in_minutes(self, p_session_context: SessionContext, p_user: User,
p_reference_date: datetime.date=None):
if p_reference_date is None:
p_reference_date = datetime.date.today()
- 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"