Showing 8 of 8 total issues
Function process_failed_story
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process_failed_story(failed_story):
print('\n')
for line in failed_story.splitlines():
is_intent = is_an_intent_line(line)
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def predict_action_probabilities(self, tracker, domain):
# type: (DialogueStateTracker, Domain) -> List[float]
"""Predicts a fallback action if NLU confidence is low
or no other policy has a high-confidence prediction"""
- 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 train
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def train(self,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, domain,
Function callback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def callback(ch, method, properties, body):
logger.warning(" [x] Received %r" % body)
message = json.loads(body.decode('utf-8'))
- 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 api
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def api(endpoint, values=None, is_post=True):
if endpoint[0] == '/':
endpoint = endpoint[1:]
url = host + '/api/v1/' + endpoint
- 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 blueprint
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def blueprint(self, on_new_message):
rocketchat_webhook = Blueprint('rocketchat_webhook', __name__)
@rocketchat_webhook.route("/", methods=['GET'])
def health():
- 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"