Function respond
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def respond(self, com, tts_output=False, userin=None, user_prefix=None, is_server=False):
"""Method to respond the user's input/command using factoid question answering ability.
Args:
com (str): User's command.
- 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 semantic_extractor
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def semantic_extractor(self, string):
"""Function to extract subject, subjects, focus, subject_with_objects from given string.
Args:
string (str): String.
- 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 async_performer
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def async_performer(self, thread_number, samples, results, s_print):
s_print('\nThead {0} is started.\n'.format(thread_number + 1))
from termcolor import colored
correct_counter = 0
- 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 check_how_odqa_performs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_how_odqa_performs(self):
import json
import urllib.request
import random
import multiprocessing
- 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"