Showing 10 of 10 total issues
Function process
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def process(self, message: Message, **kwargs: Any) -> None:
input = message.get(TEXT_ATTRIBUTE)
tokens = tokenize(self.intent_model["stopwords"], input)
- 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 train
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def train(
self, training_data: TrainingData, cfg: DazuConfig, **kwargs: Any
) -> None:
self.intent_model = {"stopwords": training_data.data["nlu"]["stopwords"]}
- 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 load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load(
Function load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load(
Function load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load(
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build(
Function __dialog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __dialog(self, input, context, intents, entities):
if input == "":
return get_dialog_welcome(self.dialog_nodes)
if len(intents) > 0:
- 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 load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load(config: Optional[Union[Text, Dict]] = None, **kwargs: Any) -> "DazuConfig":
if isinstance(config, Dict):
return _load_from_dict(config, **kwargs)
file_config = {}
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, configuration_values: Optional[Dict[Text, Any]] = None) -> None:
"""Create a model configuration, optionally overriding
defaults with a dictionary ``configuration_values``.
"""
if not configuration_values:
- 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 list_directory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def list_directory(path: Text) -> List[Text]:
"""Returns all files and folders excluding hidden files.
If the path points to a file, returns the file. This is a recursive
implementation returning files in any depth of the path.
"""
- 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"