Showing 9,525 of 13,510 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, SourceFile = '', TagName = '', ToolCode = '', ToolChainFamily = '', FeatureFlag = '', SupArchList = None):
Avoid deeply nested control flow statements. Open
if fdata['filename'].endswith(ext):
fdata['extract-dir'] = fdata['filename'][:-len(ext)]
break
replaceables = ('extract-dir', 'filename', 'url')
Function writefile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def writefile(f,defs):
f.write("entitydefs = {\n")
items = defs.items()
items.sort()
- 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 FullPath not in mDecFileList and File.upper().find('.DEC') > -1:
mDecFileList.append(FullPath)
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, warp=None, calibration_runs=None, timer=None):
# Set parameters
if warp is not None:
self.rounds = int(self.rounds / warp)
- 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
for LineIndex in range(len(NewLines), LineNumber-1):
NewLines.append(os.linesep)
NewLines.append(Line)
Function docclass
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def docclass(self, object, name=None, mod=None, funcs={}, classes={},
Avoid deeply nested control flow statements. Open
if NewVariableValue.startswith('&'):
Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, GuidValue, BelongsToFunction, 0)
continue
else:
EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, NewParameter))
Avoid deeply nested control flow statements. Open
if Protocol != NewValue and NewValue.endswith('Guid'):
GuidName = GetParameterName(NewValue)
Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, 0)
IsFound = True
Function MakeSymLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def MakeSymLinks(self):
links_dir = os.path.join(self.config.symlinks, self.config.arch)
if not os.path.exists(links_dir):
os.makedirs(links_dir)
startPrinted = 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
Avoid deeply nested control flow statements. Open
if res is not None:
errors.append(' '.join((email.strip()+': '+res.group('reason')).split()))
del emails[i]
continue
Avoid deeply nested control flow statements. Open
if FullPath not in mSourceFileList and File[-2:].upper() == '.H':
mSourceFileList.append(FullPath)
EotGlobalData.gOP_SOURCE_FILES.write('%s\n' % FullPath)
if FullPath not in mDecFileList and File.upper().find('.DEC') > -1:
Avoid deeply nested control flow statements. Open
if type(fdata[replaceable]) != str: continue
if replaceable in fdata:
Avoid deeply nested control flow statements. Open
if replaceable in fdata:
fdata[replaceable] = \
fdata[replaceable].replace(
'$' + replaceItem,
fdata[replaceItem]
Avoid deeply nested control flow statements. Open
if is_python(fullpath):
yield fullpath
else:
Avoid deeply nested control flow statements. Open
if table == "Binary":
fname = rec[0]+".bin"
open(os.path.join(dir,fname),"wb").write(bytes)
rec.append(Binary(fname))
else:
Function __getitem__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __getitem__(self, key):
for d in self.__d:
try:
value = d[key]
if value:
- 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 not key in cdict:
cdict[key] = cdict[base] = modname + '.html#' + key
funcs, fdict = [], {}
Function process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process(filename):
try:
f = open(filename, 'r')
except IOError, msg:
sys.stderr.write('%s: can\'t open: %s\n' % (filename, str(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"
Further reading
Function note
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def note(self, level, msg, *args):
if self.checker:
apply(self.checker.note, (level, msg) + args)
else:
if self.verbose >= level:
- 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"