zalando/connexion

View on GitHub

Showing 88 of 149 total issues

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Minor
Found in connexion/lifecycle.py - About 35 mins to fix

    Function run has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def run(self, port=None, server=None, debug=None, host=None, **options):  # pragma: no cover
    Severity: Minor
    Found in connexion/apps/abstract.py - About 35 mins to fix

      Function _query_args_helper has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _query_args_helper(self, query_defns, query_arguments,
      Severity: Minor
      Found in connexion/operations/abstract.py - About 35 mins to fix

        Function run has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def run(self, port=None, server=None, debug=None, host=None, **options):  # pragma: no cover
        Severity: Minor
        Found in connexion/apps/flask_app.py - About 35 mins to fix

          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, formdata_parameters, query_parameters, title=None, detail=None, **kwargs):
          Severity: Minor
          Found in connexion/exceptions.py - About 35 mins to fix

            Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def update(self, id=None, name=None, animal_type=None, tags=None, created=None):
            Severity: Minor
            Found in examples/openapi3/sqlalchemy/orm.py - About 35 mins to fix

              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

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

                  def validate_response(self, data, status_code, headers, url):
                      """
                      Validates the Response object based on what has been declared in the specification.
                      Ensures the response body matches the declated schema.
                      :type data: dict
              Severity: Minor
              Found in connexion/decorators/response.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 _serialize_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _serialize_data(cls, data, mimetype):
                      # TODO: Harmonize with flask_api. Currently this is the backwards compatible with aiohttp_api._cast_body.
                      if not isinstance(data, bytes):
                          if isinstance(mimetype, str) and is_json_mimetype(mimetype):
                              body = cls.jsonifier.dumps(data)
              Severity: Minor
              Found in connexion/apis/abstract.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 verify_security has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def verify_security(cls, auth_funcs, required_scopes, function):
                      @functools.wraps(function)
                      def wrapper(request):
                          token_info = None
                          for func in auth_funcs:
              Severity: Minor
              Found in connexion/security/security_handler_factory.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_server_requirements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def validate_server_requirements(ctx, param, value):
                  if value == 'gevent':
                      try:
                          import gevent  # NOQA
                      except ImportError:
              Severity: Minor
              Found in connexion/cli.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 resolve_operation_id_using_rest_semantics has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def resolve_operation_id_using_rest_semantics(self, operation):
                      """
                      Resolves the operationId using REST semantics
              
                      :type operation: connexion.operations.AbstractOperation
              Severity: Minor
              Found in connexion/resolver.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 extend_with_set_default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def extend_with_set_default(validator_class):
                  validate_properties = validator_class.VALIDATORS['properties']
              
                  def set_defaults(validator, properties, instance, schema):
                      for property, subschema in six.iteritems(properties):
              Severity: Minor
              Found in examples/swagger2/enforcedefaults/enforcedefaults.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

              Avoid too many return statements within this function.
              Open

                          return cls._build_response(mimetype=mimetype, data=response, extra_context=extra_context)
              Severity: Major
              Found in connexion/apis/abstract.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return (None, status_code)
                Severity: Major
                Found in connexion/operations/openapi.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return value
                  Severity: Major
                  Found in connexion/decorators/validation.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return cls._build_response(mimetype=mimetype, data=data, status_code=status_code, headers=headers, extra_context=extra_context)
                    Severity: Major
                    Found in connexion/apis/abstract.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return {}
                      Severity: Major
                      Found in connexion/operations/openapi.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return json.JSONEncoder.default(self, o)
                        Severity: Major
                        Found in connexion/jsonifier.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return json.JSONEncoder.default(self, o)
                          Severity: Major
                          Found in connexion/apps/flask_app.py - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language