c0fec0de/pyebus

View on GitHub
pyebus/msgdef.py

Summary

Maintainability
A
3 hrs
Test Coverage

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

    def __new__(cls, circuit, name, children, read=False, prio=None, write=False, update=False, setprio=None):
Severity: Major
Found in pyebus/msgdef.py - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (self.circuit, self.name, self.children) == (msgdef.circuit, msgdef.name, msgdef.children):
                return self.replace(
                    read=self.read or msgdef.read,
                    prio=self.prio or msgdef.prio,
                    write=self.write or msgdef.write,
    Severity: Major
    Found in pyebus/msgdef.py - About 40 mins to fix

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

          def __new__(cls, name, type_, func, unit=None, comment=None):
      Severity: Minor
      Found in pyebus/msgdef.py - About 35 mins to fix

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

            def __new__(cls, idx, name, type_, unit=None, comment=None):
        Severity: Minor
        Found in pyebus/msgdef.py - About 35 mins to fix

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

          def resolve_prio(msgdef, setprio=AUTO):
              """
              Resolve priority specification.
          
              Integer values are just passed through.
          Severity: Minor
          Found in pyebus/msgdef.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

          There are no issues that match your filters.

          Category
          Status