Showing 57 of 274 total issues
Function default_parser
has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring. Open
def default_parser(self, base_string, test_string, pattern_arg):
"""
Parsing code for the default literal parser.
"""
- 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 identify_common_patterns
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
# Creating variables
sentence_information = {}
# Comparing the two sets of strings together & finding patterns
- 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 identify_common_patterns
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
# Creating variables
sentence_information = {}
# Comparing the two sets of strings together & finding patterns
- 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 identify_common_patterns
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
def identify_common_patterns(self, base_sentence_info, test_sentence_info, patterns):
# Creating variables
sentence_information = {}
# Comparing the two sets of strings together & finding patterns
- 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 remove_sub_patterns
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
def remove_sub_patterns(self, patterns, pattern_information, strings):
"""
Removes sub patterns, which are patterns within patterns.
The sub patterns are not referenced in any context other than the context of the
- 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 find_object
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
def find_object(self, capitalized_sentence, raw_sentence, tagged_sentence, full_tagged_sentence):
# Creating the variable that will hold the object(s) of the sentence
updated_object = ""
# Finding objects
- 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 use_pattern
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def use_pattern(self, base_string, test_string, pattern_arg):
patterns = pattern_arg
# Creating string textblob for analysis & analyzing the base_string's sentences
base_blob = TextBlob(base_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 full_pattern_comparison
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def full_pattern_comparison(self, parsed_data, patterns):
# Creating variable containing pattern information that will be returned
pattern_information = {}
"""
- 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 identify_topics
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def identify_topics(self, strings):
"""
Topic identifier function.
inputs:
- 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 find_subject
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def find_subject(self, capitalized_sentence, sentence_raw, sentence_tagged):
"""
Get the full subject.
"""
- 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 generate_parsed_text
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def generate_parsed_text(self):
while True:
input_text = self.input_text.get("1.0", tk.END)
output_text = self.output_text.get("1.0", tk.END)
- 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 find_prepositional_phrases
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def find_prepositional_phrases(self, capitalized_sentence, raw_sentence, tagged_sentence):
prepositional_phrases = ""
for index in range(0, len(tagged_sentence)):
# Removing prepositions
- 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 use_nlpnet
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def use_nlpnet(self, base_string, test_string, pattern_arg):
"""
Main interface method from the NLPNET class to the rest of
the program.
"""
- 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 use_nltk
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def use_nltk(self, base_string, test_string, pattern_arg):
patterns = pattern_arg
base_blob = TextBlob(base_string)
base_sentence_info = []
- 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 find_dependencies
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def find_dependencies(self, **kwargs):
"""
Interface method to regex4dummies returning
the sentence dependencies gathered by given parser.
"""
- 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_semantic
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def process_raw_data_semantic(self, parser_name, information, correct_topics):
"""
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"
Further reading
Function find_verb
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def find_verb(self, capitalized_sentence, raw_sentence, tagged_sentence):
# Creating the variable that will hold the verb(s) of the sentence
updated_verb = ""
# Finding verb
- 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
File nltk_parser.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
import os
from textblob import TextBlob
import nltk
from fuzzywuzzy import fuzz
Function identify_sentence_parts_nlpnet
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def identify_sentence_parts_nlpnet(self, tokens, labels):
subject = ""
verb = ""
object = ""
prepositional_phrases = ""
- 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 find_patterns
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def find_patterns(self, strings, current_index, literal_find, patterns_arg, parser_name):
"""
Recursive function that compares all strings and determins
reliability score, applicability score, and 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"