Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if len(list) == 2:
EotGlobalData.gGuidDict[list[0].strip()] = GuidStructureStringToGuidString(list[1].strip())
## ParseGuidList() method
Function ConvertGuid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ConvertGuid(guid):
numList = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
newGuid = ''
if guid.startswith('g'):
guid = guid[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
Avoid deeply nested control flow statements. Open
if regex.groups == 1:
regions.append((region_type,int(m.group(1),0),0))
else:
regions.append((region_type,int(m.group(1),0),int(m.group(2),0)))
else:
Avoid deeply nested control flow statements. Open
for (row, col), line in slashes:
if row == lastrow:
continue
rows.append(row)
lastrow = row
Avoid deeply nested control flow statements. Open
if regex.groups == 1:
raise Exception('cmd_load_symbols', "Expect a base address")
else:
raise Exception('cmd_load_symbols', "Expect a region format as (base,size)")
Function convertdir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convertdir(dir, dirprefix='', nameprefix='', comments=1):
mapnames = os.listdir(dir)
for mapname in mapnames:
mappathname = os.path.join(dir, mapname)
- 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 sec[0] == sec_no and (sym_offset >= sec[1] and sym_offset < sec[1] + sec[2]):
bPcds.append([m2.groups(0)[0], sec[3], sym_offset, vir_addr, sec_no])
Function parse_pcd_report
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_pcd_report(self, report_file):
pcd_reg = re.compile(" (\*P|\*F|\*M| ) (\w+)(\ +)\: (.*) \((\w+)\) = (.*)\n")
for line in report_file.xreadlines():
stripped_line = line.strip()
- 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 signature == FirmwareVolume.CONST_FV_SIGNATURE:
fvs.append((base,0))
else:
Avoid deeply nested control flow statements. Open
if tag[-1] == ':':
tag = tag[:-1]
revisions[tag] = rev
Avoid deeply nested control flow statements. Open
if res is None:
break
emails.append(res.group('email'))
Avoid deeply nested control flow statements. Open
for m in reach[mo]:
if m not in reach[mod]:
reach[mod].append(m)
change = 1
#
Function bitmap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bitmap(self, name, x, y, w, h, text):
Avoid deeply nested control flow statements. Open
if self.argprops[name] == P_NESTED:
print >> buf, template % ("extend", "flatten(",
name, ")")
else:
print >> buf, template % ("append", "", name, "")
Function checkforhtml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def checkforhtml(self, info, url):
if info.has_key('content-type'):
ctype = cgi.parse_header(info['content-type'])[0].lower()
if ';' in ctype:
# handle content-type: text/html; charset=iso8859-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 getargsFormatArgs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getargsFormatArgs(self, sep):
fmt = ""
lst = ""
for arg in self.argumentList:
if arg.flags == SelfMode:
- 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 server
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def server():
if len(sys.argv) > 2:
port = eval(sys.argv[2])
else:
port = MY_PORT
- 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 link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def link(self, label, nodename, rel=None, rev=None):
if nodename:
if nodename.lower() == '(dir)':
addr = '../dir.html'
title = ''
- 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 TrimEdkSourceCode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def TrimEdkSourceCode(Source, Target):
EdkLogger.verbose("\t%s -> %s" % (Source, Target))
CreateDirectory(os.path.dirname(Target))
try:
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "n:")
except getopt.error, msg:
print msg
- 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"