EventGhost/EventGhost

View on GitHub

Showing 1,804 of 2,440 total issues

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

            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

              Function RemoveSongFromPlaylist has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def RemoveSongFromPlaylist(self, plString, skip, now_pl):
                      if self.isRunning():
                          Player = self.MM.Player
                          idSong=Player.CurrentSong.ID
                          IDPlaylist=self.MM.PlaylistByTitle(plString).ID
              Severity: Minor
              Found in plugins/MediaMonkey/__init__.py - About 3 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 HandleReceive has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def HandleReceive(self, serial):
                      byte = ord(serial.Read(1))
                      if byte == 6:
                          if self.lastActionEvent:
                              self.lastActionEvent.set()
              Severity: Minor
              Found in plugins/AIRT/__init__.py - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __call__(
                      self,
                      command = '',
                      waitForCompletion = True,
                      triggerEvent = False,
              Severity: Minor
              Found in plugins/System/Command.py - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __call__(
                      self,
                      pathname='',
                      arguments='',
                      winState=0,
              Severity: Minor
              Found in plugins/System/Execute.py - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def run(self):
                      atexit.register(self.Stop)
              
                      def start_sock():
                          try:
              Severity: Minor
              Found in eg/LoopbackSocket.py - About 3 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 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def Configure(self, args = [
                      "00:03:00",
                      "SchedulGhost",
                      None,
                      "",
              Severity: Major
              Found in plugins/SchedulGhost/__init__.py - About 3 hrs to fix

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

                    def __init__(self):
                        self.AddEvents(*EVENT_LIST)
                
                        group = self.AddGroup("DVBViewer program actions", "DVBViewer program management")
                        group.AddAction(Start)
                Severity: Major
                Found in plugins/DVBViewer/__init__.py - About 3 hrs to fix

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

                  # -*- coding: utf-8 -*-
                  #
                  # Plugins/Speech/__init__.py
                  #
                  # Copyright (C) 2006 MonsterMagnet
                  Severity: Minor
                  Found in plugins/Speech/__init__.py - About 3 hrs to fix

                    Scheduler has 31 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Scheduler(eg.PluginClass):
                        text = Text
                    
                        def __init__(self):
                            self.AddAction(SchedulerAction)
                    Severity: Minor
                    Found in plugins/Scheduler/__init__.py - About 3 hrs to fix

                      Function Configure has 95 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 3 hrs to fix

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

                            def Configure(
                                self,
                                fore = (75, 75, 75),
                                back = (180, 180, 180),
                                faceFont = "Courier New",
                        Severity: Major
                        Found in plugins/MediaPlayerClassic/__init__.py - About 3 hrs to fix

                          Function Multitapper has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def Multitapper(self,config,keys):
                                  self.timer.cancel()
                                  try:
                                      indx = [n[0] for n in self.configs].index(config)
                                      item = self.configs[indx]
                          Severity: Minor
                          Found in plugins/Multitap/__init__.py - About 3 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 send has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def send(self, method, params = ""):
                                  request = urllib2.Request('http://'+self.ip+':'+self.port+'/xbmcCmds/xbmcHttp?command='+method+'('+urllib2.quote(eg.ParseString(params), ':\\')+')')
                                  request.add_header("Authorization", "Basic %s" % self.base64string)
                                  try:
                                      responce = urllib2.urlopen(request).readlines()
                          Severity: Minor
                          Found in plugins/XBMCRepeat/__init__.py - About 3 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