Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if CleanString(NewItem) == '':
continue
(K1, K2, K3, K4, K5, K6) = GetDynamicDefaultPcd(NewItem, Type, Filename, -1)
Function __GetNextOp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __GetNextOp(self):
# Skip leading spaces, if exist.
self.__SkipWhiteSpace()
if self.__EndOfFile():
return 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
Method Init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
void Init() throws IOException
{
m_OutWindow.Init(false);
SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsMatchDecoders);
- 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 CleanString(NewItem) == '':
continue
(Family, ToolChain, Flag) = GetBuildOption(NewItem, Filename, -1)
Avoid deeply nested control flow statements. Open
if (lenTest < numAvailableBytesFull)
{
int t = Math.min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
int lenTest2 = _matchFinder.GetMatchLen(lenTest, curBack, t);
if (lenTest2 >= 2)
Avoid deeply nested control flow statements. Open
for NewItem in open(Filename, 'r').readlines():
if CleanString(NewItem) == '':
continue
MergeArches(Libraries, NewItem, Arch)
Avoid deeply nested control flow statements. Open
if CleanString(NewItem) == '':
continue
MergeArches(LibraryClasses, GetLibraryClass([NewItem, IncludeFile[4]], Filename, self.WorkspaceDir, -1), Arch)
Avoid deeply nested control flow statements. Open
if NewKey not in self.ToolsDefTxtDictionary:
self.ToolsDefTxtDictionary[NewKey] = self.ToolsDefTxtDictionary[Key]
continue
Avoid deeply nested control flow statements. Open
if CleanString(NewItem) == '':
continue
(TokenName, TokenGuidCName, Value, DatumType, MaxDatumSize, Type) = GetPcd(NewItem, Type, Filename, -1)
Function __ReplaceFragment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
if StartPos[0] == EndPos[0]:
Offset = StartPos[1]
while Offset <= EndPos[1]:
self.Profile.FileLinesList[StartPos[0]][Offset] = 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 (curAndLenPrice < optimum.Price)
{
optimum.Price = curAndLenPrice;
optimum.PosPrev = cur + lenTest + 1;
optimum.BackPrev = 0;
Avoid deeply nested control flow statements. Open
if eachUnfixedPcd.PcdOffset == '*' :
# The offset un-fixed pcd can write into this free space
if needFixPcdSize <= (NowOffset - LastOffset) :
# Change the offset value of un-fixed pcd
eachUnfixedPcd.PcdOffset = str(hex(LastOffset))
Avoid deeply nested control flow statements. Open
if self.IsToDatabase:
SqlCommand = """update %s set Value1 = '%s', Value2 = '%s'
where ID = %s""" % (self.TblDsc.Table, ConvertToSqlString2(List[0]), ConvertToSqlString2(List[1]), Record[3])
self.TblDsc.Exec(SqlCommand)
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)
KeyStringList.append(self.__Token)
Avoid deeply nested control flow statements. Open
if not self.__IsToken( ")"):
raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
Avoid deeply nested control flow statements. Open
if Value != None: break
else:
Avoid deeply nested control flow statements. Open
if os.path.exists(Str):
if not os.path.isabs(Str):
Str = os.path.abspath(Str)
IncFileName = Str
Avoid deeply nested control flow statements. Open
if not self.__GetNextOp():
raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)
Avoid deeply nested control flow statements. Open
if self.__GetStringData():
pass
MacroValue = self.__Token
Avoid deeply nested control flow statements. Open
if not self.__IsToken(","):
break