r3w0p/bobocep

View on GitHub

Showing 69 of 69 total issues

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

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

        def _get_pattern(self,
                         phenomenon_name: str,
                         pattern_name: str) -> Optional[BoboPattern]:
            """
            :param phenomenon_name: A phenomenon name.
    Severity: Minor
    Found in bobocep/cep/engine/decider/decider.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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def execute(self, event: BoboEventComplex) \
                -> Tuple[bool, List[Tuple[bool, Any]]]:
            """
            :param event: The complex event that triggered the action.
    
    
    Severity: Minor
    Found in bobocep/cep/action/common/multi.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 _split_plaintext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _split_plaintext(self, plaintext: str) \
                -> Tuple[str, str, int, int, str]:
            """
            :param plaintext: The string to split.
            :return: Tuple containing: URN, ID, type, flags, and JSON message.
    Severity: Minor
    Found in bobocep/dist/tcp.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 _update_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _update_handler(self) -> bool:
            """
            :return: `True` if update occurred; `False` otherwise.
            """
            if not self._queue.empty():
    Severity: Minor
    Found in bobocep/cep/engine/forwarder/forwarder.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self,
                     phenomena: List[BoboPhenomenon],
                     gen_event_id: BoboGenEventID,
                     gen_run_id: BoboGenEventID,
                     max_cache: int = 0,
    Severity: Minor
    Found in bobocep/cep/engine/decider/decider.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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def update(self) -> bool:
            """
            Processes data from its queue, if any.
            Also processes a generated event if receiver is set to generate any.
            A BoboEventSimple instance is produced for data if they pass validation
    Severity: Minor
    Found in bobocep/cep/engine/receiver/receiver.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 all_runs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def all_runs(self) -> Tuple[BoboRun, ...]:
            """
            :return: All active runs in the decider.
            """
            with self._lock:
    Severity: Minor
    Found in bobocep/cep/engine/decider/decider.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 _maybe_cache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _maybe_cache(
                self,
                completed: List[BoboRunSerial],
                halted: List[BoboRunSerial]) -> None:
            """
    Severity: Minor
    Found in bobocep/cep/engine/decider/decider.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