EventGhost/EventGhost

View on GitHub
eg/Classes/MainFrame/__init__.py

Summary

Maintainability
F
6 days
Test Coverage

File __init__.py has 933 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
Severity: Major
Found in eg/Classes/MainFrame/__init__.py - About 2 days to fix

    MainFrame has 88 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MainFrame(wx.Frame):
        """
        This is the MainFrame of EventGhost
        """
        style = (
    Severity: Major
    Found in eg/Classes/MainFrame/__init__.py - About 1 day to fix

      Function OnCmdPythonShell has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          def OnCmdPythonShell(self):
              if eg.pyCrustFrame:
                  eg.pyCrustFrame.Raise()
                  return
      
      
      Severity: Minor
      Found in eg/Classes/MainFrame/__init__.py - About 4 hrs 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 CreateMenuBar has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def CreateMenuBar(self):
              """
              Creates the main menu bar and all its menus.
              """
              text = Text.Menu
      Severity: Major
      Found in eg/Classes/MainFrame/__init__.py - About 3 hrs to fix

        Function __init__ has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(self, document):
                """
                Create the MainFrame
                """
                self.document = document
        Severity: Major
        Found in eg/Classes/MainFrame/__init__.py - About 3 hrs to fix

          Function CreateToolBar has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def CreateToolBar(self):
                  """
                  Creates the toolbar of the frame.
                  """
                  toolBar = wx.ToolBar(self, style=wx.TB_FLAT)
          Severity: Minor
          Found in eg/Classes/MainFrame/__init__.py - About 1 hr to fix

            Function UpdateSize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                def UpdateSize(self):
                    if eg.config.propResize:
                        panel = self.auiManager.GetPane("logger")
                        if panel.IsDocked():
                            s = self.auiManager.SavePerspective()
            Severity: Minor
            Found in eg/Classes/MainFrame/__init__.py - About 1 hr 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 CreateTreePopupMenu has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def CreateTreePopupMenu(self):
                    """
                    Creates the pop-up menu for the configuration tree.
                    """
                    menu = wx.Menu()
            Severity: Minor
            Found in eg/Classes/MainFrame/__init__.py - About 1 hr to fix

              Function UpdateRatio has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def UpdateRatio(self):
                      self.logCtrl.SetColumnWidth(
                          0,
                          self.logCtrl.GetSizeTuple()[0] - self.corConst
                      )
              Severity: Minor
              Found in eg/Classes/MainFrame/__init__.py - About 1 hr 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(self, document):
                      """
                      Create the MainFrame
                      """
                      self.document = document
              Severity: Minor
              Found in eg/Classes/MainFrame/__init__.py - About 45 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

              There are no issues that match your filters.

              Category
              Status