gbrltv/CDESF2

View on GitHub
cdesf/core/cdesf.py

Summary

Maintainability
C
1 day
Test Coverage

File cdesf.py has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import multiprocessing as mp
from typing import Union
from os import makedirs
from datetime import datetime
import networkx as nx
Severity: Minor
Found in cdesf/core/cdesf.py - About 4 hrs to fix

    Function initialize_cdesf has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize_cdesf(self) -> None:
            """
            Initializes system variables, creates the first Process Model Graph and initializes DenStream.
            Initializes graphics and metrics functions.
            """
    Severity: Minor
    Found in cdesf/core/cdesf.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 process_event has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def process_event(self, event):
            case_id = event["case:concept:name"]
            case_index = self.set_case(case_id, event)
            case = self.cases[case_index]
    
    
    Severity: Minor
    Found in cdesf/core/cdesf.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in cdesf/core/cdesf.py - About 1 hr to fix

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

          def check_for_drift(self):
              """
              Detects if a drift has occurred for each new event in the stream.
              If a new core behavior (represented by c-micro-clusters) appears,
              then a drift alert is triggered.
      Severity: Minor
      Found in cdesf/core/cdesf.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