EventGhost/EventGhost

View on GitHub

Showing 1,842 of 2,440 total issues

TreeItem has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

class TreeItem(object):
    # name
    # parent
    # isEnabled
    # xmlId
Severity: Minor
Found in eg/Classes/TreeItem.py - About 5 hrs to fix

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

    """<rst>
    Allows to send commands to FS20 receivers.
    
    |
    
    
    Severity: Minor
    Found in plugins/FS20PCS/__init__.py - About 5 hrs to fix

      Function CheckDependencies has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      def CheckDependencies(buildSetup):
          failedDeps = []
      
          for dep in DEPENDENCIES:
              dep.buildSetup = buildSetup
      Severity: Minor
      Found in _build/builder/CheckDependencies.py - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def Configure(self, ScreamerPath=None, path2 = None):
              panel = eg.ConfigPanel(self)
              label1Text = wx.StaticText(panel, -1, self.text.label1)
              label2Text = wx.StaticText(panel, -1, self.text.label2)
              filepathCtrl = MyDirBrowseButton(
      Severity: Minor
      Found in plugins/ScreamerRadio/__init__.py - About 5 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 main has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def main(self,mainThreadEvent):
              self.iGetWeatherCntr = 0
              i = 0
              while not mainThreadEvent.isSet():
                  if self.initsynch:
      Severity: Minor
      Found in plugins/SunTracker/__init__.py - About 5 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 ssdpSearch has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      def ssdpSearch():
          import socket
          from urlparse import urlparse
          import os
          def Headers(data):
      Severity: Minor
      Found in plugins/XBMCRepeat/__init__.py - About 5 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 Jubox has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          def Jubox(self,ID,clear,repeat,shuffle,crossfade,stop):
              if self.isRunning():
                  sql = 'IDAlbum="%s"' % ID
                  Total=self.MM.Database.OpenSQL("SELECT COUNT(*) FROM Songs WHERE "+sql).ValueByIndex(0)
                  tmpSongList = self.MM.NewSongList
      Severity: Minor
      Found in plugins/MediaMonkey/__init__.py - About 5 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 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Configure(
              self,
              imageFile = '',
              winSize = 0,
              fitMode = 1,
      Severity: Major
      Found in plugins/System/__init__.py - About 5 hrs to fix

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

            def Configure(self, BillyPath=None, path2 = None):
                panel = eg.ConfigPanel(self)
                label1Text = wx.StaticText(panel, -1, self.text.label1)
                label2Text = wx.StaticText(panel, -1, self.text.label2)
                filepathCtrl = MyDirBrowseButton(
        Severity: Minor
        Found in plugins/Billy/__init__.py - About 5 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 __call__ has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            def __call__(
                self,
                key,
                subkey,
                valueName,
        Severity: Minor
        Found in plugins/System/Registry.py - About 5 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 PasteXml has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            def PasteXml(self, selection, clipboardData):
                xmlTree = ElementTree.fromstring(clipboardData.encode("utf-8"))
                for childXmlNode in xmlTree:
                    childCls = self.document.XMLTag2ClassDict[childXmlNode.tag.lower()]
                    before = None
        Severity: Minor
        Found in eg/Classes/UndoHandler/Paste.py - About 5 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 OnCmdSave has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

            def OnCmdSave(self, dummyEvent=None):
                self.StoreEditField()
                tree = self.tree
                indentString = "    "
        
        
        Severity: Minor
        Found in eg/Classes/LanguageEditor.py - About 5 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 Utils.py has 376 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/Utils.py - About 5 hrs to fix

          Cyclomatic complexity is too high in method run. (40)
          Open

          
          
              @eg.LogItWithReturn
              def run(self) :
                  if self.watchDogTime == 0 :
          Severity: Minor
          Found in plugins/DVBViewer/__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

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

              def Configure(
                  self,
                  choices=[],
                  fore = (75, 75, 75),
                  back = (180, 180, 180),
          Severity: Major
          Found in plugins/OSM/__init__.py - About 4 hrs to fix

            Function ShowOutServDlg has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def ShowOutServDlg(self):
                    def boxEnable(enable):
                        labelCtrl.Enable(enable)
                        labelLbl.Enable(enable)
                        outServerLbl.Enable(enable)
            Severity: Major
            Found in plugins/E-mail/__init__.py - About 4 hrs to fix

              Function FindModulesInPath has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              def FindModulesInPath(path, prefix="", includeDeprecated=False):
                  """
                  Find modules and packages for a given filesystem path.
                  """
                  if prefix:
              Severity: Minor
              Found in _build/builder/BuildImports.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 RawCallback has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  def RawCallback(self, data):
                      #hexdata= binascii.hexlify(data).upper()
                      #eg.PrintNotice( hexdata )
              
                      try:
              Severity: Minor
              Found in plugins/PS3/__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 RawCallback has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  def RawCallback(self, data):
                      if not data or len(data) != 13 or ord(data[0]) != 2 or ord(data[1]) != 11:
                          self.PrintError("invalid data")
                          return
              
              
              Severity: Minor
              Found in plugins/FS20PCE/__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 Callback has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  def Callback(self, code):
                      #print code
                      if code[0] == 2:
                          # mouse codes always start with 2
                          mouseState, x, y = code[1:4]
              Severity: Minor
              Found in plugins/PC Remote Controller/__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

              Severity
              Category
              Status
              Source
              Language