simonkowallik/as3ninja

View on GitHub
as3ninja/schema/as3schema.py

Summary

Maintainability
A
0 mins
Test Coverage
A
97%

Function _load_schema has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Wontfix

    def _load_schema(self, version: str, force: bool = False) -> None:
        """Private Method: load schema file from disk for specified version.
        ``force`` parameter can be used to force load the schema file, even if it has been read already.

            :param version: AS3 Schema version
Severity: Minor
Found in as3ninja/schema/as3schema.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

AS3Schema has 21 functions (exceeds 20 allowed). Consider refactoring.
Wontfix

class AS3Schema:
    """Creates a AS3Schema instance of specified version.
        The :py:meth:`validate` method provides AS3 Declaration validation based on the AS3 JSON Schema.

        :param version: AS3 Schema version (Default value = "latest")
Severity: Minor
Found in as3ninja/schema/as3schema.py - About 2 hrs to fix

    Function validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        def validate(
            self, declaration: Union[dict, str], version: Optional[str] = None
        ) -> None:
            """Method: Validates a declaration against the AS3 Schema. Raises a AS3ValidationError on failure.
    
    
    Severity: Minor
    Found in as3ninja/schema/as3schema.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 _ref_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        def _ref_update(self, schema: dict, _ref_url: str) -> None:
            """Private Method: _ref_update performs an in-place update of relative $ref (starting with #) into absolute references by prepending _ref_url.
    
            See: https://github.com/Julian/jsonschema/issues/570
    
    
    Severity: Minor
    Found in as3ninja/schema/as3schema.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