opensistemas-hub/osbrain

View on GitHub
osbrain/helper.py

Summary

Maintainability
B
4 hrs
Test Coverage

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

def logger_received(
    logger, message, log_name='log_history_info', position=None, timeout=1.0
):
    """
    Check if a logger receives a message.
Severity: Minor
Found in osbrain/helper.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 wait_agent_condition has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def wait_agent_condition(agent, condition, *args, timeout=3, **kwargs):
Severity: Minor
Found in osbrain/helper.py - About 35 mins to fix

    Function attribute_match_all has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def attribute_match_all(
    Severity: Minor
    Found in osbrain/helper.py - About 35 mins to fix

      Function wait_condition has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def wait_condition(condition, *args, negate=False, timeout=3, **kwargs):
      Severity: Minor
      Found in osbrain/helper.py - About 35 mins to fix

        Function logger_received has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def logger_received(
        Severity: Minor
        Found in osbrain/helper.py - About 35 mins to fix

          Avoid too many return statements within this function.
          Open

              return True
          Severity: Major
          Found in osbrain/helper.py - About 30 mins to fix

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

            def attribute_match_all(
                attribute, length=None, data=None, value=None, endswith=None
            ):
                """
                Check if an attribute matches all of the following specified conditions:
            Severity: Minor
            Found in osbrain/helper.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 agent_dies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def agent_dies(agent, nsproxy, timeout=1.0):
                """
                Check if an agent dies within a given period.
            
                Parameters
            Severity: Minor
            Found in osbrain/helper.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

            There are no issues that match your filters.

            Category
            Status