EventGhost/EventGhost

View on GitHub
plugins/Billy/__init__.py

Summary

Maintainability
F
2 wks
Test Coverage

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

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

version="0.3.5"

# Plugins/Billy/__init__.py
Severity: Major
Found in plugins/Billy/__init__.py - About 1 day to fix

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

        def Configure(self, BillyPath=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/Billy/__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 PlayFavFromMenu has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def PlayFavFromMenu(self):
            dir = self.BillyPath+'\\Favorites'
            dirpath = self.fav_path
            template = dir+'\\%s'
    
    
    Severity: Minor
    Found in plugins/Billy/__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 a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def Configure(
            self,
            fore = (0, 0, 0),
            back = (255, 255, 255),
            fontInfo = None,
    Severity: Minor
    Found in plugins/Billy/__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 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Configure(
            self,
            fore = (0, 0, 0),
            back = (255, 255, 255),
            fontInfo = None,
    Severity: Major
    Found in plugins/Billy/__init__.py - About 2 hrs to fix

      Function __call__ has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

            def __call__(
                self,
                fore = (0, 0, 0),
                back = (255, 255, 255),
                fontInfo = None,
        Severity: Minor
        Found in plugins/Billy/__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, BillyPath=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/Billy/__init__.py - About 1 hr to fix

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

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

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

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

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

                  def GetLabel(
              Severity: Major
              Found in plugins/Billy/__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/Billy/__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/Billy/__init__.py - About 50 mins to fix

                    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/Billy/__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 __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/Billy/__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, BillyPath=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/Billy/__init__.py and 1 other location - About 1 wk to fix
                    plugins/ScreamerRadio/__init__.py on lines 231..350

                    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/Billy/__init__.py and 1 other location - About 1 day to fix
                    plugins/ScreamerRadio/__init__.py on lines 987..998

                    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/Billy/__init__.py and 1 other location - About 4 hrs to fix
                    plugins/ScreamerRadio/__init__.py on lines 655..672

                    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/Billy/__init__.py and 1 other location - About 3 hrs to fix
                    plugins/ScreamerRadio/__init__.py on lines 717..740

                    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/Billy/__init__.py and 2 other locations - About 3 hrs to fix
                    eg/Classes/ColourSelectButton.py on lines 66..71
                    plugins/ScreamerRadio/__init__.py on lines 707..712

                    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

                                    listBoxCtrl = event.GetEventObject().GetParent().GetSizer().\
                    Severity: Major
                    Found in plugins/Billy/__init__.py and 1 other location - About 1 hr to fix
                    plugins/Billy/__init__.py on lines 397..397

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 73.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    listBoxCtrl = event.GetEventObject().GetParent().GetSizer().\
                    Severity: Major
                    Found in plugins/Billy/__init__.py and 1 other location - About 1 hr to fix
                    plugins/Billy/__init__.py on lines 465..465

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 73.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    class HotKeyAction(eg.ActionClass):
                        def __call__(self):
                            hwnds = FindBilly()
                            if len(hwnds) != 0:
                                eg.SendKeys(hwnds[0], self.value, True)
                    Severity: Major
                    Found in plugins/Billy/__init__.py and 1 other location - About 1 hr to fix
                    plugins/SplashLite/__init__.py on lines 220..227

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

                    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