EventGhost/EventGhost

View on GitHub

Showing 1,842 of 2,440 total issues

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

    def __call__( self,
        enableDVBViewer=True,
        enableDVBService=True,
        updateDVBService=False
    ) :
Severity: Minor
Found in plugins/DVBViewer/__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 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def Configure(self, stp = []):

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.flag2=True
        def validation():
Severity: Major
Found in plugins/E-mail/__init__.py - About 4 hrs to fix

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

        def Configure(self, kwargs={}):
            options = self.defaults.copy()
            options.update(kwargs)
            panel = eg.ConfigPanel(self)
            radioBoxMode = wx.RadioBox(
    Severity: Major
    Found in plugins/IrfanView/__init__.py - About 4 hrs to fix

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

      
          def __call__(
              self,
              num_bytes=None,
              timeout=1,
      Severity: Minor
      Found in plugins/Atric_IRWakeupUSB/__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 Sun.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      # -*- coding: iso-8859-1 -*-
      """
      SUNRISET.C - computes Sun rise/set times, start/end of twilight, and
                   the length of the day at any date and latitude
      Severity: Minor
      Found in plugins/SunTracker/Sun.py - About 4 hrs to fix

        Function ShowGroupsDlg has 119 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def ShowGroupsDlg(self):
                text = self.plugin.text
                self.SetTitle(text.groupsTitle)
                sizer = wx.BoxSizer(wx.VERTICAL)
                sizer.SetMinSize((450, 307))
        Severity: Major
        Found in plugins/E-mail/__init__.py - About 4 hrs to fix

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

              def __init__(
          Severity: Major
          Found in plugins/SunTracker/__init__.py - About 4 hrs to fix

            Function Callback has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def Callback(self, data):
                    buf = self.buf
                    buf.append(data[0])
                    first = buf[0]
                    if first not in LENGTHES:
            Severity: Minor
            Found in plugins/SmallPcRemote/__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 do_GET has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def do_GET(self):
                    """Serve a GET request."""
            
                    # First do Basic HTTP-Authentication, if set
                    if self.server.authString != None:
            Severity: Minor
            Found in plugins/DynamicWebserver/__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 SendRawCodes2 has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                def SendRawCodes2(self, keyData, hwnd, mode):
                    """
                    Uses PostMessage and SetKeyboardState to emulate the the virtual
                    keycode. Can send to a specified window handle.
                    """
            Severity: Minor
            Found in eg/WinApi/SendKeys.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

            Cyclomatic complexity is too high in method RealizeAction. (38)
            Open

            
                def RealizeAction(self, indx, sel, mode):
                    obsData = self.plugin.tempData[indx][2]
                    observName = self.plugin.tempData[indx][0]
                    resultMessage = None
            Severity: Minor
            Found in plugins/E-mail/__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 Utils.py has 361 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/Utils.py - About 4 hrs to fix

              Function StartSuntracker has 37 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def StartSuntracker(
              Severity: Major
              Found in plugins/SunTracker/__init__.py - About 4 hrs to fix

                File SoundMixerTree.py has 359 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/SoundMixerTree.py - About 4 hrs to fix

                  Function showOsDialog has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def showOsDialog(self):
                          if not self.osd:
                              return
                          def setOsDialog():
                              frg = ctrlEvtString.GetForegroundColour()
                  Severity: Minor
                  Found in plugins/Multitap/__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 BroadcastEvents has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def BroadcastEvents(self, stopBroadcastEvents):
                              ActionList = {
                  # actions that we have defined...
                  '0':'ACTION_NONE',
                  '1':'ACTION_MOVE_LEFT',
                  Severity: Minor
                  Found in plugins/XBMCRepeat/__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 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def Configure(self, args = [
                          "00:03:00",
                          "SchedulGhost",
                          None,
                          "",
                  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 run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run(self):
                          stop = False
                          point = POINT()
                          while True:
                              self.lastTime = clock()
                  Severity: Minor
                  Found in plugins/Mouse/__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 run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def run(self):
                          sbjct = self.sbjct
                          sbjct = eg.ParseString(sbjct)
                          From = self.From
                          To = self.To
                  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 __call__ has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __call__( self,
                                    allRecordings=False,
                                    enableDVBViewer=True,
                                    enableDVBService=False,
                                    updateDVBService=False
                  Severity: Minor
                  Found in plugins/DVBViewer/__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