tests/core/test_policies.py
File test_policies.py
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
from unittest.mock import patch
import numpy as np
import pytest
Consider simplifying this complex logical expression. Open
Open
if states[0] is not None and states[-1] is not None:
# explicitly set intents and actions before listen after
# which FormPolicy should not predict a form action and
# should add FormValidation(False) event
# @formatter:off
Function test_missing_classes_filled_correctly
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
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 test_cv_not_none_param_grid_none_triggers_search_without_params
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_cv_not_none_param_grid_none_triggers_search_without_params(
Function test_cv_not_none_param_grid_none_triggers_search_with_params
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_cv_not_none_param_grid_none_triggers_search_with_params(
Function test_cv_none_does_not_trigger_search
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_cv_none_does_not_trigger_search(self,
Function test_missing_classes_filled_correctly
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_missing_classes_filled_correctly(