EventGhost/EventGhost

View on GitHub

Showing 1,842 of 2,440 total issues

Function ShowVariableDialog has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def ShowVariableDialog(self, title):
        self.panel.Enable(False)
        self.panel.dialog.buttonRow.cancelButton.Enable(False)
        self.panel.EnableButtons(False)
        self.SetTitle(title)
Severity: Minor
Found in plugins/Webserver/__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

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

"""<rst>
Allows to receive events from FS20 remote controls.

|

Severity: Minor
Found in plugins/FS20PCE/__init__.py - About 4 hrs to fix

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

    # -*- coding: utf-8 -*-
    #
    # This file is a plugin for EventGhost.
    # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
    #
    Severity: Minor
    Found in plugins/Serial/__init__.py - About 4 hrs to fix

      Function Configure has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Configure(
              self,
              fore = (75, 75, 75),
              back = (180, 180, 180),
              fontInfo = arialInfoString,
      Severity: Major
      Found in plugins/MediaPlayerClassic/__init__.py - About 4 hrs to fix

        File PythonEditorCtrl.py has 341 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: Minor
        Found in eg/Classes/PythonEditorCtrl.py - About 4 hrs to fix

          TreeCtrl has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class TreeCtrl(wx.TreeCtrl):
              @eg.AssertInMainThread
              def __init__(self, parent, document, size=wx.DefaultSize):
                  self.document = document
                  self.root = None
          Severity: Minor
          Found in eg/Classes/MainFrame/TreeCtrl.py - About 4 hrs to fix

            File License.py has 339 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: Minor
            Found in eg/Classes/License.py - About 4 hrs to fix

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

                  def Configure(
                      self,
                      fore = (75, 75, 75),
                      back = (180, 180, 180),
                      faceFont = "Courier New",
              Severity: Minor
              Found in plugins/MediaPlayerClassic/__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 Configure has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  def Configure(
                      self,
                      xmlpath = "",
                      logfile = "",
                      prefix = "SchedulGhost",
              Severity: Minor
              Found in plugins/SchedulGhost/__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 OnReceive has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  def OnReceive(self, serial):
                      buffer = ""
                      while True:
                          b = serial.Read(1, 0.1)
                          if b == "\x1a":
              Severity: Minor
              Found in plugins/Onkyo/__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 ShowOutTxtsDlg has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  def ShowOutTxtsDlg(self):
                      text = self.plugin.text
                      self.SetTitle(text.textsTitle)
                      sizer = wx.BoxSizer(wx.VERTICAL)
                      sizer.SetMinSize((450, 300))
              Severity: Minor
              Found in plugins/E-mail/__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 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 _checkUpdate has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

              def _checkUpdate(manually=False):
                  if eg.Version.string == "WIP":
                      if manually:
                          wx.MessageBox(Text.wipUpdateMsg, eg.APP_NAME)
                      return
              Severity: Minor
              Found in eg/Classes/CheckUpdate.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

              File Upload.py has 336 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: Minor
              Found in _build/builder/Upload.py - About 4 hrs to fix

                File dde.py has 336 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: Minor
                Found in eg/WinApi/pywin32_patches/dde.py - About 4 hrs to fix

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

                      def __init__(self, text, plugin):
                          wx.Dialog.__init__(
                              self,
                              None,
                              -1,
                  Severity: Major
                  Found in plugins/SchedulGhost/__init__.py - About 4 hrs to fix

                    File TransferDialog.py has 335 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: Minor
                    Found in eg/Classes/TransferDialog.py - About 4 hrs to fix

                      File serialutil.py has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #! python
                      #Python Serial Port Extension for Win32, Linux, BSD, Jython
                      #see __init__.py
                      #
                      #(C) 2001-2003 Chris Liechti <cliechti@gmx.net>
                      Severity: Minor
                      Found in eg/WinApi/serial/serialutil.py - About 4 hrs to fix

                        Cyclomatic complexity is too high in method __call__. (34)
                        Open

                        
                            def __call__(self, val = 22, fileSuff = "", folderSuff = ""):
                                if self.plugin.menuDlg:
                                    eg.event.skipEvent = True
                                    filePath, prefix, suffix = self.plugin.menuDlg.GetInfo()
                        Severity: Minor
                        Found in plugins/OSE/__init__.py by radon

                        Cyclomatic Complexity

                        Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                        Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                        Construct Effect on CC Reasoning
                        if +1 An if statement is a single decision.
                        elif +1 The elif statement adds another decision.
                        else +0 The else statement does not cause a new decision. The decision is at the if.
                        for +1 There is a decision at the start of the loop.
                        while +1 There is a decision at the while statement.
                        except +1 Each except branch adds a new conditional path of execution.
                        finally +0 The finally block is unconditionally executed.
                        with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                        assert +1 The assert statement internally roughly equals a conditional statement.
                        Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                        Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                        Source: http://radon.readthedocs.org/en/latest/intro.html

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

                        # -*- coding: utf-8 -*-
                        #
                        # This file is a plugin for EventGhost.
                        # Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
                        #
                        Severity: Minor
                        Found in plugins/SysTrayMenu/__init__.py - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language