rasa/core/server.py
File server.py
has 605 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import glob
import logging
import os
import tempfile
import zipfile
Function create_app
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_app(agent=None,
cors_origins: Union[Text, List[Text]] = "*",
auth_token: Optional[Text] = None,
jwt_secret: Optional[Text] = None,
jwt_method: Text = "HS256",
- Read upRead up
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 requires_auth
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
def requires_auth(app: Sanic,
token: Optional[Text] = None
) -> Callable[[Any], Any]:
"""Wraps a request handler with token authentication."""
- Read upRead up
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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, status, reason, message, details=None, help_url=None):
Function create_app
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_app(agent=None,
Avoid too many return
statements within this function. Open
Open
return response.json(responses)
Avoid too many return
statements within this function. Open
Open
return response.json(domain)
Avoid too many return
statements within this function. Open
Open
return response.json(tracker.current_state(verbosity))
Avoid too many return
statements within this function. Open
Open
return response.json(keys)
Avoid too many return
statements within this function. Open
Open
return response.text(state)
Avoid too many return
statements within this function. Open
Open
return response.json(evaluation)
Avoid too many return
statements within this function. Open
Open
return response.json(tracker.current_state(verbosity))
Avoid too many return
statements within this function. Open
Open
return response.json(state)
Avoid too many return
statements within this function. Open
Open
return app
Avoid too many return
statements within this function. Open
Open
return response.text('', 204)
Avoid too many return
statements within this function. Open
Open
return response.text('', 204)
Avoid too many return
statements within this function. Open
Open
return response.json(parse_data)
Avoid too many return
statements within this function. Open
Open
return ErrorResponse(400, "FailedIntentEvaluation",
Avoid too many return
statements within this function. Open
Open
return response.text(domain_yaml,
Avoid too many return
statements within this function. Open
Open
return ErrorResponse(400, "FailedIntentEvaluation",
Avoid too many return
statements within this function. Open
Open
return await response.file(model_path)
Avoid too many return
statements within this function. Open
Open
return response.json({
Avoid too many return
statements within this function. Open
Open
return response.json(responses)
Avoid too many return
statements within this function. Open
Open
return response.json({
Avoid too many return
statements within this function. Open
Open
return response.json(evaluation)
Avoid too many return
statements within this function. Open
Open
return response.json(tracker.current_state(verbosity))