EventGhost/EventGhost

View on GitHub
plugins/ScreamerRadio/__init__.py

Summary

Maintainability
F
2 wks
Test Coverage

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

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

version="0.1.6"

# plugins/ScreamerRadio/__init__.py
Severity: Major
Found in plugins/ScreamerRadio/__init__.py - About 2 days to fix

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

        def Configure(self, ScreamerPath=None, path2 = None):
            panel = eg.ConfigPanel(self)
            label1Text = wx.StaticText(panel, -1, self.text.label1)
            label2Text = wx.StaticText(panel, -1, self.text.label2)
            filepathCtrl = MyDirBrowseButton(
    Severity: Minor
    Found in plugins/ScreamerRadio/__init__.py - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __call__(self, play=False, fav = 1):
            flag = self.plugin.Execute('screamer.exe',self.plugin.ScreamerPath)
            if self.plugin.path2:
                self.plugin.Execute('Start_SR_Events.exe',self.plugin.path2)
    
    
    Severity: Minor
    Found in plugins/ScreamerRadio/__init__.py - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def Configure(
            self,
            fore = (0, 0, 0),
            back = (255, 255, 255),
            fontInfo = None
    Severity: Minor
    Found in plugins/ScreamerRadio/__init__.py - About 1 hr to fix

      Function Show_OSM has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def Show_OSM(
              self,
              fore,
              back,
              fontInfo,
      Severity: Minor
      Found in plugins/ScreamerRadio/__init__.py - About 1 hr to fix

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

            def __call__(self,volume):
                FindWindow = FindWindowFunction(u'Slider1',u'msctls_trackbar32',1)
                hwnds = FindWindow()
                if len(hwnds) != 0:
                    vol=SendMessageTimeout(hwnds[0], TBM_GETPOS, 0, 0)
        Severity: Minor
        Found in plugins/ScreamerRadio/__init__.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            def Configure(self, ScreamerPath=None, path2 = None):
                panel = eg.ConfigPanel(self)
                label1Text = wx.StaticText(panel, -1, self.text.label1)
                label2Text = wx.StaticText(panel, -1, self.text.label2)
                filepathCtrl = MyDirBrowseButton(
        Severity: Minor
        Found in plugins/ScreamerRadio/__init__.py - About 1 hr to fix

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

                  def __init__(
          Severity: Major
          Found in plugins/ScreamerRadio/__init__.py - About 50 mins to fix

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

                    def __init__(
            Severity: Major
            Found in plugins/ScreamerRadio/__init__.py - About 50 mins to fix

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

                  def Show_OSM(
                      self,
                      fore,
                      back,
                      fontInfo,
              Severity: Minor
              Found in plugins/ScreamerRadio/__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

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

                      def OnButton(self, event):
                          data = wx.FontData()
                          if self.fontInfo is not None:
                              font = wx.FontFromNativeInfoString(self.fontInfo)
                              data.SetInitialFont(font)
              Severity: Minor
              Found in plugins/ScreamerRadio/__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

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

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

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

                    def __call__(self):
                        key = eval("self.plugin.dh.document[self.value[0]]")
                        FindWindow = FindWindowFunction(key,u'Button',1)
                        hwnds = FindWindow()
                        if self.value[1] != "": #for toggle actions
                Severity: Minor
                Found in plugins/ScreamerRadio/__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 __call__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __call__(self):
                        if self.plugin.menuDlg is not None:
                            max=len(self.plugin.favList)
                            if max > 0:
                                sel=self.plugin.menuDlg.GetSizer().GetChildren()[0].\
                Severity: Minor
                Found in plugins/ScreamerRadio/__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 Configure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def Configure(
                        self,
                        fore = (0, 0, 0),
                        back = (255, 255, 255),
                        fontInfo = None
                Severity: Minor
                Found in plugins/ScreamerRadio/__init__.py - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    def Configure(self, ScreamerPath=None, path2 = None):
                        panel = eg.ConfigPanel(self)
                        label1Text = wx.StaticText(panel, -1, self.text.label1)
                        label2Text = wx.StaticText(panel, -1, self.text.label2)
                        filepathCtrl = MyDirBrowseButton(
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 1 wk to fix
                plugins/Billy/__init__.py on lines 181..300

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

                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 MoveCursor(eg.ActionClass):
                
                    def __call__(self):
                        if self.plugin.menuDlg is not None:
                            max=len(self.plugin.favList)
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 1 day to fix
                plugins/Billy/__init__.py on lines 785..796

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

                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 __init__(
                            self,
                            id = -1,
                            value=(255, 255, 255),
                            name="ColourSelectButton",
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 4 hrs to fix
                plugins/Billy/__init__.py on lines 365..382

                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

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

                        def __init__(
                            self,
                            fontInfo = None,
                            id=-1,
                            pos=wx.DefaultPosition,
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 3 hrs to fix
                plugins/Billy/__init__.py on lines 426..449

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

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

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

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

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

                Refactorings

                Further Reading

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

                        def SetValue(self, value):
                            self.value = value
                            w, h = self.GetSize()
                            image = wx.EmptyImage(w-10, h-10)
                            image.SetRGBRect((1, 1, w-12, h-12), *value)
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 2 other locations - About 3 hrs to fix
                eg/Classes/ColourSelectButton.py on lines 66..71
                plugins/Billy/__init__.py on lines 416..421

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

                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 fav <= len(self.plugin.favList):
                                            self.plugin.fav_num=fav-1
                                            PostMessage(hwnds[0], WM_COMMAND, 9216+fav, 0)
                                            return str(fav)+": "+self.plugin.favList[self.plugin.fav_num]
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 1 hr to fix
                plugins/ScreamerRadio/__init__.py on lines 579..582

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

                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 fav <= len(self.plugin.favList):
                                self.plugin.fav_num=fav-1
                                PostMessage(hwnds[0], WM_COMMAND, 9216+fav, 0)
                                return str(fav)+": "+self.plugin.favList[self.plugin.fav_num]
                Severity: Major
                Found in plugins/ScreamerRadio/__init__.py and 1 other location - About 1 hr to fix
                plugins/ScreamerRadio/__init__.py on lines 383..386

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

                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