EventGhost/EventGhost

View on GitHub
plugins/XBMCRepeat/__init__.py

Summary

Maintainability
F
1 mo
Test Coverage

Function JSONRPCNotifications has a Cognitive Complexity of 339 (exceeds 5 allowed). Consider refactoring.
Open

    def JSONRPCNotifications(self, stopJSONRPCNotifications):
            import os
            import struct
            from collections import deque
            import select
Severity: Minor
Found in plugins/XBMCRepeat/__init__.py - About 6 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 2266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (C) 2008 Chris Longo <cal@chrislongo.net> and Tobias Arrskog (topfs2)
#
# This file is a plugin for EventGhost.
#
# EventGhost is free software; you can redistribute it and/or modify
Severity: Major
Found in plugins/XBMCRepeat/__init__.py - About 6 days to fix

    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

    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

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

        def Configure(self, Function="Help", Parameters=""):
            import os, contextlib, pickle
            BuiltInFunctionList = {}
            def UpdateFunctions():
                def GetFunctions():
    Severity: Minor
    Found in plugins/XBMCRepeat/__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 54 (exceeds 5 allowed). Consider refactoring.
    Open

        def Configure(self, command="GetCurrentPlaylist", param="", category=0, log=True):
            class record:
                pass
            httpapi = record()
            httpapi.Headers = []
    Severity: Minor
    Found in plugins/XBMCRepeat/__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

    Cyclomatic complexity is too high in method JSONRPCNotifications. (49)
    Open

        def JSONRPCNotifications(self, stopJSONRPCNotifications):
                import os
                import struct
                from collections import deque
                import select
    Severity: Minor
    Found in plugins/XBMCRepeat/__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 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 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 __call__ has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      def __call__(self):
            responce = self.plugin.JSON_RPC.send('Player.GetActivePlayers')
            if (responce != None):
                Method = None
                if (responce['result']['picture']): Method = 'Picture'
    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 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

    Function send has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def send(self, method, params = None, wait=True):
            self.jsoninit['method'] = method
            if params:
                self.jsoninit['params'] = params
            else:
    Severity: Minor
    Found in plugins/XBMCRepeat/__init__.py - About 1 hr 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Configure(self, command="GetCurrentPlaylist", param="", category=0, log=True):
            class record:
                pass
            httpapi = record()
            httpapi.Headers = []
    Severity: Minor
    Found in plugins/XBMCRepeat/__init__.py - About 1 hr to fix

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

          def __call__(self, method="JSONRPC.Introspect", param="", log=True, wait=True):
              if param:
                  responce = self.plugin.JSON_RPC.send(method, ast.literal_eval(ParseString2(param)), wait=wait)
              else:
                  responce = self.plugin.JSON_RPC.send(method, wait=wait)
      Severity: Minor
      Found in plugins/XBMCRepeat/__init__.py - About 1 hr 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 33 lines of code (exceeds 25 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 1 hr to fix

        Function ParseString2 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def ParseString2(text, filterFunc=None):
            start = 0
            chunks = []
            last = len(text) - 1
            while 1:
        Severity: Minor
        Found in plugins/XBMCRepeat/__init__.py - About 1 hr 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 CheckDefault has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def CheckDefault(Dict1, Dict2):
            for i in Dict1.iterkeys():
                if type(Dict1[i]) is dict:
                    try:
                        CheckDefault(Dict1[i], Dict2[i])
        Severity: Minor
        Found in plugins/XBMCRepeat/__init__.py - About 1 hr 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 __init__ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __init__(self):
                ButtonsGroup = self.AddGroup("Buttons", "Button actions to send to XBMC")
                ButtonsGroup.AddActionsFromList(REMOTE_BUTTONS, ButtonPrototype)
                ButtonsGroup.AddActionsFromList(GAMEPAD_BUTTONS, GamepadPrototype)
                ButtonsGroup.AddActionsFromList(APPLEREMOTE_BUTTONS, AppleRemotePrototype)
        Severity: Minor
        Found in plugins/XBMCRepeat/__init__.py - About 1 hr to fix

          Function __start__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def __start__(self, pluginConfig={}, *args):
                          if type(pluginConfig) is not dict:
                              pluginConfig = {}
                          CheckDefault(self.pluginConfigDefault, pluginConfig)
          
          
          Severity: Minor
          Found in plugins/XBMCRepeat/__init__.py - About 1 hr 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

          Avoid deeply nested control flow statements.
          Open

                                                          if not payload['item']:
                                                              del payload['item']
                                                      except KeyError:
          Severity: Major
          Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                            if debug:
                                                                print 'XBMC2: JSON-RPC responce: "pong".'
                                                            continue
            Severity: Major
            Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (responce['result']['Filename'] == ''):
                                          print 'No file playing'
                                      return responce['result']['Filename']
              Severity: Major
              Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            for method in responce['result']['methods']:
                                                namespace = method[:method.find('.')]
                                                if namespace not in jsonrpc.Namespaces:
                                                    jsonrpc.Namespaces.append(namespace)
                                                    jsonrpc.Methods[namespace] = []
                Severity: Major
                Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                                  if modelName.firstChild.data in ('Kodi', 'XBMC Media Center', 'XBMC'):
                                                                      if debug:
                                                                          with open(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2', 'ssdp.log'), 'a+') as f:
                                                                              f.write(data)
                                                                              f.write(urllib2.urlopen(headers['LOCATION']).read())
                  Severity: Major
                  Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                                    if debug:
                                                                        print 'XBMC2: JSON-RPC responce: "notifications":', message['result']['notifications']
                                                                    continue
                    Severity: Major
                    Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if (Pos != -1):
                                                          httpapi.Commands[Header][0].append(Text[:Pos])
                                                      else:
                                                          httpapi.Commands[Header][0].append(Text)
                                                  else:
                      Severity: Major
                      Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    for method in responce['result']['commands']:
                                                        namespace = method['command'][:method['command'].find('.')]
                                                        if namespace not in jsonrpc.Namespaces:
                                                            jsonrpc.Namespaces.append(namespace)
                                                            jsonrpc.Methods[namespace] = []
                        Severity: Major
                        Found in plugins/XBMCRepeat/__init__.py - About 45 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                      return False
                          Severity: Major
                          Found in plugins/XBMCRepeat/__init__.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                    return False
                            Severity: Major
                            Found in plugins/XBMCRepeat/__init__.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                          return responce['error']
                              Severity: Major
                              Found in plugins/XBMCRepeat/__init__.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                            return False
                                Severity: Major
                                Found in plugins/XBMCRepeat/__init__.py - About 30 mins to fix

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

                                      def __call__(self, command, param, category, log):
                                          if param:
                                              responce = self.plugin.HTTP_API.send(command, param)
                                          else:
                                              responce = self.plugin.HTTP_API.send(command)
                                  Severity: Minor
                                  Found in plugins/XBMCRepeat/__init__.py - About 25 mins 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

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

                                      ("Play", "Play", "Play the selected item (or folder of items), or unpause a paused item.", "play"),
                                      ("Pause", "Pause", "Pause the currently playing item.", "pause"),
                                      ("Stop", "Stop", "Stop the currently playing item.", "stop"),
                                      ("FastForward", "FastForward", "Toggle the fastforward speed between normal play, 2x, 4x, 8x, 16x, and 32x.", "fastforward"),
                                      ("Rewind", "Rewind", "Toggle the rewind speed between normal play, 2x, 4x, 8x, 16x, and 32x.", "rewind"),
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 day to fix
                                  plugins/IrfanView/__init__.py on lines 100..124

                                  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 151.

                                  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 Headers(data):
                                          headers = {}
                                          for line in data.splitlines():
                                              if not line.split(':', 1)[0]:
                                                  continue
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 5 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1973..1982

                                  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 116.

                                  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 Headers(data):
                                                  headers = {}
                                                  for line in data.splitlines():
                                                      if not line.split(':', 1)[0]:
                                                          continue
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 5 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1397..1406

                                  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 116.

                                  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

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

                                      ("NextPicture", "NextPicture", "Move to the next picture in a slideshow.", "nextpicture"),
                                      ("PreviousPicture", "PreviousPicture", "Move to the previous picture in a slideshow.", "previouspicture"),
                                      ("ZoomOut", "ZoomOut", "Used in picture, slideshow or video fullscreen to zoom out of the current image/video.", "zoomout"),
                                      ("ZoomIn", "ZoomIn", "Used in picture, slideshow or video fullscreen to zoom in to the current image/video.", "zoomin"),
                                      ("ZoomNormal", "ZoomNormal", "Normal (fullscreen) viewing in My Pictures", "zoomnormal"),
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 3 hrs to fix
                                  plugins/IrfanView/__init__.py on lines 154..169

                                  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 97.

                                  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

                                                                      for i in range(2, 10):
                                                                          #print i
                                                                          #print repr((XMLText(code).strip()[:-5] + str(i)).lower()),
                                                                          #print repr(XMLText(code.parentNode.nextSibling.nextSibling).strip())
                                                                          ActionDict[(XMLText(code).strip()[:-5] + str(i)).lower()] = ((XMLText(code).strip()[:-5] + str(i)), XMLText(code.parentNode.nextSibling.nextSibling).strip())
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 2 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1611..1615

                                  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 80.

                                  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

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

                                  class GamepadPrototype(eg.ActionClass):
                                      def __call__(self):
                                          try:
                                              packet = PacketBUTTON(map_name=str("XG"), button_name=str(self.value), repeat=0)
                                              packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 2 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 841..847
                                  plugins/XBMCRepeat/__init__.py on lines 865..871

                                  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 80.

                                  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

                                                                      for i in range(10):
                                                                          #print i
                                                                          #print repr((XMLText(code).strip()[:-5] + str(i)).lower()),
                                                                          #print repr(XMLText(code.parentNode.nextSibling.nextSibling).strip())
                                                                          ActionDict[(XMLText(code).strip()[:-5] + str(i)).lower()] = ((XMLText(code).strip()[:-5] + str(i)), XMLText(code.parentNode.nextSibling.nextSibling).strip())
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 2 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1605..1609

                                  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 80.

                                  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

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

                                  class KeyboardPrototype(eg.ActionClass):
                                      def __call__(self):
                                          try:
                                              packet = PacketBUTTON(map_name=str("KB"), button_name=str(self.value), repeat=0)
                                              packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 2 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 841..847
                                  plugins/XBMCRepeat/__init__.py on lines 849..855

                                  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 80.

                                  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

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

                                  class ButtonPrototype(eg.ActionClass):
                                      def __call__(self):
                                          try:
                                              packet = PacketBUTTON(map_name=str("R1"), button_name=str(self.value), repeat=0)
                                              packet.send(self.plugin.xbmc.sock, self.plugin.xbmc.addr, self.plugin.xbmc.uid)
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 2 hrs to fix
                                  plugins/XBMCRepeat/__init__.py on lines 849..855
                                  plugins/XBMCRepeat/__init__.py on lines 865..871

                                  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 80.

                                  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

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

                                                                                  if modelName.firstChild.data in ('Kodi', 'XBMC Media Center', 'XBMC'):
                                                                                      if debug:
                                                                                          with open(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2', 'ssdp.log'), 'a+') as f:
                                                                                              f.write(data)
                                                                                              f.write(urllib2.urlopen(headers['LOCATION']).read())
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 2069..2073

                                  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 73.

                                  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

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

                                                                                      if debug:
                                                                                          with open(os.path.join(eg.folderPath.RoamingAppData, 'EventGhost', 'plugins', 'XBMC2', 'ssdp.log'), 'a+') as f:
                                                                                              f.write(data)
                                                                                              f.write(urllib2.urlopen(headers['LOCATION']).read())
                                                                                          print 'XBMC2: SSDP modelName:', modelName.firstChild.data
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 2068..2099

                                  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 73.

                                  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

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

                                                          self.HTTP_API.connect(ip=panel.combo_box_IP.GetValue().split(':')[0], port=panel.combo_box_IP.GetValue().split(':')[1], username=panel.text_ctrl_Username.GetValue(), password=panel.text_ctrl_Password.GetValue())
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1650..1650

                                  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 70.

                                  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

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

                                                  self.HTTP_API.connect(ip=pluginConfig['XBMC']['ip'], port=pluginConfig['XBMC']['port'], username=pluginConfig['XBMC']['username'], password=pluginConfig['XBMC']['password'])
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1901..1901

                                  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 70.

                                  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

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

                                  VISUALISATION_ACTIONS = (
                                  (eg.ActionGroup, "MusicVisualisation", "Music visualisation", None, (
                                      ("OSD", "OSD", "Toggles the OSD while playing an item.", "osd"),
                                      ("ShowPreset", "ShowPreset", "Shows the current visualisation preset (milkdrop/spectrum)", "showpreset"),
                                      ("PresetList", "PresetList", "Pops up the visualisation preset list (milkdrop/spectrum)", "presetlist"),
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 329..339

                                  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 70.

                                  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

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

                                                      self.JSON_RPC.connect(ip=panel.combo_box_IP.GetValue().split(':')[0], port=panel.combo_box_IP.GetValue().split(':')[1], username=panel.text_ctrl_Username.GetValue(), password=panel.text_ctrl_Password.GetValue())
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1674..1674

                                  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 70.

                                  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

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

                                  SHUTDOWN_ACTIONS = (
                                  (eg.ActionGroup, "ShutdownRelated", "Shutdown related", None, (
                                      ("Quit", "Quit", "Quit XBMC", "Quit"),
                                      ("RestartApp", "RestartApp", "Restart XBMC", "RestartApp"),
                                      ("Reset", "Reset Computer", "Reset the computer.", "reset"),
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 315..325

                                  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 70.

                                  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

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

                                                  self.JSON_RPC.connect(ip=pluginConfig['XBMC']['ip'], port=pluginConfig['XBMC']['port'], username=pluginConfig['XBMC']['username'], password=pluginConfig['XBMC']['password'])
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 1 hr to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1902..1902

                                  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 70.

                                  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

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

                                                      if pluginConfig['Broadcast']['port'] != int(panel.spin_ctrl_BroadcastPort.GetValue()):
                                                          pluginConfig['Broadcast']['port'] = int(panel.spin_ctrl_BroadcastPort.GetValue())
                                                          changed = True
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 50 mins to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1863..1865
                                  plugins/XBMCRepeat/__init__.py on lines 1869..1871

                                  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 64.

                                  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

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

                                                      if pluginConfig['JSONRPC']['port'] != int(panel.spin_ctrl_JSONRPCPort.GetValue()):
                                                          pluginConfig['JSONRPC']['port'] = int(panel.spin_ctrl_JSONRPCPort.GetValue())
                                                          changed = True
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 50 mins to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1863..1865
                                  plugins/XBMCRepeat/__init__.py on lines 1875..1877

                                  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 64.

                                  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

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

                                                      if pluginConfig['EventServer']['port'] != int(panel.spin_ctrl_EventServerPort.GetValue()):
                                                          pluginConfig['EventServer']['port'] = int(panel.spin_ctrl_EventServerPort.GetValue())
                                                          changed = True
                                  Severity: Major
                                  Found in plugins/XBMCRepeat/__init__.py and 2 other locations - About 50 mins to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1869..1871
                                  plugins/XBMCRepeat/__init__.py on lines 1875..1877

                                  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 64.

                                  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 XMLText(Node):
                                                              text = ''
                                                              #print "Info:", Node.nodeValue, Node.nodeName
                                                              try:
                                                                  for n in Node.childNodes:
                                  Severity: Minor
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 45 mins to fix
                                  plugins/XBMCRepeat/__init__.py on lines 692..702

                                  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 63.

                                  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 XMLText(Node):
                                                      text = ''
                                                      #print "Info:", Node.nodeValue, Node.nodeName
                                                      try:
                                                          for n in Node.childNodes:
                                  Severity: Minor
                                  Found in plugins/XBMCRepeat/__init__.py and 1 other location - About 45 mins to fix
                                  plugins/XBMCRepeat/__init__.py on lines 1576..1586

                                  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 63.

                                  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

                                  There are no issues that match your filters.

                                  Category
                                  Status