Showing 133 of 166 total issues
Function cleanupMails
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def cleanupMails(clientMails, counselorMails):
clientSentenceDates = {}
counselorSentenceDates = {}
for i in range(0,len(clientMails)):
date = clientMails[i][MAILDATEID]
- 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 nameMatch
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def nameMatch(targetNames,sourceNames,suffix=""):
for targetName in targetNames:
for sourceName in sourceNames:
targetName = targetName.lower()
sourceName = sourceName.lower()
- 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 cleanupMails
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def cleanupMails(clientMails, counselorMails):
clientSentenceDates = {}
counselorSentenceDates = {}
for i in range(0,len(clientMails)):
date = clientMails[i][MAILDATEID]
- 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 tactus2table.py
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
"""
tactus2table.py: convert xml files from tactus to csv tables
usage: tactus2table.py file1 [file2 ...]
note: writes output to ../output/emails.csv
Function main
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
csvreader = csv.DictReader(sys.stdin,delimiter=SEPARATOR)
fieldNames = makeNewFieldNames(csvreader.fieldnames)
csvwriter = csv.DictWriter(sys.stdout,delimiter=SEPARATOR,fieldnames=fieldNames)
csvwriter.writeheader()
- 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 findDate
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def findDate(line,inFileName):
match = re.search(r"([0-9]+)-([0-9]+)-([0-9]+)(\s+([0-9]+):([0-9]+)(:([0-9]+))?)?",line)
if not match:
sys.exit(COMMAND+": error: no date in file "+inFileName+" on line: "+line)
else:
- 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 tactus2daap-en.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
"""
tactus2daap-en.py: convert xml files from tactus to daap scores per mail csv
usage: tactus2daap-en.py [-m] file1.xml [file2.xml ...] > file1.csv
notes:
Function storeDictTitles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def storeDictTitles(questionnaires):
titles = getTitles(questionnaires)
for title in titles.keys():
columns = getColumns(questionnaires,title)
outFileName = OUTPUTDIR+"/"+title+".csv"
- 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 storeDictTitles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def storeDictTitles(questionnaires):
titles = getTitles(questionnaires)
for title in titles.keys():
columns = getColumns(questionnaires,title)
outFileName = OUTPUTDIR+"/"+title+".csv"
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
with sys.stdout as csvFile:
csvWriter = csv.DictWriter(csvFile,fieldnames=FIELDNAMES)
csvWriter.writeheader()
for inFileName in argv[1:]:
- 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 convertToAverages
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def convertToAverages(valuesIn,equalwidth=False):
startI = 0
startId = int(valuesIn[0][MAILID])
totalDAAP = 0.0
valuesOut = []
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
with sys.stdout as csvFile:
csvWriter = csv.DictWriter(csvFile,fieldnames=FIELDNAMES)
csvWriter.writeheader()
for inFileName in argv[1:]:
- 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 re.search(DATEPATTERN1,line) or \
re.search(DATEPATTERN2,line) or \
re.search(DATEPATTERN3,line) or \
re.search(DATEPATTERN4,line):
date = findDate(line,inFileName)
Function compressPER
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def compressPER(tokens):
counter = 0
while counter < len(tokens):
if tokens[counter] != PER: counter += 1
else:
- 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 getQuestionnaires
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def getQuestionnaires(root,thisId):
qs = []
for questionnaires in INTAKEQUESTIONNAIRE,QUESTIONNAIRE:
for questionnaire in root.findall(questionnaires):
title = cleanupText(questionnaire.findall("./Title")[0].text)
- 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 getQuestionnaires
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def getQuestionnaires(root,thisId):
qs = []
for questionnaires in INTAKEQUESTIONNAIRE,QUESTIONNAIRE:
for questionnaire in root.findall(questionnaires):
title = cleanupText(questionnaire.findall("./Title")[0].text)
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
csvreader = csv.DictReader(sys.stdin,delimiter=SEPARATOR)
csvwriter = csv.DictWriter(sys.stdout, delimiter=SEPARATOR,fieldnames=FIELDNAMES,restval="NA",lineterminator="\n")
csvwriter.writeheader()
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 main
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
duplicateColumns = None
csvreader = csv.DictReader(sys.stdin,delimiter=',',quotechar='"')
fieldNames = None
csvwriter = None
- 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 getQuestionnaires
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def getQuestionnaires(root,thisId):
qs = []
for questionnaires in INTAKEQUESTIONNAIRE,QUESTIONNAIRE:
for questionnaire in root.findall(questionnaires):
title = cleanupText(questionnaire.findall("./Title")[0].text)
- 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 text2liwc
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def text2liwc(features,words,prefixes,tokens):
global numberId
counts = { NBROFMATCHES: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"