marcus67/little_brother_taskbar

View on GitHub

Showing 7 of 9 total issues

Function update_status has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

    def update_status(self):

        self._logger.debug("update_status")

        if self._status_frame is None:
Severity: Minor
Found in little_brother_taskbar/taskbar_app.py - About 1 day to fix

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

    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
Severity: Major
Found in little_brother_taskbar/configuration_dialog_wxglade.py - About 4 hrs to fix

    File taskbar_app.py has 302 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_taskbar
    Severity: Minor
    Found in little_brother_taskbar/taskbar_app.py - About 3 hrs to fix

      Avoid deeply nested control flow statements.
      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:
      Severity: Major
      Found in little_brother_taskbar/taskbar_app.py - About 45 mins to fix

        Function redraw_text has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def redraw_text(self, text:str, small_text:str, font_size:int, color:Colour,
        Severity: Minor
        Found in little_brother_taskbar/status_frame.py - About 35 mins to fix

          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, p_config, p_status_frame, p_base_app, p_gettext, p_configuration_model):
          Severity: Minor
          Found in little_brother_taskbar/taskbar.py - About 35 mins to fix

            Function prepare_services has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def prepare_services(self, p_full_startup=True):
            
                    config = self._config[audio_handler.SECTION_NAME]
            
                    if self._arguments.speech_engine is not None:
            Severity: Minor
            Found in little_brother_taskbar/taskbar_app.py - About 35 mins to fix

            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

            Severity
            Category
            Status
            Source
            Language