Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if not Pattern.match(self.__Token):
raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
KeyStringList.append(self.__Token)
Function GenerateReport
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GenerateReport(self, File, GlobalDepexParser):
if not self.Depex:
FileWrite(File, gSubSectionStart)
FileWrite(File, TAB_DEPEX)
FileWrite(File, gSubSectionEnd)
- 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 DecDefaultValue == None:
DecMatch = True
else:
DecDefaultValueNumber = int(DecDefaultValue.strip(), 0)
DecMatch = (DecDefaultValueNumber == PcdValueNumber)
Avoid deeply nested control flow statements. Open
if CapInFdList != []:
for CapNameInFd in CapInFdList:
LogStr += "FD %s contains Capsule %s\n" % (RefFdName,CapNameInFd)
if CapNameInFd not in RefCapStack:
RefCapStack.append(CapNameInFd)
Function GenSection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
Function GenSection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):
Avoid deeply nested control flow statements. Open
if InfDefault == "":
InfDefault = None
if First:
Avoid deeply nested control flow statements. Open
if MacorValue != None:
CurLine = CurLine.replace('$(' + MacroName + ')', MacorValue, 1)
if MacorValue.find('$(') != -1:
PreIndex = StartPos
else:
Avoid deeply nested control flow statements. Open
if not self.__IsToken( "("):
raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
PcdPair = self.__GetNextPcdName()
Avoid deeply nested control flow statements. Open
for FvNameInFd in FvInFdList:
LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
if FvNameInFd not in RefFvStack:
RefFvStack.append(FvNameInFd)
Function __GetRegionFvType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __GetRegionFvType(self, RegionObj):
if not self.__IsKeyword( "FV"):
raise Warning("expected Keyword 'FV'", self.FileName, self.CurrentLineNumber)
- 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 (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in ModulePcdSet:
continue
InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]
Avoid deeply nested control flow statements. Open
if elementRegionData.endswith(".fv"):
continue
if elementRegionData != None and elementRegionData.upper() not in FvList:
Avoid deeply nested control flow statements. Open
if ErrorCode != 0:
raise Warning("The include file does not exist under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), PlatformDir, GlobalData.gWorkspace),
self.FileName, self.CurrentLineNumber)
Avoid deeply nested control flow statements. Open
if not Pattern.match(self.__Token):
raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
FfsFileObj.KeyStringList.append(self.__Token)
Avoid deeply nested control flow statements. Open
if not self.__IsToken(","):
break
Function __GetRegionFileType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __GetRegionFileType(self, RegionObj):
if not self.__IsKeyword( "FILE"):
raise Warning("expected Keyword 'FILE'", self.FileName, self.CurrentLineNumber)
- 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 elementRegionData != None and elementRegionData.upper() not in FvList:
FvList.append(elementRegionData.upper())
return FvList
Avoid deeply nested control flow statements. Open
if len(FvObj.BlockSizeList) < 1:
EdkLogger.error("GenFds", GENFDS_ERROR,
'FV.%s must point out FVs blocksize and Fv BlockNum' \
% FvObj.UiFvName)
else:
Function GenSection
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):