EventGhost/EventGhost

View on GitHub
plugins/Multitap/__init__.py

Summary

Maintainability
F
1 wk
Test Coverage

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

    def Configure(self, config='',listKs=[]):
        self.config = config
        self.listKeys = listKs[:]
        text = self.text
        panel = eg.ConfigPanel(self)
Severity: Minor
Found in plugins/Multitap/__init__.py - About 2 days to fix

Cognitive Complexity

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

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

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

Further reading

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

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

version = "0.1.14"

# Copyright (C) 2008, 2009  Pako <lubos.ruckl@quick.cz>
Severity: Major
Found in plugins/Multitap/__init__.py - About 2 days to fix

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

        def Configure(
            self,
            configs=[],
        ):
            def boxEnable(enable):
    Severity: Minor
    Found in plugins/Multitap/__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 showOsDialog has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        def showOsDialog(self):
            if not self.osd:
                return
            def setOsDialog():
                frg = ctrlEvtString.GetForegroundColour()
    Severity: Minor
    Found in plugins/Multitap/__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 Multitapper has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def Multitapper(self,config,keys):
            self.timer.cancel()
            try:
                indx = [n[0] for n in self.configs].index(config)
                item = self.configs[indx]
    Severity: Minor
    Found in plugins/Multitap/__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 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def Configure(
            self,
            configs=[],
        ):
            def boxEnable(enable):
    Severity: Major
    Found in plugins/Multitap/__init__.py - About 3 hrs to fix

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

          def OnBackSpace(self):
              if len(self.evtString) > 0:
                  self.timer.cancel()
                  if self.mode != 2:
                      if self.pos > 0:
      Severity: Minor
      Found in plugins/Multitap/__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

      Avoid deeply nested control flow statements.
      Open

                                      if self.listKeys.count(label)==1:
                                          flag = True
                                  panel.EnableButtons(flag)
      Severity: Major
      Found in plugins/Multitap/__init__.py - About 45 mins to fix

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

            def TriggerEvt(self):
                if self.evtString != '':
                    if self.formatEvent:
                        self.TriggerEvent(self.evtName, self.evtString)
                    else:
        Severity: Minor
        Found in plugins/Multitap/__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 OnEnter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def OnEnter(self):
                self.timer.cancel()
                if self.mode < 3:
                    if self.oldKeys != '':
                        if self.mode!=2:
        Severity: Minor
        Found in plugins/Multitap/__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

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

        def Move(lst,index,direction):
            tmpList = lst[:]
            max = len(lst)-1
            #Last to first position, other down
            if index == max and direction == 1:
        Severity: Major
        Found in plugins/Multitap/__init__.py and 2 other locations - About 1 day to fix
        plugins/E-mail/__init__.py on lines 364..381
        plugins/RemoteEventMapper/__init__.py on lines 994..1011

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

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

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

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

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

        Refactorings

        Further Reading

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

                if len(self.configs) > 0:
                    listBoxCtrl.Set([n[0] for n in self.configs])
                    listBoxCtrl.SetSelection(0)
                    setValue(self.configs[0])
                    self.oldSel=0
        Severity: Major
        Found in plugins/Multitap/__init__.py and 1 other location - About 6 hrs to fix
        plugins/E-mail/__init__.py on lines 3754..3765

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

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

                if w1 > w2:
                    btnDEL=wx.Button(panel,-1,text.delete)
                    btnApp=wx.Button(panel,-1,text.insert,size=btnDEL.GetSize())
                else:
                    btnApp=wx.Button(panel,-1,text.insert)
        Severity: Major
        Found in plugins/Multitap/__init__.py and 4 other locations - About 2 hrs to fix
        plugins/E-mail/__init__.py on lines 1171..1176
        plugins/E-mail/__init__.py on lines 1483..1488
        plugins/E-mail/__init__.py on lines 3741..3746
        plugins/Multitap/__init__.py on lines 298..303

        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

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

                            if w1 > w2:
                                btnDEL=wx.Button(panel,-1,text.delete)
                                btnApp=wx.Button(panel,-1,text.insert,size=btnDEL.GetSize())
                            else:
                                btnApp=wx.Button(panel,-1,text.insert)
        Severity: Major
        Found in plugins/Multitap/__init__.py and 4 other locations - About 2 hrs to fix
        plugins/E-mail/__init__.py on lines 1171..1176
        plugins/E-mail/__init__.py on lines 1483..1488
        plugins/E-mail/__init__.py on lines 3741..3746
        plugins/Multitap/__init__.py on lines 936..941

        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

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

                def onButtonDown(evt):
                    newSel,self.configs=Move(self.configs,listBoxCtrl.GetSelection(),1)
                    listBoxCtrl.Set([n[0] for n in self.configs])
                    listBoxCtrl.SetSelection(newSel)
                    self.oldSel = newSel
        Severity: Major
        Found in plugins/Multitap/__init__.py and 9 other locations - About 1 hr to fix
        plugins/E-mail/__init__.py on lines 1322..1327
        plugins/E-mail/__init__.py on lines 1330..1335
        plugins/E-mail/__init__.py on lines 1602..1607
        plugins/E-mail/__init__.py on lines 1610..1615
        plugins/E-mail/__init__.py on lines 1911..1916
        plugins/E-mail/__init__.py on lines 1919..1924
        plugins/E-mail/__init__.py on lines 3937..3942
        plugins/E-mail/__init__.py on lines 3945..3950
        plugins/Multitap/__init__.py on lines 994..999

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

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

                def onButtonUp(evt):
                    newSel,self.configs=Move(self.configs,listBoxCtrl.GetSelection(),-1)
                    listBoxCtrl.Set([n[0] for n in self.configs])
                    listBoxCtrl.SetSelection(newSel)
                    self.oldSel = newSel
        Severity: Major
        Found in plugins/Multitap/__init__.py and 9 other locations - About 1 hr to fix
        plugins/E-mail/__init__.py on lines 1322..1327
        plugins/E-mail/__init__.py on lines 1330..1335
        plugins/E-mail/__init__.py on lines 1602..1607
        plugins/E-mail/__init__.py on lines 1610..1615
        plugins/E-mail/__init__.py on lines 1911..1916
        plugins/E-mail/__init__.py on lines 1919..1924
        plugins/E-mail/__init__.py on lines 3937..3942
        plugins/E-mail/__init__.py on lines 3945..3950
        plugins/Multitap/__init__.py on lines 1002..1007

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

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

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

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

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

        Refactorings

        Further Reading

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

                            if len(self.listKeys) > 0:
                                listBoxCtrl.Set(self.listKeys)
                                listBoxCtrl.SetSelection(0)
                                labelCtrl.SetValue(self.listKeys[0])
                                self.oldSel=0
        Severity: Major
        Found in plugins/Multitap/__init__.py and 1 other location - About 1 hr to fix
        plugins/RemoteEventMapper/__init__.py on lines 1095..1102

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

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

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

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

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

        Refactorings

        Further Reading

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

                        if label.strip()<>"":
                            if event.strip()<>"":
                                if [n[0] for n in self.configs].count(label)==1:
                                    flag = True
        Severity: Minor
        Found in plugins/Multitap/__init__.py and 1 other location - About 55 mins to fix
        plugins/OSM/__init__.py on lines 635..638

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 65.

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

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

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

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

        Refactorings

        Further Reading

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

                            def OnButtonUp(evt):
                                newSel,self.listKeys=Move(self.listKeys,listBoxCtrl.GetSelection(),-1)
                                listBoxCtrl.Set(self.listKeys)
                                listBoxCtrl.SetSelection(newSel)
                                self.oldSel = newSel
        Severity: Minor
        Found in plugins/Multitap/__init__.py and 1 other location - About 40 mins to fix
        plugins/Multitap/__init__.py on lines 364..369

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

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

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

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

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

        Refactorings

        Further Reading

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

                            def OnButtonDown(evt):
                                newSel,self.listKeys=Move(self.listKeys,listBoxCtrl.GetSelection(),1)
                                listBoxCtrl.Set(self.listKeys)
                                listBoxCtrl.SetSelection(newSel)
                                self.oldSel = newSel
        Severity: Minor
        Found in plugins/Multitap/__init__.py and 1 other location - About 40 mins to fix
        plugins/Multitap/__init__.py on lines 356..361

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

        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