Showing 543 of 559 total issues
File finetuning_validator.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from typing import Dict, Text, Any, Optional
import copy
import logging
File release.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Prepare a Rasa OSS release.
- creates a release branch
- creates a new changelog section in CHANGELOG.mdx based on all collected changes
- increases the version number
File hangouts.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import logging
import structlog
import google.auth.transport.requests
import cachecontrol
File telegram.py
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import json
import logging
from copy import deepcopy
from sanic import Blueprint, response
Function batch_to_model_data_format
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def batch_to_model_data_format(
batch: MaybeNestedBatchData,
data_signature: Dict[Text, Dict[Text, List[FeatureSignature]]],
) -> Dict[Text, Dict[Text, List[tf.Tensor]]]:
"""Convert input batch tensors into batch data format.
- 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 _feature_arrays_for_attribute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _feature_arrays_for_attribute(
attribute: Text,
absent_features: List[Any],
attribute_to_features: Dict[Text, List[List[List["Features"]]]],
training: bool,
- 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 _fill_response_phrases
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _fill_response_phrases(self) -> None:
"""Set response phrase for all examples by looking up NLG stories."""
for example in self.training_examples:
# if intent_response_key is None, that means the corresponding intent is
# not a retrieval intent and hence no response text needs to be fetched.
- 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 split_events
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def split_events(
events: Iterable["Event"],
event_type_to_split_on: Type["Event"],
additional_splitting_conditions: Optional[Dict[Text, Any]] = None,
include_splitting_event: bool = True,
- 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 _issue_unused_checkpoint_notification
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def _issue_unused_checkpoint_notification(
self, unused_checkpoints: Set[Text]
) -> None:
"""Warns about unused story blocks.
- 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 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function featurize_training_examples
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def featurize_training_examples(
training_examples: List[Message],
attributes: List[Text],
entity_tag_specs: Optional[List["EntityTagSpec"]] = None,
featurizers: Optional[List[Text]] = None,
- 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 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function visualize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def visualize(self, output_file: Optional[Text] = None) -> "nx.MultiDiGraph":
import networkx as nx
from rasa.shared.core.training_data import visualization
from colorhash import ColorHash
- 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 _mark_first_action_in_story_steps_as_unpredictable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _mark_first_action_in_story_steps_as_unpredictable(self) -> None:
"""Mark actions which shouldn't be used during ML training.
If a story starts with an action, we can not use
that first action as a training example, as there is no
- 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 interactive
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def interactive(args: argparse.Namespace) -> None:
_set_not_required_args(args)
file_importer = TrainingDataImporter.load_from_config(
args.config, args.domain, args.data if not args.core_only else [args.stories]
)
- 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 process_rule_step
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def process_rule_step(self, rule_step: RuleStep) -> OrderedDict:
"""Converts a RuleStep into an ordered dict.
Args:
rule_step: RuleStep object.
- 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 _compare_entities
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _compare_entities(
entity_predictions: List["EntityPrediction"],
entity_targets: List["EntityPrediction"],
i_pred: int,
i_target: int,
- 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 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _line_number_for_path
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _line_number_for_path(self, current: Any, path: Text) -> Optional[int]:
"""Get line number for a yaml path in the current content.
Implemented using recursion: algorithm goes down the path navigating to the
leaf in the YAML tree. Unfortunately, not all nodes returned from the
- 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"