EventGhost/EventGhost

View on GitHub

Showing 2,434 of 2,440 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if item[2] == 3:
                orderNode = dom.createElement(u'Order')
                orderText = dom.createTextNode(unicode(item[3][2]))
                orderNode.appendChild(orderText)
                dateTimeNode.appendChild(orderNode)
Severity: Major
Found in plugins/RadioSure/__init__.py and 1 other location - About 2 days to fix
plugins/SchedulGhost/__init__.py on lines 2458..2478

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 296.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

version = "0.1.14"

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

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

        def __call__(self, val = 22, fileSuff = "", folderSuff = ""):
            if self.plugin.menuDlg:
                eg.event.skipEvent = True
                filePath, prefix, suffix = self.plugin.menuDlg.GetInfo()
                filePath = filePath.replace(folder_ID,"")
    Severity: Minor
    Found in plugins/OSE/__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. (129)
    Open

    
        def NextRun(self, type, data):
    
            def FindRunDateTime(runList, cond, cond2):
                runList.sort()
    Severity: Minor
    Found in plugins/SchedulGhost/__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 a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
    Open

        def Configure(self, pluginConfig={}, *args):
                    def UpdateActions(event):
                        def GetActions():
                            URL = 'https://raw.githubusercontent.com/xbmc/xbmc/Krypton/xbmc/input/ButtonTranslator.cpp'
                            request = urllib2.Request(URL)
    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

    File __init__.py has 982 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: Major
    Found in plugins/TestPatterns/__init__.py - About 2 days to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def AddSchedule(self, schedule):
              tmpList = [item[1] for item in self.tmpData]
              if schedule[1] in tmpList:
                  ix = tmpList.index(schedule[1])
                  self.tmpData[ix] = schedule
      Severity: Major
      Found in plugins/SchedulGhost/__init__.py and 1 other location - About 2 days to fix
      plugins/RadioSure/__init__.py on lines 2993..3013

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 287.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          def AddSchedule(self, schedule):
              tmpList = [item[1] for item in self.tmpData]
              if schedule[1] in tmpList:
                  ix = tmpList.index(schedule[1])
                  self.tmpData[ix] = schedule
      Severity: Major
      Found in plugins/RadioSure/__init__.py and 1 other location - About 2 days to fix
      plugins/SchedulGhost/__init__.py on lines 1648..1668

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 287.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              def onLinesNumCtrl(event=None):
                  flag = False
                  if event:
                      self.mode = choiceMode.GetSelection()
                  if linesNumCtrl.GetValue() == 0:
      Severity: Major
      Found in plugins/FileOperations/__init__.py and 1 other location - About 2 days to fix
      plugins/FileOperations/__init__.py on lines 803..837

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 287.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              def onLinesNumCtrl(event=None):
                  flag = False
                  if event:
                      self.mode = choiceMode.GetSelection()
                  if linesNumCtrl.GetValue() == 0:
      Severity: Major
      Found in plugins/FileOperations/__init__.py and 1 other location - About 2 days to fix
      plugins/FileOperations/__init__.py on lines 515..549

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 287.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      class HolidaysBox(wx.ListBox):
      
          def __init__ (self, parent, id, size, style):
              wx.ListBox.__init__(
                  self,
      Severity: Major
      Found in plugins/SchedulGhost/__init__.py and 1 other location - About 2 days to fix
      plugins/RadioSure/__init__.py on lines 828..861

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 282.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      class HolidaysBox(wx.ListBox):
      
          def __init__ (self, parent, id, size, style):
              wx.ListBox.__init__(
                  self,
      Severity: Major
      Found in plugins/RadioSure/__init__.py and 1 other location - About 2 days to fix
      plugins/SchedulGhost/__init__.py on lines 495..528

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 282.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      File __init__.py has 933 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/__init__.py - About 2 days to fix

        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

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      elif type == 5:
                          if flag:
                              self.ctrls.append(wx.NewId())
                              dp = wx.DatePickerCtrl(self, self.ctrls[2], size = (86, -1),
                                      style = wx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
          Severity: Major
          Found in plugins/RadioSure/__init__.py and 1 other location - About 2 days to fix
          plugins/SchedulGhost/__init__.py on lines 1009..1028

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 254.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      elif type == 5:
                          if flag:
                              self.ctrls.append(wx.NewId())
                              dp = wx.DatePickerCtrl(self, self.ctrls[2], size = (86, -1),
                                      style = wx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
          Severity: Major
          Found in plugins/SchedulGhost/__init__.py and 1 other location - About 2 days to fix
          plugins/RadioSure/__init__.py on lines 2161..2180

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 254.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                def ReceiveThread(self):
                    from win32event import (
                        ResetEvent,
                        MsgWaitForMultipleObjects,
                        QS_ALLINPUT,
            Severity: Major
            Found in plugins/HarmanKardon/__init__.py and 1 other location - About 2 days to fix
            plugins/Serial/__init__.py on lines 195..246

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 250.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language