EventGhost/EventGhost

View on GitHub
plugins/IrfanView/__init__.py

Summary

Maintainability
F
1 wk
Test Coverage

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

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

version="0.2.5"

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

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

        def Configure(self, kwargs={}):
            options = self.defaults.copy()
            options.update(kwargs)
            panel = eg.ConfigPanel(self)
            radioBoxfullOrWin = wx.RadioBox(
    Severity: Major
    Found in plugins/IrfanView/__init__.py - About 5 hrs to fix

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

          def Configure(self, kwargs={}):
              options = self.defaults.copy()
              options.update(kwargs)
              panel = eg.ConfigPanel(self)
              radioBoxMode = wx.RadioBox(
      Severity: Major
      Found in plugins/IrfanView/__init__.py - About 4 hrs to fix

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

            def Configure(self, kwargs={}):
                options = self.defaults.copy()
                options.update(kwargs)
                panel = eg.ConfigPanel(self)
                radioBoxMode = wx.RadioBox(
        Severity: Minor
        Found in plugins/IrfanView/__init__.py - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            def __init__(self):
                self.AddAction(RunDefault)
                self.AddAction(RunCommandLine)
                self.AddAction(RunSlideshow)
                self.AddAction(RunWithOptions)
        Severity: Minor
        Found in plugins/IrfanView/__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 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __call__(self, kwargs):
                options = self.defaults.copy()
                options.update(kwargs)
                head, tail = os.path.split(self.plugin.IrfanViewPath)
                cp = SafeConfigParser()
        Severity: Minor
        Found in plugins/IrfanView/__init__.py - About 1 hr to fix

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

              def __call__(self, kwargs):
                  options = self.defaults.copy()
                  options.update(kwargs)
                  head, tail = os.path.split(self.plugin.IrfanViewPath)
                  cp = SafeConfigParser()
          Severity: Minor
          Found in plugins/IrfanView/__init__.py - About 1 hr to fix

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

                def __call__(self, kwargs):
                    options = self.defaults.copy()
                    options.update(kwargs)
                    head, tail = os.path.split(self.plugin.IrfanViewPath)
                    cp = SafeConfigParser()
            Severity: Minor
            Found in plugins/IrfanView/__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, kwargs):
                    options = self.defaults.copy()
                    options.update(kwargs)
                    head, tail = os.path.split(self.plugin.IrfanViewPath)
                    cp = SafeConfigParser()
            Severity: Minor
            Found in plugins/IrfanView/__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

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

                class text:
                    err ="Couldn't find file i_view32.exe !"
                    runwithoption = "Run with option "
                    radioboxmode = "Starting mode"
                    modeWin = "Window"
            Severity: Major
            Found in plugins/IrfanView/__init__.py and 1 other location - About 1 day to fix
            plugins/RadioSure/__init__.py on lines 331..388

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

            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

                ("OpenDialog","Show open dialog","Show open dialog.",u'{O}'),
                ("ShowNextPgOrFile","Show next page OR file","Show next page in a multipage image OR load next file in directory.",u'{Ctrl+PgDown}'),
                ("ShowPrevPgOrFile","Show previous page OR file","Show previous page in a multipage image OR load previous file in directory.",u'{Ctrl+PgUp}'),
                ("ScrollRight","Scroll right","Scroll image right OR next image in directory.",u'{Right}'),
                ("ScrollLeft","Scroll left","Scroll image left OR previous image in directory.",u'{Left}'),
            Severity: Major
            Found in plugins/IrfanView/__init__.py and 1 other location - About 1 day to fix
            plugins/XBMCRepeat/__init__.py on lines 191..215

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 151.

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

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

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

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

            Refactorings

            Further Reading

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

                ("ShowInformation","Show image information","Show image information.",u'{I}'),
                ("RotateLeft","Rotate left","Rotate left.",u'{L}'),
                ("RotateRight","Rotate right","Rotate right.",u'{R}'),
                ("RotateAngle","User/Fine rotation","Rotate by angle.",u'{Ctrl+U}'),
                ("VerticalFlip","Vertical flip","Vertical flip.",u'{V}'),
            Severity: Major
            Found in plugins/IrfanView/__init__.py and 1 other location - About 3 hrs to fix
            plugins/XBMCRepeat/__init__.py on lines 262..277

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 97.

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

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

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

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

            Refactorings

            Further Reading

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

                ("LoadNextFile","Next file in directory","Load next file in directory.",u'{Space}'),
                ("LoadPrevFile","Previous file in directory","Load previous file in directory.",u'{Backspace}'),
                #("LoadFirstFile","Load first file","Load first file in the directory.",u'{Ctrl+Home}'),
                #("LoadLastFile","Load last file","Load last file in the directory.",u'{Ctrl+End}'),
                ("OpenRandomImage","Open random image","Open random image from the directory.",u'{Ctrl+M}'),
            Severity: Major
            Found in plugins/IrfanView/__init__.py and 1 other location - About 3 hrs to fix
            plugins/IrfanView/__init__.py on lines 127..142

            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

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

                ("ReopenFile","Reopen file","Reopen file.",u'{Shift+R}'),
                ("OpenInExternal","Open in external","Open in external viewer/editor.",u'{Shift+E}'),
                ("Thumbnails","Thumbnails","Thumbnails.",u'{T}'),
                ("SlideshowDialog","Show Slideshow dialog","Show Slideshow dialog.",u'{W}'),
                ("BatchConversionRename","Batch Conversion/Rename","Batch Conversion/Rename.",u'{B}'),
            Severity: Major
            Found in plugins/IrfanView/__init__.py and 1 other location - About 3 hrs to fix
            plugins/IrfanView/__init__.py on lines 192..214

            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 cp.has_option('Others','INI_Folder'):
                        INI_Folder = cp.get('Others','INI_Folder',True)
                        if INI_Folder == '%APPDATA%\\IrfanView':
                            INI_Folder = eg.folderPath.RoamingAppData+"\\IrfanView\\"
                        cp.read(INI_Folder+"\\i_view32.ini")
            Severity: Minor
            Found in plugins/IrfanView/__init__.py and 1 other location - About 50 mins to fix
            plugins/IrfanView/__init__.py on lines 941..945

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 64.

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

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

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

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

            Refactorings

            Further Reading

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

                    if cp.has_option('Others','INI_Folder'):
                        INI_Folder = cp.get('Others','INI_Folder',True)
                        if INI_Folder == '%APPDATA%\\IrfanView':
                            INI_Folder = eg.folderPath.RoamingAppData+"\\IrfanView\\"
                        cp.read(INI_Folder+"\\i_view32.ini")
            Severity: Minor
            Found in plugins/IrfanView/__init__.py and 1 other location - About 50 mins to fix
            plugins/IrfanView/__init__.py on lines 484..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 64.

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

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

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

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

            Refactorings

            Further Reading

            There are no issues that match your filters.

            Category
            Status