Showing 133 of 166 total issues
Function checkFirstLastN
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def checkFirstLastN(mailSendersList,name,N):
if N > 0:
for i in range(0,N):
if mailSendersList[i] == name: return(True)
return(False)
- 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 getEmailData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def getEmailData(root,thisId):
clientMails = []
counselorMails = []
for message in root.findall(MESSAGES):
body = ""
- 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 summarizeDataMail
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def summarizeDataMail(data,mailId):
summary = {}
if mailId >= 0 and mailId < len(data):
row = data[mailId]
for featureName in row:
- 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 findSender
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def findSender(line,inFileName):
match = re.search(SENDERPATTERN1+r" *(.*)",line)
if match: sender = match.group(1)
else:
match = re.search(SENDERPATTERN2+r" *(.*)",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 main
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
capitalized = {}
lowerCased = {}
for line in sys.stdin:
if not re.match(r"^.*<.*>.*$",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 findReceiver
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def findReceiver(line,inFileName):
match = re.search(RECEIVERPATTERN1+r" *(.*)",line)
if match: receiver = match.group(1)
else:
match = re.search(RECEIVERPATTERN2+r" *(.*)",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
Consider simplifying this complex logical expression. Open
if tokens[i] in [MONTH,DATE,DAY]:
if i < len(tokens)-1 and tokens[i+1] in [NUM,MONTH,DATE,DAY]:
removeFromList(tokens,i+1)
removedTokens += 1
tokens[i] = DATE
Function removeTagText
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def removeTagText(tag,tagNamesKeepTextTrace):
global clearedStringIds
if not tag.text is None:
if not tag.tag in tagNamesKeepTextTrace:
- 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 printResults
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def printResults(features,results,clientids):
printData = {}
allFeatures = METADATA+list(features.values())
extraFeatures = [ KEYPREFIX+x for x in allFeatures ]
allFeatures.extend(extraFeatures)
- 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 countPhrases
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def countPhrases(fileName,message):
global phraseFrequencies,phraseInitialPos
words = message.text.split()
inDuplicate = False
- 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 processMailHeader
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def processMailHeader(mailText,inFileName):
date, receiver, receiverName, sender, senderName, subject = ("","","","","","")
mailLines = mailText.split("\n")
skipLines = 0
for line in mailLines:
- 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 getGenderDataFromVNW
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def getGenderDataFromVNW(processedText):
genderData = {}
for paragraph in processedText:
for tokenData in paragraph:
if re.match(r"^VNW\(",str(tokenData[POS])):
- 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 getDiaryData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def getDiaryData(root,thisId):
diaries = []
subject = ""
for entry in root.findall(DIARIES):
date = ""
- 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 text2daap
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def text2daap(words,tokens):
global numberId
counts = { NBROFMATCHES:0 , DAAPAVG:0.0, DAAPPOS:0.0, DAAPNEG:0.0 }
for token in tokens:
- 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 main
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
options,args = processOptions(argv)
expectedFields = -1
for line in sys.stdin:
fields = line.split()
- 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
Consider simplifying this complex logical expression. Open
if nextCounter < len(tokens)-1 and \
tokens[nextCounter+1] == PER:
nextCounter += 1
elif nextCounter < len(tokens)-2 and \
tokens[nextCounter+1] in NAMEWORDS and \
Function readSentence
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def readSentence():
tokens,pos,ner = [[],[],[]]
for line in sys.stdin:
try:
line = line.rstrip()
- 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 printResults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def printResults(features,results):
for i in range(0,len(METADATAFEATURES)):
if i != 0: print(",",end="")
if METADATAFEATURES[i] in results:
print(removeSpaces(str(results[METADATAFEATURES[i]])),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 main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
try: optionList, files = getopt.getopt(argv,"i",[])
except: sys.exit("usage: "+COMMAND+" [-i] < nerfile ")
interactive = "i" in optionList
ner,pos,tokens = [[],[],[]]
- 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 readSentence
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def readSentence():
tokens,pos,ner = [[],[],[]]
for line in sys.stdin:
try:
line = line.rstrip()
- 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"