EventGhost/EventGhost

View on GitHub

Showing 1,804 of 2,440 total issues

File CheckDependencies.py has 407 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/CheckDependencies.py - About 5 hrs to fix

    Function __init__ has 144 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/RadioSure/__init__.py - About 5 hrs to fix

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

          def handle_read(self):
              payload, address = self.socket.recvfrom(128)
              if self.remAddress == address[0]:
                  if len(payload)==44:
                      weight = 1
      Severity: Minor
      Found in plugins/IgorPlugUDP/__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 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Configure(
              self,
              myLongitude = "18.0000",
              myLatitude = "59.2500",
              location_id = "905335",
      Severity: Major
      Found in plugins/SunTracker/__init__.py - About 5 hrs to fix

        Function __init__ has 140 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/RadioSure/__init__.py - About 5 hrs to fix

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

              def __call__( self, enableDVBViewer=True, enableDVBService=False, updateDVBService=False ) :
          
                  plugin = self.plugin
          
                  leadTime = plugin.schedulerLeadTime * 60.0
          Severity: Minor
          Found in plugins/DVBViewer/__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 OnTreeChange has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

              def OnTreeChange(
                  self,
                  event,
                  key2Select = None,
                  subkey2Select = None,
          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 OnFindButton has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

              def OnFindButton(self, event=None):
                  item = self.parent.treeCtrl.GetSelectedNode()
                  startItem = item
                  originalSearchValue = self.textCtrl.GetValue()
                  if self.caseSensitiveCb.GetValue():
          Severity: Minor
          Found in eg/Classes/FindDialog.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 137 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function LoadPlaylist has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                def LoadPlaylist(self,sql,repeat,crossfade,shuffle,clear,Total,plName):
                    MyTracks = self.MM.Database.QuerySongs(sql)
                    tmpSongList = self.MM.NewSongList
                    n=0
                    while not MyTracks.EOF:
            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 a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                    def Configure(self, actionStr=""):
                        text = self.text
                        actionParam = "0"
                        if len(self.remotes) == 0:
                           self.remotes.append(["N/A", ['N/A']])
            Severity: Minor
            Found in plugins/Lirc/__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 Connect has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                def Connect( self, connectingMode=WAIT_CHECK_START_CONNECT, lock=False ):
                    '''
                    This is one of the key methods of the plugin. The method has three modes:
                    # WAIT_CHECK_START_CONNECT  = 0   # check if executing, start if not executing, connect
                    # CONNECT                   = 1   # connect to a running DVBViewer instance (only to be used by the watchdog thread)
            Severity: Minor
            Found in plugins/DVBViewer/__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

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

            # -*- coding: latin-1 -*-
            #
            # YamahaSerial V0.0.1
            # ================
            # Written by Mark Clarkson, <mark@hollowhills.net>
            Severity: Minor
            Found in plugins/YamahaSerial/__init__.py - About 5 hrs to fix

              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

                  Severity
                  Category
                  Status
                  Source
                  Language