Showing 216 of 245 total issues
Function print_bot_output
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def print_bot_output(message, color=rasa.cli.utils.bcolors.OKBLUE):
if "text" in message:
rasa.cli.utils.print_color(message.get("text"),
color)
- 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 predict_action_probabilities
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def predict_action_probabilities(self,
tracker: DialogueStateTracker,
domain: Domain) -> List[float]:
"""Predicts the corresponding form action if there is an active form"""
result = [0.0] * domain.num_actions
- 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 predict_action_probabilities
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def predict_action_probabilities(self,
tracker: DialogueStateTracker,
domain: Domain) -> List[float]:
"""Predicts the next action if NLU confidence is low.
"""
- 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 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function serve_application
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def serve_application(core_model=None,
Function _find_core_nlu_files_in_directory
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _find_core_nlu_files_in_directory(directory: Text
) -> Tuple[Set[Text], Set[Text]]:
story_files = set()
nlu_data_files = set()
for root, _, files in os.walk(directory):
- 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 from_dict
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def from_dict(cls, dictionary: Dict[Text, Any]) -> List[Policy]:
policies = dictionary.get('policies') or dictionary.get('policy')
if policies is None:
raise InvalidPolicyConfig("You didn't define any policies. "
"Please define them under 'policies:' "
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host,
Function collect_intent_properties
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def collect_intent_properties(intent_list):
intent_properties = {}
for intent in intent_list:
if isinstance(intent, dict):
for properties in intent.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 merge
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def merge(self, domain: 'Domain', override: bool = False) -> 'Domain':
"""Merge this domain with another one, combining their attributes.
List attributes like ``intents`` and ``actions`` will be deduped
and merged. Single attributes will be taken from ``self`` unless
- 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 test_missing_classes_filled_correctly
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def test_missing_classes_filled_correctly(
self, default_domain, trackers, tracker, featurizer, priority):
# Pretend that a couple of classes are missing and check that
# those classes are predicted as 0, while the other class
# probabilities are predicted normally.
- 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 message_for_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def message_for_data(self, structured_info):
"""Find a data sample with the same intent and entities.
Given the parsed data from a message (intent and entities) finds a
message in the data that has the same intent and entities."""
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
featurizer: Optional[FullDialogueTrackerFeaturizer] = None,
priority: int = 1,
encoded_all_actions: Optional[np.ndarray] = None,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _compute_time_attention
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _compute_time_attention(attention_mechanism, attn_inputs, attention_state,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function _back_to_the_future_again
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _back_to_the_future_again(tracker):
"""Send Marty to the past to get
the new featurization for the future"""
idx_of_first_action = 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 test_ensemble_from_dict
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def test_ensemble_from_dict():
def check_memoization(p):
assert p.max_history == 5
assert p.priority == 3
- 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 probabilities_using_best_policy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def probabilities_using_best_policy(self,
tracker: DialogueStateTracker,
domain: Domain
) -> Tuple[List[float], Text]:
result = 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 encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def encode(self, state: Dict[Text, float]) -> np.ndarray:
"""Returns a binary vector indicating which features are active.
Given a dictionary of states (e.g. 'intent_greet',
'prev_action_listen',...) return a binary vector indicating which
- 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"