r3w0p/bobocep

View on GitHub
bobocep/cep/engine/decider/run.py

Summary

Maintainability
C
1 day
Test Coverage
A
100%

Function _process_not_loop has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def _process_not_loop(self,
                          event: BoboEvent,
                          block: BoboPatternBlock,
                          temp_index: int) -> bool:
        """
Severity: Minor
Found in bobocep/cep/engine/decider/run.py - About 3 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

File run.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2019-2024 r3w0p
# The following code can be redistributed and/or
# modified under the terms of the MIT License.

"""
Severity: Minor
Found in bobocep/cep/engine/decider/run.py - About 2 hrs to fix

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

        def process(self, event: BoboEvent) -> bool:
            """
            :param event: An event for the run to process.
            :return: `True` if the event caused a state change in the run;
                `False` otherwise.
    Severity: Minor
    Found in bobocep/cep/engine/decider/run.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 _process_loop has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _process_loop(self,
                          event: BoboEvent,
                          block: BoboPatternBlock,
                          temp_index: int) -> bool:
            """
    Severity: Minor
    Found in bobocep/cep/engine/decider/run.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self,
    Severity: Minor
    Found in bobocep/cep/engine/decider/run.py - About 35 mins to fix

      Avoid too many return statements within this function.
      Open

                          return True
      Severity: Major
      Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return self._process_not_loop(event, block, temp_index)
        Severity: Major
        Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return self._process_loop(event, block, temp_index)
          Severity: Major
          Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return True
            Severity: Major
            Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return False
              Severity: Major
              Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return self._process_not_loop(event, block, temp_index)
                Severity: Major
                Found in bobocep/cep/engine/decider/run.py - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status