Showing 216 of 245 total issues
Function _collect_messages
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _collect_messages(evts: List[Dict[Text, Any]]) -> List[Message]:
"""Collect the message text and parsed data from the UserMessage events
into a list"""
from rasa_nlu.extractors.duckling_http_extractor import \
DucklingHTTPExtractor
- 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 _emulate_form_rejection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _emulate_form_rejection(processor, partial_tracker):
from rasa.core.policies import FormPolicy
if partial_tracker.active_form.get("name"):
for p in processor.policy_ensemble.policies:
if isinstance(p, FormPolicy):
- 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 _collect_user_uttered_predictions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _collect_user_uttered_predictions(event,
partial_tracker,
fail_on_prediction_errors):
from rasa.core.utils import (
pad_list_to_size)
- 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 add_checkpoint
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def add_checkpoint(self,
name: Text,
conditions: Optional[Dict[Text, Any]]) -> None:
# Depending on the state of the story part this
- 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 configure_app
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def configure_app(input_channels=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function log_evaluation_table
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def log_evaluation_table(golds, name,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function plot_story_evaluation
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_story_evaluation(test_y, predictions,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function chat
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def chat(model_path: Text = None, agent: 'Agent' = None,
interpreter: NaturalLanguageInterpreter = None) -> None:
"""Chat to the bot within a Jupyter notebook.
Args:
- 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 __call__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, attn_inputs, scores, scores_state, mask):
# apply exponential moving average with interpolation gate weight
# to scores from previous time which are equal to probs at this point
# different from original NTM where it is applied after softmax
i_g = self._inter_gate(attn_inputs)
- 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 _collect_action_executed_predictions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _collect_action_executed_predictions(processor, partial_tracker, event,
fail_on_prediction_errors):
from rasa.core.policies import FormPolicy
action_executed_eval_store = EvaluationStore()
- 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 _fingerprint_node
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _fingerprint_node(graph, node, max_history):
"""Fingerprint a node in a graph.
Can be used to identify nodes that are similar and can be merged within the
graph.
- 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 topological_sort
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def topological_sort(
graph: Dict[Text, Set[Text]]
) -> Tuple[deque, Set[Tuple[Text, Text]]]:
"""Creates a top sort of a directed graph. This is an unstable sorting!
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update(self, event: Event, skip_states: bool = False) -> None:
"""Modify the state of the tracker according to an ``Event``. """
# if `skip_states` is `True`, this function behaves exactly like the
# normal update of the `DialogueStateTracker`
- 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 add_user_messages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_user_messages(self, messages):
self.ensure_current_steps()
if len(messages) == 1:
# If there is only one possible intent, we'll keep things simple
- 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 _create_attn_cell
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_attn_cell(self,