zalando/connexion

View on GitHub
connexion/decorators/uri_parsing.py

Summary

Maintainability
B
4 hrs
Test Coverage

File uri_parsing.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Decorators to split query and path parameters
import abc
import functools
import logging
import re
Severity: Minor
Found in connexion/decorators/uri_parsing.py - About 2 hrs to fix

    Function resolve_params has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def resolve_params(self, params, _in):
            """
            takes a dict of parameters, and resolves the values into
            the correct array type handling duplicate values, and splitting
            based on the collectionFormat defined in the spec.
    Severity: Minor
    Found in connexion/decorators/uri_parsing.py - About 1 hr 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 resolve_form has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def resolve_form(self, form_data):
            if self._body_schema is None or self._body_schema.get('type') != 'object':
                return form_data
            for k in form_data:
                encoding = self._body_encoding.get(k, {"style": "form"})
    Severity: Minor
    Found in connexion/decorators/uri_parsing.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

    There are no issues that match your filters.

    Category
    Status