c0fec0de/pyebus

View on GitHub
pyebus/msgdefs.py

Summary

Maintainability
B
4 hrs
Test Coverage

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

    def _resolve(self, pattern):
        pat = Pattern.from_str(pattern)
        circuit, name, setprio, fieldname = pat
        for msgdef in self.find(circuit, name):
            if fieldname is None:
Severity: Minor
Found in pyebus/msgdefs.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 set_defaultprio has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def set_defaultprio(self, defaultprio):
        """Set Priorities of all messages without a priority value."""
        msgdefs = self._msgdefs
        for circuitmsgdefs in msgdefs.values():
            for msgdefs in circuitmsgdefs.values():
Severity: Minor
Found in pyebus/msgdefs.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 resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def resolve(self, patterns, filter_=None):
        """
        Resolve patterns and filter message definitions.

        Returns:
Severity: Minor
Found in pyebus/msgdefs.py - About 45 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 __sub__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __sub__(self, other):
        if self.__class__ is other.__class__:
            msgdefs = MsgDefs()
            othermsgs = tuple(other)
            for msgdef in self:
Severity: Minor
Found in pyebus/msgdefs.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