EventGhost/EventGhost

View on GitHub
plugins/OSE/__init__.py

Summary

Maintainability
F
2 wks
Test Coverage

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

# -*- coding: utf-8 -*-
#
# plugins/OSE/__init__.py
# Copyright (C)  2010 Pako  (lubos.ruckl@quick.cz)
#
Severity: Major
Found in plugins/OSE/__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

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

    def GetFolderItems(folder, patterns, hide):
        shortcut = pythoncom.CoCreateInstance (
          shell.CLSID_ShellLink,
          None,
          pythoncom.CLSCTX_INPROC_SERVER,
    Severity: Minor
    Found in plugins/OSE/__init__.py - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

        def Configure(
            self,
            fore = (75, 75, 75),
            back = (180, 180, 180),
            fontInfo = "0;-48;0;0;0;400;0;0;0;238;0;0;0;0;MS Shell Dlg 2",
    Severity: Minor
    Found in plugins/OSE/__init__.py - About 6 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

    Cyclomatic complexity is too high in method __call__. (34)
    Open

    
        def __call__(self, val = 22, fileSuff = "", folderSuff = ""):
            if self.plugin.menuDlg:
                eg.event.skipEvent = True
                filePath, prefix, suffix = self.plugin.menuDlg.GetInfo()
    Severity: Minor
    Found in plugins/OSE/__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 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Configure(
            self,
            fore = (75, 75, 75),
            back = (180, 180, 180),
            fontInfo = "0;-48;0;0;0;400;0;0;0;238;0;0;0;0;MS Shell Dlg 2",
    Severity: Major
    Found in plugins/OSE/__init__.py - About 3 hrs to fix

      Cyclomatic complexity is too high in function GetFolderItems. (29)
      Open

      
      def GetFolderItems(folder, patterns, hide):
          shortcut = pythoncom.CoCreateInstance (
            shell.CLSID_ShellLink,
            None,
      Severity: Minor
      Found in plugins/OSE/__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 ShowMenu has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def ShowMenu(
              self,
              prefix,
              suffix,
              start,
      Severity: Minor
      Found in plugins/OSE/__init__.py - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          def Configure(self, val = 22, fileSuff = "", folderSuff = ""):
              panel = eg.ConfigPanel(self)
              triggFileCheck = wx.CheckBox(panel, -1, self.text.fileSuffix)
              triggFileCheck.SetValue(val&1)
              openFileCheck = wx.CheckBox(panel, -1, self.text.openFile)
      Severity: Major
      Found in plugins/OSE/__init__.py - About 2 hrs to fix

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

            def Configure(self, val = 22, fileSuff = "", folderSuff = ""):
                panel = eg.ConfigPanel(self)
                triggFileCheck = wx.CheckBox(panel, -1, self.text.fileSuffix)
                triggFileCheck.SetValue(val&1)
                openFileCheck = wx.CheckBox(panel, -1, self.text.openFile)
        Severity: Minor
        Found in plugins/OSE/__init__.py - About 2 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 __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in plugins/OSE/__init__.py - About 1 hr to fix

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

              def __call__(
                  self,
                  fore = (75, 75, 75),
                  back = (180, 180, 180),
                  fontInfo = "0;-48;0;0;0;400;0;0;0;238;0;0;0;0;MS Shell Dlg 2",
          Severity: Minor
          Found in plugins/OSE/__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 GetLabel has 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def GetLabel(
          Severity: Major
          Found in plugins/OSE/__init__.py - About 1 hr to fix

            Function Configure has 13 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def Configure(
            Severity: Major
            Found in plugins/OSE/__init__.py - About 1 hr to fix

              Function __call__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __call__(
              Severity: Major
              Found in plugins/OSE/__init__.py - About 1 hr to fix

                Function ShowMenu has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def ShowMenu(
                        self,
                        prefix,
                        suffix,
                        start,
                Severity: Minor
                Found in plugins/OSE/__init__.py - About 1 hr to fix

                  Function GetFilePath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def GetFilePath(self):
                          sel = self.eventChoiceCtrl.GetSelectedRows()[0]
                          filePath = unicode(self.shortcuts[sel].decode(eg.systemEncoding))
                          if not filePath:
                              filePath = os.path.join(self.start,self.choices[sel])
                  Severity: Minor
                  Found in plugins/OSE/__init__.py - About 55 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

                  Function DefaultAction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def DefaultAction(self):
                          sel, filePath = self.GetFilePath()
                          eg.TriggerEvent(prefix = self.prefix, suffix = self.suffix, payload = filePath)
                          if os.path.isfile(filePath):
                              self.destroyMenu()
                  Severity: Minor
                  Found in plugins/OSE/__init__.py - About 55 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

                  Avoid deeply nested control flow statements.
                  Open

                                      if fnmatch(f,p.strip()):
                                          if not f in fs:
                                              fs.append((f,""))
                                          break
                          ds = CaseInsensitiveSort(ds)
                  Severity: Major
                  Found in plugins/OSE/__init__.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM):
                                            continue
                                    if os.path.isdir(path):
                    Severity: Major
                    Found in plugins/OSE/__init__.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if not fp:
                                                  fp = items[sel][0]
                      
                                                  #if fp == '..':
                                                  #    continue
                      Severity: Major
                      Found in plugins/OSE/__init__.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if os.path.isfile(fp):
                                                    fpList.append(fp)
                                        if folderSuff:
                        Severity: Major
                        Found in plugins/OSE/__init__.py - About 45 mins to fix

                          Function onFrameCharHook has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def onFrameCharHook(self, event):
                                  keyCode = event.GetKeyCode()
                                  if   keyCode in (wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER, wx.WXK_RIGHT, wx.WXK_NUMPAD_RIGHT):
                                      self.DefaultAction()
                                  elif keyCode in (wx.WXK_LEFT, wx.WXK_NUMPAD_LEFT):
                          Severity: Minor
                          Found in plugins/OSE/__init__.py - About 45 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

                          Avoid deeply nested control flow statements.
                          Open

                                                      if e.winerror == ERROR_ACCESS_DENIED:
                                                          eg.PrintError(self.plugin.text.accDeni % filePath)
                                                      else:
                                                          raise
                                          self.plugin.menuDlg.destroyMenu()
                          Severity: Major
                          Found in plugins/OSE/__init__.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if not "%s%s" % (folder_ID,f) in ds:
                                                    ds.append(("%s%s%s " % (shortcut_ID,folder_ID,f),path))
                                                    continue
                                            elif os.path.isfile(path):
                            Severity: Major
                            Found in plugins/OSE/__init__.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if e.winerror == ERROR_ACCESS_DENIED:
                                                              eg.PrintError(self.plugin.text.accDeni % filePath)
                                                          else:
                                                              raise
                                              if val&16: #go to the folder
                              Severity: Major
                              Found in plugins/OSE/__init__.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    for p in patterns:
                                                        if fnmatch(os.path.split(path)[1],p.strip()):
                                                            if not shortcut_ID+f in fs:
                                                                fs.append((shortcut_ID+f,path))
                                                            break
                                Severity: Major
                                Found in plugins/OSE/__init__.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM):
                                                          continue
                                                  for p in patterns:
                                  Severity: Major
                                  Found in plugins/OSE/__init__.py - About 45 mins to fix

                                    Function ShowMenu has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def ShowMenu(
                                    Severity: Minor
                                    Found in plugins/OSE/__init__.py - About 35 mins to fix

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

                                              def OnColourBtn(evt):
                                                  id = evt.GetId()
                                                  value = evt.GetValue()
                                                  if id == foreColourButton.GetId():
                                                      listBoxCtrl.SetForegroundColour(value)
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 2 other locations - About 7 hrs to fix
                                      plugins/OSM/__init__.py on lines 533..546
                                      plugins/OSM/__init__.py on lines 933..946

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

                                      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

                                      class MoveCursor(eg.ActionBase):
                                      
                                          class text:
                                              step = "Step size:"
                                      
                                      
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 6 hrs to fix
                                      plugins/OSM/__init__.py on lines 1034..1051

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

                                      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 Set(self, choices):
                                              oldLen = self.GetNumberRows()
                                              newLen = len(choices)
                                              h = self.GetDefaultRowSize()
                                              if oldLen > newLen:
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 6 hrs to fix
                                      plugins/OSM/__init__.py on lines 219..229

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

                                      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 val&512: #delete file
                                                          if GetFileAttributesW(filePath) & FILE_ATTRIBUTE_READONLY:
                                                              eg.PrintError(self.plugin.text.accDeni % filePath)
                                                          else:
                                                              try:
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 4 hrs to fix
                                      plugins/OSE/__init__.py on lines 785..794

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

                                      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 val&256: #delete file
                                                          if GetFileAttributesW(filePath) & FILE_ATTRIBUTE_READONLY:
                                                              eg.PrintError(self.plugin.text.accDeni % filePath)
                                                          else:
                                                              try:
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 4 hrs to fix
                                      plugins/OSE/__init__.py on lines 832..841

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

                                      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 4 locations. Consider refactoring.
                                      Open

                                      class MyTimer():
                                      
                                          def __init__(self, t, plugin):
                                              self.timer = Timer(t, self.Run)
                                              self.plugin = plugin
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 3 other locations - About 2 hrs to fix
                                      plugins/MediaPlayerClassic/__init__.py on lines 1299..1316
                                      plugins/OOo_Impress/__init__.py on lines 132..148
                                      plugins/RadioSure/__init__.py on lines 653..669

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

                                      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

                                                  try:
                                                      os.startfile(filePath)
                                                  except WindowsError, e:
                                                      if e.winerror == ERROR_NO_ASSOCIATION:
                                                          eg.PrintError(self.plugin.text.noAssoc % os.path.splitext(filePath)[1])
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 1 hr to fix
                                      plugins/OSE/__init__.py on lines 777..782

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

                                      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

                                                      if val&2: #open in associated
                                                          try:
                                                              os.startfile(filePath)
                                                          except WindowsError, e:
                                                              if e.winerror == ERROR_NO_ASSOCIATION:
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 1 hr to fix
                                      plugins/OSE/__init__.py on lines 1320..1324

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

                                      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

                                          class text:
                                              fileBoxLabel   = "Action with the file"
                                              folderBoxLabel = "Action with the folder"
                                              returnFile     = "Return path to the file as eg.result"
                                              openFile       = "Open the file in associated application"
                                      Severity: Major
                                      Found in plugins/OSE/__init__.py and 1 other location - About 1 hr to fix
                                      plugins/HID/__init__.py on lines 21..34

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

                                      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

                                          def __call__(self, val = 1):
                                              if self.plugin.menuDlg:
                                                  eg.event.skipEvent = True
                                                  if val < 2:
                                                      return self.plugin.menuDlg.GetValue()[val]
                                      Severity: Minor
                                      Found in plugins/OSE/__init__.py and 1 other location - About 55 mins to fix
                                      plugins/OSM/__init__.py on lines 1098..1104

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

                                      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

                                                      if filePath[-3:] == r"\..":
                                                          if len(filePath) == 5:
                                                              filePath = MY_COMPUTER
                                                          else:
                                                              filePath = os.path.split(filePath[:-3])[0]
                                      Severity: Minor
                                      Found in plugins/OSE/__init__.py and 1 other location - About 35 mins to fix
                                      plugins/OSE/__init__.py on lines 1301..1305

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

                                      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

                                                  if filePath[-3:] == r"\..":
                                                      if len(filePath) == 5:
                                                          filePath = MY_COMPUTER
                                                      else:
                                                          filePath = os.path.split(filePath[:-3])[0]
                                      Severity: Minor
                                      Found in plugins/OSE/__init__.py and 1 other location - About 35 mins to fix
                                      plugins/OSE/__init__.py on lines 804..808

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

                                      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