KarrLab/de_sim

View on GitHub

Showing 22 of 22 total issues

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

    def register_handlers(subclass, handlers):
        """ Register a :class:`BaseSimulationObject`'s event handler methods.

        The simulator vectors execution of an event message to the message's registered
        event handler method. The priority of message execution in an event containing multiple messages
Severity: Minor
Found in de_sim/simulation_object.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

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

    def render(self, round_w_direction=False, annotated=False, as_list=False, separator='\t'):
        """ Format the contents of an :obj:`Event`

        Rendering the contents assumes that `sending_object` and `receiving_object`
        have name attributes.
Severity: Minor
Found in de_sim/event.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

Severity
Category
Status
Source
Language