rasa/nlu/test.py
File test.py
has 1593 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import itertools
import os
import logging
import structlog
Function evaluate_entities
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def evaluate_entities(
Function evaluate_response_selections
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def evaluate_response_selections(
Function evaluate_intents
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def evaluate_intents(
Function plot_entity_confidences
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_entity_confidences(
Function _calculate_report
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _calculate_report(
Function plot_attribute_confidences
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_attribute_confidences(
Function remove_empty_response_examples
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def remove_empty_response_examples(
response_results: List[ResponseSelectionEvaluationResult],
) -> List[ResponseSelectionEvaluationResult]:
"""Remove those examples without a response.
- 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 remove_empty_intent_examples
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def remove_empty_intent_examples(
intent_results: List[IntentEvaluationResult],
) -> List[IntentEvaluationResult]:
"""Remove those examples without an intent.
- 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"