Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if Item.strip() not in DT.MODULE_LIST:
Logger.Error('Parser',
FORMAT_INVALID,
ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID % (Item),
File=FileName,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, Guid, Name, Value, DatumType,
Function GetPcdsByType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GetPcdsByType(self, PcdType):
PcdType = PcdType.upper()
Retlst = []
for TypeInDict, Arch in self.ValueDict:
if TypeInDict != PcdType:
- 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 GetLiabraryInstances
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
Function __GenComplexFileFfs__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __GenComplexFileFfs__(self, Rule, InputFile, Alignments):
if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):
PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)
if len(PcdValue) == 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
Avoid deeply nested control flow statements. Open
if PlatformModule and LibName in PlatformModule.LibraryClasses:
LibraryPath = PlatformModule.LibraryClasses[LibName]
else:
LibraryPath = PlatformDataBase.LibraryClasses[LibName, ModuleType]
if not LibraryPath:
Avoid deeply nested control flow statements. Open
if Module == None:
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Module is not found in active platform",
ExtraData=Token, File=self.MetaFile, Line=Record[-1])
DepexList.append(Module.Guid)
Avoid deeply nested control flow statements. Open
if timeOfToolModified < fd.st_mtime:
timeOfToolModified = fd.st_mtime
if timeOfToolModified > os.stat(DbPath).st_mtime:
Function Insert
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
Function _GetLibraryClass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _GetLibraryClass(self):
if self._LibraryClasses == None:
#
# tdict is a special kind of dict, used for selecting correct
# library class declaration for given ARCH
- 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 ToolList[0] in self._TOOL_CODE_:
Tool = self._TOOL_CODE_[ToolList[0]]
else:
Tool = ToolList[0]
ToolChain = "*_*_*_%s_FLAGS" % Tool
Avoid deeply nested control flow statements. Open
if PcdObj.DatumType != 'VOID*':
EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
Avoid deeply nested control flow statements. Open
if self._BuildOptions == None:
self._BuildOptions = sdict()
Avoid deeply nested control flow statements. Open
if File.Ext.lower() == '.h':
EdkLogger.warn('build', 'Include file not found', ExtraData=ErrorInfo,
File=self.MetaFile, Line=LineNo)
continue
else:
Avoid deeply nested control flow statements. Open
if self.FvAddress % FvAlignValue != 0:
EdkLogger.error("GenFds", GENFDS_ERROR,
"FV (%s) is NOT %s Aligned!" % (FvObj.UiFvName, FvObj.FvAlignment))
FvBuffer = StringIO.StringIO('')
Function GenSection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
Function __ProcessDefine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __ProcessDefine(self):
if not self._Enabled:
return
Type, Name, Value = self._ValueList
- 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 IsHex:
RetValue.append((eachName, Element[2]))
IsHex = False
#
# GCC map file
Function GenSection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
Avoid deeply nested control flow statements. Open
if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
FreeFound = True
Free = NameValue[1].strip()