r3w0p/bobocep

View on GitHub

Showing 69 of 69 total issues

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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Major
Found in bobocep/cep/event/action.py - About 50 mins to fix

    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in bobocep/setup/simple.py - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (msg_flags & _FLAG_RESET) == _FLAG_RESET:
                                  d.flag_reset = False
      
      
      Severity: Major
      Found in bobocep/dist/tcp.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (not queue_empty) or (
                                        d.size_stash() > 0 and
                                        attempt_range >= self._attempt_stash
                                ):
                                    outlist.append((d, _TYPE_SYNC))
        Severity: Major
        Found in bobocep/dist/tcp.py - About 45 mins to fix

          Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self,
                           predicates: List[BoboPredicate],
                           group: str,
                           strict: bool,
                           loop: bool,
          Severity: Minor
          Found in bobocep/cep/phenom/pattern/pattern.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

          Avoid deeply nested control flow statements.
          Open

                                  if (
                                          (not pattern.singleton) or
                                          (pattern.singleton and len(runs) == 0)
                                  ):
                                      self._add_run(
          Severity: Major
          Found in bobocep/cep/engine/decider/decider.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if not task.update() and self._early_stop:
                                        break
            
            
            Severity: Major
            Found in bobocep/cep/engine/engine.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if run.is_halted():
                                          runs_to_remove.append((
                                              phenomenon_name, pattern_name, run.run_id))
                                          if run.is_complete():
                                              runs_halted_complete.append(run)
              Severity: Major
              Found in bobocep/cep/engine/decider/decider.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if attempt_range >= self._attempt_resync:
                                            outlist.append((d, _TYPE_RESYNC))
                
                                    # If device is within the "PING Period"
                                    # and there is nothing to SYNC...
                Severity: Major
                Found in bobocep/dist/tcp.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if runremote.run_id != runlocal.run_id:
                                              runlocalserial = runlocal.serialize()
                                              remlist[k] = runlocalserial
                  
                                              self._maybe_cache(
                  Severity: Major
                  Found in bobocep/cep/engine/decider/decider.py - About 45 mins to fix

                    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self,
                    Severity: Minor
                    Found in bobocep/cep/event/complex.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if i == 0:
                                                  remove_indices_completed.append(k)
                                              else:
                                                  remove_indices_halted.append(k)
                      
                      
                      Severity: Major
                      Found in bobocep/cep/engine/decider/decider.py - About 45 mins to fix

                        Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __init__(self,
                                         name: str,
                                         blocks: List[BoboPatternBlock],
                                         preconditions: List[BoboPredicate],
                                         haltconditions: List[BoboPredicate],
                        Severity: Minor
                        Found in bobocep/cep/phenom/pattern/pattern.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

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

                          Avoid deeply nested control flow statements.
                          Open

                                                  if attempt_range >= self._attempt_ping:
                                                      outlist.append((d, _TYPE_PING))
                          
                                              # If device is within the "SYNC Period"
                                              # or "PING Period" with something left to SYNC...
                          Severity: Major
                          Found in bobocep/dist/tcp.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not self._queue_outgoing.empty():
                                                        cache_sync = self._queue_outgoing.get_nowait()
                                                    else:
                                                        cache_sync = {
                                                            _KEY_COMPLETED: [],
                            Severity: Major
                            Found in bobocep/dist/tcp.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if (msg_flags & _FLAG_RESET) == _FLAG_RESET:
                                                          d.flag_reset = False
                                                  else:
                              Severity: Major
                              Found in bobocep/dist/tcp.py - About 45 mins to fix

                                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self,
                                Severity: Minor
                                Found in bobocep/cep/phenom/pattern/pattern.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (msg_flags & _FLAG_RESET) == _FLAG_RESET:
                                                              d.flag_reset = False
                                  
                                  
                                  Severity: Major
                                  Found in bobocep/dist/tcp.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language