Showing 133 of 166 total issues
Function getFieldTotal
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def getFieldTotal(row,prefix,suffix,convertor,maxIndex,addZero):
Function processOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def processOptions(argv):
try:
names = {}
optionList, files = getopt.getopt(argv,"n:p:t:s",[])
options = {}
- 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 deeply nested control flow statements. Open
if token in names and names[token] == COMPLETE:
if re.search(r"VZ",lastPOS):
text += METOKEN[sentenceInitial]+" "
else:
text += ITOKEN[sentenceInitial]+" "
Avoid deeply nested control flow statements. Open
for answer in question.findall(ANSWERS):
if ID in answer.attrib.keys(): key = answer.attrib[ID]
else: key = NOID
answerTexts = answer.findall("./answerText")
if len(answerTexts) > 0: value = cleanupText(answerTexts[0].text)
Avoid deeply nested control flow statements. Open
if element.tag == DATE: data[DATE] = cleanupText(element.text)
elif element.tag == SENDER: data[SENDER] = cleanupText(element.text)
elif element.tag == SUBJECT:
wordCountSubject = wordCount(cleanupText(element.text))
elif element.tag == BODY:
Consider simplifying this complex logical expression. Open
if tokens[i] in names.keys():
if names[tokens[i]] != NEOTHER:
tokens[i] = names[tokens[i]]
elif pos[i] == TAGNUM or re.search(r"^\d",tokens[i]) or re.search(r"^-\d",tokens[i]):
tokens[i] = NUM
Function makeTableDAAP
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def makeTableDAAP(fileName,data,index=-1,user="",average=False):
Function makePlotIndexPart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def makePlotIndexPart(fieldDataList,fieldNames,format,senders,target):
Function printMailText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def printMailText(client,counselor,date,mailText,receiver):
Function printResults
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def printResults(featureNames,results):
first = True
for featureName in featureNames:
if not first: print(",",end="")
else: first = 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 fixCounselor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fixCounselor(mails):
counselor = ""
for mail in mails:
if mail[COUNSELORID] != "":
counselor = mail[COUNSELORID]
- 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 analyzeText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def analyzeText(text):
tokens = text.split()
nbrOfWords = 0
nbrOfCharsInWords = 0
nbrOfSents = 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 makeNewFieldNames
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def makeNewFieldNames(fieldNamesIn):
fieldNamesOut = list(KEEP)
for field in fieldNamesIn:
if not field in KEEP and field != TIME:
for time in TIMES:
- 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 combineData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def combineData(emails,sender,start,end,setSize,getLast=False):
set = []
nbrOfUsed = 0
if not getLast:
i = start
- 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(True)
Avoid too many return
statements within this function. Open
else: return(True)
Avoid too many return
statements within this function. Open
return(False)
Function getMailTexts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getMailTexts(tree,tagNames):
root = tree.getroot()
textList = []
for tag in root.iter():
if not tag.text is 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 movingWeight
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def movingWeight(index,windowSize):
global movingWeights
if str(index) in movingWeights: return(movingWeights[str(index)])
elif index <= -windowSize or index >= windowSize:
- 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 markDuplicates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def markDuplicates(message,duplicateStarts,duplicateEnds,duplicateRefs):
words = message.text.split()
message.text = ""
wordIndex = 0
while len(duplicateStarts) > 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"