Showing 9,525 of 13,510 total issues
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
if IfList[-1][2]:
IfList[-1][1] = False
else:
IfList[-1][2] = True
self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
Avoid deeply nested control flow statements. Open
if MacroVal > InputVal:
return True
else:
return False
elif Op == '>=':
Function CheckFileExist
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo= -1):
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' At Line ", 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 MacroVal < InputVal:
return True
else:
return False
elif Op == '<=':
Function GetSingleValueOfKeyFromLines
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
Avoid deeply nested control flow statements. Open
if Key[0] not in Keys:
Dictionary[Key[0]] = Value
Keys.append(Key[0])
else:
Dictionary[Key[0]].extend(Value)
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' At Line ", 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
Function __GetReferencedFdFvTuple
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
for FfsObj in FvObj.FfsList:
if isinstance(FfsObj, FfsFileStatement.FileStatement):
if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
- 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 MacroVal >= InputVal:
return True
else:
return False
elif Op == '<':
Avoid deeply nested control flow statements. Open
if not os.path.isabs(self.FileName):
FullFdf = os.path.join(os.environ.get('WORKSPACE'), self.FileName)
Avoid deeply nested control flow statements. Open
if not self.__GetNextToken():
raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
if self.__GetStringData():
Avoid deeply nested control flow statements. Open
if not self.__IsToken(","):
break
Avoid deeply nested control flow statements. Open
if Profile.FileName == File and Profile.MacroName == Name and Profile.DefinedAtLine <= Line:
Value = Profile.MacroValue
Avoid deeply nested control flow statements. Open
if MacroVal <= InputVal:
return True
else:
return False
else:
Avoid deeply nested control flow statements. Open
if not Pattern.match(self.__Token):
raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
FfsFileObj.KeyStringList.append(self.__Token)
Avoid deeply nested control flow statements. Open
if self.__Token in ('!=', '==', '>', '<', '>=', '<='):
Op = self.__Token
if not self.__GetNextToken():
raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
if self.__GetStringData():
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 Op == '>':
if MacroVal > InputVal:
return True
else:
return False