best-doctor/Mario

View on GitHub

Showing 3 of 3 total issues

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

def is_instance_of_type(_object: Any, required_type: Type) -> Optional[bool]:
    """
    Check if `object` is of type `required_type`.

    Works same as `isinstance`, but also has limited support of typing
Severity: Minor
Found in super_mario/utils/types.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

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

def is_contains_only_basic_types(some_data: Any) -> bool:
    allowed_containers = (
        dict,
        list,
        tuple,
Severity: Minor
Found in super_mario/utils/types.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

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

    def validate_run_arguments_raise_on_error(
        cls,
        actual_run_arguments: Mapping[str, Any],
    ) -> None:
        if not cls.initial_arguments:
Severity: Minor
Found in super_mario/base_pipeline.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