EventGhost/EventGhost

View on GitHub
eg/Classes/Log.py

Summary

Maintainability
B
6 hrs
Test Coverage

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

    def __init__(self):
        self.logListeners = []
        self.eventListeners = []
        self.NativeLog = True
        self.buffer = ""
Severity: Minor
Found in eg/Classes/Log.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 PrintTraceback has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def PrintTraceback(self, msg=None, skip=0, source=None, excInfo=None):
        if msg:
            self.PrintError(msg, source=source)
        if excInfo is None:
            excInfo = sys.exc_info()
Severity: Minor
Found in eg/Classes/Log.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 _WriteLine has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _WriteLine(self, line, icon, wRef, when, indent):
Severity: Minor
Found in eg/Classes/Log.py - About 45 mins to fix

    Function _Print has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _Print(self, args, sep=" ", end="\n", icon=INFO_ICON, source=None):
    Severity: Minor
    Found in eg/Classes/Log.py - About 45 mins to fix

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

          def PrintTraceback(self, msg=None, skip=0, source=None, excInfo=None):
      Severity: Minor
      Found in eg/Classes/Log.py - About 35 mins to fix

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

            def WriteLine(self, line, icon, wRef, when, indent):
        Severity: Minor
        Found in eg/Classes/Log.py - About 35 mins to fix

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

          def _build_notice(icon, args):
              strs = [
                  str(eg.Tasklet.GetCurrentId()),
                  str(currentThread().getName()) + ":"
              ]
          Severity: Minor
          Found in eg/Classes/Log.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

          There are no issues that match your filters.

          Category
          Status