Showing 7 of 9 total issues
Function update_status
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
Open
def update_status(self):
self._logger.debug("update_status")
if self._status_frame is 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 __init__
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def __init__(self, *args, **kwds):
# begin wxGlade: ConfigurationDialog.__init__
self._ = kwds.get("p_gettext", lambda x:x)
del(kwds["p_gettext"])
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
File taskbar_app.py
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
# Copyright (C) 2019-2022 Marcus Rickert
#
# See https://github.com/marcus67/little_brother_taskbar
Avoid deeply nested control flow statements. Open
Open
if user_status.minutes_left_in_session <= self._app_config.warning_minutes_approaching_logout:
color = self._color_approaching_logout
color_foreground = self._color_approaching_logout_foreground
if self._app_config.show_window_when_approaching_logout:
Function redraw_text
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def redraw_text(self, text:str, small_text:str, font_size:int, color:Colour,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, p_config, p_status_frame, p_base_app, p_gettext, p_configuration_model):
Function prepare_services
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def prepare_services(self, p_full_startup=True):
config = self._config[audio_handler.SECTION_NAME]
if self._arguments.speech_engine is not 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"