Showing 26 of 26 total issues

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

def find_package_routes(package_name: str) -> List[Route]:
    import_recursively(package_name)
    routes = []

    for class_name, cls in get_all_classes(package_name):
Severity: Minor
Found in winter/web/autodiscovery.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 _call_api has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _call_api(api_class_instance, route: Route, request: django.http.HttpRequest):
    method = route.method
    method_exceptions_manager = MethodExceptionsManager(method)
    response_headers = {}

Severity: Minor
Found in winter_django/view.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 get_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_handler(
        self,
        exception: Union[Type[Exception], Exception],
        auto_handled_only: bool = False,
    ) -> ExceptionHandler:
Severity: Minor
Found in winter/web/exceptions/handlers.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 autodiscover has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def autodiscover(self, package_name: str):
        import_recursively(package_name)
        for class_name, class_ in get_all_classes(package_name):
            component = Component.get_by_cls(class_)
            for component_method in component.methods:
Severity: Minor
Found in winter/messaging/event_subscription_registry.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 inspect_parameters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def inspect_parameters(self, route: 'Route', schema_registry: 'SchemaRegistry') -> List[Parameter]:
        parameters = []

        annotation = route.method.annotations.get_one_or_none(QueryParametersAnnotation)
        if annotation is not None:
Severity: Minor
Found in winter_openapi/inspectors/query_parameters_inspector.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 _decode_dataclass_field has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _decode_dataclass_field(value, field: dataclasses.Field):
    if value is not dataclasses.MISSING:
        return json_decode(value, field.type)
    if field.default is not dataclasses.MISSING:
        return field.default
Severity: Minor
Found in winter/core/json/decoder.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