Showing 57 of 274 total issues
Avoid deeply nested control flow statements. Open
for pattern in final_patterns:
if patterns[outer_pattern_index] in pattern:
outer_add_to_pattern = False
if patterns[inner_pattern_index] in pattern:
Avoid deeply nested control flow statements. Open
if end - length < 0:
break
Avoid deeply nested control flow statements. Open
if ' '.join(pattern) not in patterns and ' '.join(pattern) not in base_sentence_info:
base_sentence_info += [str(' '.join(pattern))]
sentence_information[str(' '.join(pattern))] = ['', '', '', [], 2, 0]
else:
Avoid deeply nested control flow statements. Open
if end - length < 0:
break
Avoid deeply nested control flow statements. Open
if ' '.join(pattern) in str(test_string) and pattern != '' and pattern != []:
if ' '.join(pattern) not in patterns and ' '.join(pattern) not in base_sentence_info:
base_sentence_info += [str(' '.join(pattern))]
sentence_information[str(' '.join(pattern))] = ['', '', '', [], 2, 0]
Avoid deeply nested control flow statements. Open
if inner_add_to_pattern == True and outer_add_to_pattern == True:
if len( patterns[outer_pattern_index]) > len(patterns[inner_pattern_index] ):
final_patterns.append(patterns[outer_pattern_index])
try:
Function find_patterns
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_patterns(self, strings, current_index, literal_find, patterns_arg, parser_name):
Function find_previous_instance
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_previous_instance(self, instance_to_find, string_containing_instance, current_index, objects_to_fail, updated_object):
Function get_reliability_score
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_reliability_score(self, pattern):
"""
Used to return the reliability score of a pattern.
"""
- 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
Avoid too many return
statements within this function. Open
return self.return_pattern_dependencies(text=kwargs.get("text"))
Avoid too many return
statements within this function. Open
return self.return_nltk_dependencies(text=kwargs.get("text"))
Avoid too many return
statements within this function. Open
return self.return_pattern_dependencies(text=kwargs.get("text"))
Avoid too many return
statements within this function. Open
return self.return_pattern_dependencies(text=kwargs.get("text"))
Avoid too many return
statements within this function. Open
return self.return_pattern_dependencies(text=kwargs.get("text"))
Function process_topics
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_topics(self, strings, correct_topics):
"""
process_topics finds the topics of the given strings and returns the topic score.
"""
- 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 normalize_text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def normalize_text(self, text):
"""
Returns the normalized version
of the passed text variable.
"""
- 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_raw_data_literal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_raw_data_literal(self, parser_name, strings, correct_patterns):
"""
This function processes the raw data and turns it into useful information.
That data provides useful statistics about the library's current "health".
The function returns the overall score for the data, and specific statistics of the data.
- 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"