EventGhost/EventGhost

View on GitHub
eg/Classes/PluginInstanceInfo.py

Summary

Maintainability
A
3 hrs
Test Coverage

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

    def CreateInstance(self, args, evalName, treeItem):
        self.args = args
        self.treeItem = treeItem
        self.actions = {}
        pluginCls = self.pluginCls
Severity: Minor
Found in eg/Classes/PluginInstanceInfo.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 CreateInstance has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def CreateInstance(self, args, evalName, treeItem):
        self.args = args
        self.treeItem = treeItem
        self.actions = {}
        pluginCls = self.pluginCls
Severity: Minor
Found in eg/Classes/PluginInstanceInfo.py - About 1 hr to fix

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

        def FromModuleInfo(cls, moduleInfo):
            self = cls.__new__(cls)
            self.__dict__.update(moduleInfo.__dict__)
            pathname = join(self.path, "__init__.py")
            if not exists(pathname):
    Severity: Minor
    Found in eg/Classes/PluginInstanceInfo.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 DeleteActionListItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def DeleteActionListItems(self, items):
            if items is None:
                return
            for item in items:
                if isinstance(item, type) and issubclass(item, eg.ActionBase):
    Severity: Minor
    Found in eg/Classes/PluginInstanceInfo.py - About 25 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    TODO found
    Open

            # TODO: the text class should be referenced by the GUID instead of
    Severity: Minor
    Found in eg/Classes/PluginInstanceInfo.py by fixme

    There are no issues that match your filters.

    Category
    Status