simonkowallik/as3ninja

View on GitHub
as3ninja/utils.py

Summary

Maintainability
A
55 mins
Test Coverage
D
65%

Function dict_filter has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Wontfix

def dict_filter(
    dict_to_filter: dict, filter: Optional[Union[tuple, str]] = None
) -> Any:
    """Filters a dict based on the provided filter.

Severity: Minor
Found in as3ninja/utils.py - About 2 hrs 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 _include_constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _include_constructor(cls, _, node) -> Union[List, Dict]:
        """
        The PyYAML constructor for the INCLUDE_TAG (!include).
        This method should not be called directly, it is passed to PyYAML as a constructor function.

Severity: Minor
Found in as3ninja/utils.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 escape_split has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Wontfix

def escape_split(string_to_split: str, seperator: str = ".") -> tuple:
    """Splits a string based on the provided seperator.

    escape_split supports escaping the seperator by prepending a backslash.

Severity: Minor
Found in as3ninja/utils.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

There are no issues that match your filters.

Category
Status