EventGhost/EventGhost

View on GitHub
plugins/MediaPlayerClassic/__init__.py

Summary

Maintainability
F
2 mos
Test Coverage

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

# -*- coding: utf-8 -*-
#
# plugins/MediaPlayerClassic/__init__.py
#
# Copyright (C) 2006 MonsterMagnet
Severity: Major
Found in plugins/MediaPlayerClassic/__init__.py - About 6 days to fix

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

        def Configure(
            self,
            fore = (75, 75, 75),
            back = (180, 180, 180),
            fontInfo = arialInfoString,
    Severity: Minor
    Found in plugins/MediaPlayerClassic/__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

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

        def Configure(
            self,
            fore = (75, 75, 75),
            back = (180, 180, 180),
            fontInfo = arialInfoString,
    Severity: Major
    Found in plugins/MediaPlayerClassic/__init__.py - About 4 hrs to fix

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

          def Configure(
              self,
              fore = (75, 75, 75),
              back = (180, 180, 180),
              faceFont = "Courier New",
      Severity: Minor
      Found in plugins/MediaPlayerClassic/__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 Configure has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function ShowMenuEventsDialog has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def ShowMenuEventsDialog(self, title, labels):
                self.panel.Enable(False)
                self.panel.dialog.buttonRow.cancelButton.Enable(False)
                self.panel.EnableButtons(False)
                self.SetTitle(title)
        Severity: Major
        Found in plugins/MediaPlayerClassic/__init__.py - About 3 hrs to fix

          Function ShowGoToFrame has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              def ShowGoToFrame(
                  self,
                  fore,
                  back,
                  foreSel,
          Severity: Minor
          Found in plugins/MediaPlayerClassic/__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 ShowMenu has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def ShowMenu(
                  self,
                  fore,
                  back,
                  foreSel,
          Severity: Major
          Found in plugins/MediaPlayerClassic/__init__.py - About 2 hrs to fix

            Function ShowGoToFrame has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def ShowGoToFrame(
                    self,
                    fore,
                    back,
                    foreSel,
            Severity: Major
            Found in plugins/MediaPlayerClassic/__init__.py - About 2 hrs to fix

              Function Handler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def Handler(self, hwnd, mesg, wParam, lParam):
                      if not self.runFlg:
                          return True
                      cpyData = cast(lParam, PCOPYDATASTRUCT)
                      cmd = cpyData.contents.dwData
              Severity: Minor
              Found in plugins/MediaPlayerClassic/__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 onFrameCharHook has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  def onFrameCharHook(self, event):
                      keyCode = event.GetKeyCode()
                      if keyCode == wx.WXK_F4:
                          if event.AltDown():
                              self.destroyMenu()
              Severity: Minor
              Found in plugins/MediaPlayerClassic/__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 ShowMenu has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  def ShowMenu(
                      self,
                      fore,
                      back,
                      foreSel,
              Severity: Minor
              Found in plugins/MediaPlayerClassic/__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 ShowGoToFrame has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

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

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

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

                  def GetItemList(menu, hWnd):
                      SendMessage(hWnd, WM_INITMENUPOPUP, menu, 0) #REFRESH MENU STATE !!!
                      itemList = []
                      itemName = c_buffer("\000" * 128)
                      count = GetMenuItemCount(menu)
                  Severity: Minor
                  Found in plugins/MediaPlayerClassic/__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 __call__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

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

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

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

                      Function GetLabel has 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

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

                            def Configure(self, mode = 0, state = 5, evnt = False, prefix = "MPCHC.Window"):
                                self.stt = state
                                panel=eg.ConfigPanel(self)
                                topSizer = wx.StaticBoxSizer(
                                    wx.StaticBox(panel, -1, self.text.rbLabel),
                        Severity: Minor
                        Found in plugins/MediaPlayerClassic/__init__.py - About 1 hr to fix

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

                              def onFrameCharHook(self, event):
                                  keyCode = event.GetKeyCode()
                                  if keyCode == wx.WXK_F4:
                                      if event.AltDown():
                                          self.destroyMenu()
                          Severity: Minor
                          Found in plugins/MediaPlayerClassic/__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 Turn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def Turn(self, step):
                                  min = 0
                                  max = 9
                                  if self.pos == -1:
                                      self.GoTo()
                          Severity: Minor
                          Found in plugins/MediaPlayerClassic/__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 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

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

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

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

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

                                    def destroyMenu(self, event = None):
                                        cnt = self.messStack.count(817)
                                        if cnt:
                                            for i in range(4 - cnt):
                                                SendMessageTimeout(self.hWnd, WM_COMMAND, 817, 0)
                                Severity: Minor
                                Found in plugins/MediaPlayerClassic/__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 DrawMenu has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def DrawMenu(self, ix):
                                        self.Show(False)
                                        self.menuGridCtrl.SetGridCursor(ix, 1)
                                        self.menuGridCtrl.SelectRow(ix)
                                        monDim = GetMonitorDimensions()
                                Severity: Minor
                                Found in plugins/MediaPlayerClassic/__init__.py - About 1 hr to fix

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

                                      def DrawMenu(self, ix):
                                          self.Show(False)
                                          self.menuGridCtrl.SetGridCursor(ix, 1)
                                          self.menuGridCtrl.SelectRow(ix)
                                          monDim = GetMonitorDimensions()
                                  Severity: Minor
                                  Found in plugins/MediaPlayerClassic/__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 OnData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def OnData(self, dummyX, dummyY, dragResult):
                                          if self.GetData() and self.customData.GetDataSize() > 0:
                                              txt = self.customData.GetData()
                                              ix, evtList = self.object.GetEvtList()
                                              flag = True
                                  Severity: Minor
                                  Found in plugins/MediaPlayerClassic/__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 __call__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def __call__(self):
                                          if self.plugin.runFlg and self.plugin.mpcHwnd:
                                              try:
                                                  child = GetDlgItem(self.plugin.mpcHwnd, 10021)
                                                  if GetClassName(child) ==  "#32770":
                                  Severity: Minor
                                  Found in plugins/MediaPlayerClassic/__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 Configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def Configure(self, mode = 0, state = 5, evnt = False, prefix = "MPCHC.Window"):
                                          self.stt = state
                                          panel=eg.ConfigPanel(self)
                                          topSizer = wx.StaticBoxSizer(
                                              wx.StaticBox(panel, -1, self.text.rbLabel),
                                  Severity: Minor
                                  Found in plugins/MediaPlayerClassic/__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 GetWindowState has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def GetWindowState(self):
                                          hWnd = Find_MPC()
                                          if not hWnd:
                                              return -1
                                          else:
                                  Severity: Minor
                                  Found in plugins/MediaPlayerClassic/__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

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if keyCode == wx.WXK_F4:
                                              if event.AltDown():
                                                  self.destroyMenu()
                                          elif keyCode == wx.WXK_RETURN or keyCode == wx.WXK_NUMPAD_ENTER:
                                              self.DefaultAction()
                                  Severity: Major
                                  Found in plugins/MediaPlayerClassic/__init__.py - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if keyCode == wx.WXK_F4:
                                                if event.AltDown():
                                                    self.destroyMenu()
                                            elif keyCode == wx.WXK_RETURN or keyCode == wx.WXK_NUMPAD_ENTER:
                                                self.GoTo()
                                    Severity: Major
                                    Found in plugins/MediaPlayerClassic/__init__.py - About 40 mins to fix

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

                                          def __init__(self, parent, id, evtList, ix, plugin):
                                      Severity: Minor
                                      Found in plugins/MediaPlayerClassic/__init__.py - About 35 mins to fix

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

                                            def __call__(self, mode = 0, state = 5, evnt = False, prefix = "MPCHC.Window"):
                                        Severity: Minor
                                        Found in plugins/MediaPlayerClassic/__init__.py - About 35 mins to fix

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

                                              def Handler(self, hwnd, mesg, wParam, lParam):
                                          Severity: Minor
                                          Found in plugins/MediaPlayerClassic/__init__.py - About 35 mins to fix

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

                                                def Configure(self, mode = 0, state = 5, evnt = False, prefix = "MPCHC.Window"):
                                            Severity: Minor
                                            Found in plugins/MediaPlayerClassic/__init__.py - About 35 mins to fix

                                              Function Set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                  def Set(self, choices):
                                                      oldLen = self.GetNumberRows()
                                                      newLen = len(choices)
                                                      h = self.GetDefaultRowSize()
                                                      if oldLen > newLen:
                                              Severity: Minor
                                              Found in plugins/MediaPlayerClassic/__init__.py - About 35 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 ShowMenuEventsDialog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                  def ShowMenuEventsDialog(self, title, labels):
                                                      self.panel.Enable(False)
                                                      self.panel.dialog.buttonRow.cancelButton.Enable(False)
                                                      self.panel.EnableButtons(False)
                                                      self.SetTitle(title)
                                              Severity: Minor
                                              Found in plugins/MediaPlayerClassic/__init__.py - About 35 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 Configure has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                  def Configure(self, mode = 0, state = 0):
                                                      self.stt = state
                                                      panel=eg.ConfigPanel(self)
                                                      topSizer = wx.StaticBoxSizer(
                                                          wx.StaticBox(panel, -1, self.text.rbLabel),
                                              Severity: Minor
                                              Found in plugins/MediaPlayerClassic/__init__.py - About 35 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 too many return statements within this function.
                                              Open

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

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

                                                    def destroyMenu(self):
                                                        if self.flag:
                                                            self.timer.Cancel()
                                                        for evt in self.evtList[0]:
                                                            eg.Unbind(evt, self.onUp)
                                                Severity: Minor
                                                Found in plugins/MediaPlayerClassic/__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

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

                                                    def __stop__(self):
                                                        if self.mySched:
                                                            try:
                                                                eg.scheduler.CancelTask(self.mySched)
                                                            except:
                                                Severity: Minor
                                                Found in plugins/MediaPlayerClassic/__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

                                                TODO found
                                                Open

                                                CMD_REMOVEFROMPLAYLIST  = 0xA0001003    # TODO

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

                                                class MenuEventsDialog(wx.MiniFrame):
                                                
                                                    def __init__(self, parent, plugin):
                                                        wx.MiniFrame.__init__(
                                                            self,
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 2 wks to fix
                                                plugins/RadioSure/__init__.py on lines 3370..3538

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

                                                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 EventListCtrl(wx.ListCtrl):
                                                
                                                    def __init__(self, parent, id, evtList, ix, plugin):
                                                        width = 205
                                                        wx.ListCtrl.__init__(self, parent, id, style=wx.LC_REPORT |
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 1 wk to fix
                                                plugins/OOo_Impress/__init__.py on lines 405..488

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

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                class MenuGrid(gridlib.Grid):
                                                
                                                    def __init__(self, parent, lngth):
                                                        gridlib.Grid.__init__(self, parent)
                                                        self.SetRowLabelSize(0)
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 6 days to fix
                                                plugins/RadioSure/__init__.py on lines 3177..3250

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

                                                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 DrawMenu(self, ix):
                                                        self.Show(False)
                                                        self.menuGridCtrl.SetGridCursor(ix, 1)
                                                        self.menuGridCtrl.SelectRow(ix)
                                                        monDim = GetMonitorDimensions()
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 5 days to fix
                                                plugins/RadioSure/__init__.py on lines 3646..3687

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

                                                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 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/MediaPlayerClassic/__init__.py and 2 other locations - About 1 day to fix
                                                plugins/OOo_Impress/__init__.py on lines 1244..1265
                                                plugins/RadioSure/__init__.py on lines 6037..6058

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

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

                                                class MyTextDropTarget(EventDropTarget):
                                                
                                                    def __init__(self, object):
                                                        EventDropTarget.__init__(self, object)
                                                        self.object = object
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 2 other locations - About 1 day to fix
                                                plugins/OOo_Impress/__init__.py on lines 374..401
                                                plugins/RadioSure/__init__.py on lines 3253..3280

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

                                                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 OnFontBtn(evt):
                                                            value = evt.GetValue()
                                                            self.fontInfo = value
                                                            font = wx.FontFromNativeInfoString(value)
                                                            for n in range(10,20):
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 1 day to fix
                                                plugins/RadioSure/__init__.py on lines 6018..6034

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

                                                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 OnInverted(evt):
                                                            flag = evt.IsChecked()
                                                            foreSelLbl.Enable(not flag)
                                                            foreSelColourButton.Enable(not flag)
                                                            backSelLbl.Enable(not flag)
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 1 day to fix
                                                plugins/RadioSure/__init__.py on lines 5988..6003

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

                                                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 Configure(self, action = -1):
                                                        panel = eg.ConfigPanel()
                                                        label = wx.StaticText(panel, -1, self.text.label)
                                                        ctrl = wx.Choice(panel, -1, choices = self.text.choices)
                                                        eg.EqualizeWidths((label, ctrl))
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 6 hrs to fix
                                                plugins/MediaPlayerClassic/__init__.py on lines 1386..1395

                                                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

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

                                                    def Configure(self, action = -1):
                                                        panel = eg.ConfigPanel()
                                                        label = wx.StaticText(panel, -1, self.text.label)
                                                        ctrl = wx.Choice(panel, -1, choices = self.text.choices)
                                                        eg.EqualizeWidths((label, ctrl))
                                                Severity: Major
                                                Found in plugins/MediaPlayerClassic/__init__.py and 1 other location - About 6 hrs to fix
                                                plugins/MediaPlayerClassic/__init__.py on lines 1345..1354

                                                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 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/MediaPlayerClassic/__init__.py and 3 other locations - About 2 hrs to fix
                                                plugins/OOo_Impress/__init__.py on lines 132..148
                                                plugins/OSE/__init__.py on lines 1373..1390
                                                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

                                                There are no issues that match your filters.

                                                Category
                                                Status