EventGhost/EventGhost

View on GitHub

Showing 1,842 of 2,440 total issues

Function handle_read has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
Open

    def handle_read(self):
        # Append data from the socket onto a buffer
        self.buffer += self.recv(4096)
        # Attempt to detect delimeter used..
        if self.delimeter == '':
Severity: Minor
Found in plugins/Lirc/__init__.py - About 2 days 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 918 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

version="0.1.7"

# Copyright (C)  2008-2011 Pako  (lubos.ruckl@quick.cz)
Severity: Major
Found in plugins/FileOperations/__init__.py - About 2 days to fix

    Function Update has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
    Open

        def Update( self, updateMode=UPDATE_TIMERS ) :
    
            def GetID( *args ) :
    
                m = hashlib.md5()
    Severity: Minor
    Found in plugins/DVBViewer/__init__.py - About 2 days 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 858 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    version="0.1.6"
    
    # plugins/ScreamerRadio/__init__.py
    Severity: Major
    Found in plugins/ScreamerRadio/__init__.py - About 2 days to fix

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

          def Configure(self, method="JSONRPC.Introspect", param="", log=True, wait=True):
              class record:
                  Namespaces = ['No namespaces']
                  Methods = {'No namespaces':['No methods']}
                  Descriptions = {'No namespaces':['']}
      Severity: Minor
      Found in plugins/XBMCRepeat/__init__.py - About 2 days 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 NextRun. (107)
      Open

      
          def NextRun(self, type, data):
      
              def FindRunDateTime(runList, cond):
                  runList.sort()
      Severity: Minor
      Found in plugins/RadioSure/__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 798 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      #
      # Copyright (C) 2006 MonsterMagnet
      #
      # This file is a plugin for EventGhost.
      Severity: Major
      Found in plugins/VLC/__init__.py - About 1 day to fix

        Function GetFolderItems has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
        Open

        def GetFolderItems(folder, patterns, hide):
            shortcut = pythoncom.CoCreateInstance (
              shell.CLSID_ShellLink,
              None,
              pythoncom.CLSCTX_INPROC_SERVER,
        Severity: Minor
        Found in plugins/OSE/__init__.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

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

        # -*- coding: utf-8 -*-
        #
        # /plugins/Phoner/__init__.py
        #
        # Copyright (C)  2009 Pako  <lubos.ruckl@quick.cz>
        Severity: Major
        Found in plugins/Phoner/__init__.py - About 1 day to fix

          File __init__.py has 766 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 plugins/EventGhost/__init__.py - About 1 day to fix

            Function ShowGroupsDlg has a Cognitive Complexity of 89 (exceeds 5 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: Minor
            Found in plugins/E-mail/__init__.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

            File __init__.py has 759 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 plugins/Winamp/__init__.py - About 1 day to fix

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

                  def Configure(
                      self,
                      choices="",
                      fore = (75, 75, 75),
                      back = (180, 180, 180),
              Severity: Minor
              Found in plugins/OSM/__init__.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 run has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
              Open

                  def run(self):
                      while 1:
                          errorList = ('strict','ignore','replace')
                          try:
                              input = codecs.open(self.fileName,'r',self.inPage, errorList[self.errDecMode])
              Severity: Minor
              Found in plugins/FileOperations/__init__.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

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

              # -*- coding: utf-8 -*-
              
              version="0.3.5"
              
              # Plugins/Billy/__init__.py
              Severity: Major
              Found in plugins/Billy/__init__.py - About 1 day 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 __call__ has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __call__(
                          self,
                          num_bytes=None,
                          timeout=1,
                          returnformat="Hex",
                  Severity: Minor
                  Found in plugins/Atric_IRWakeupUSB/__init__.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 Configure has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def Configure(
                          self,
                          choices = [],
                          fore = (0, 0, 0),
                          back = (255, 255, 255),
                  Severity: Minor
                  Found in plugins/OOo_Impress/__init__.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

                  File TreeCtrl.py has 717 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/TreeCtrl.py - About 1 day to fix

                    File Registry.py has 714 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 plugins/System/Registry.py - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language