Showing 9,525 of 13,510 total issues
Function GetStandaloneModule
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GetStandaloneModule(self, Guid, Version, Name, Path, DpGuid='', DpVersion=''):
Function CheckModuleDependFromInf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def CheckModuleDependFromInf(Path, DpPackagePathList):
#
# use InfParser to parse inf, then get the information for now,
# later on, may consider only parse to get the package dependency info
- 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 ObjectFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ObjectFactory(self, CName, FFE, Usage, Notify, HelpStr, IsProtocol):
Function CheckFileExist
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo=-1):
Function LogicalExpression
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def LogicalExpression(self):
Ret = self.SpecNot()
while self.IsCurrentOp(['||', 'OR', 'or', '&&', 'AND', 'and', 'XOR']):
if self.Token[self.Index-1] == '|' and self.Parens <= 0:
raise _ExprError(ST.ERR_EXPR_OR)
- 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 _AddStandaloneModule
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=None, \
Avoid deeply nested control flow statements. Open
if Dep.GetVersion() == None or \
len(Dep.GetVersion()) == 0:
Result = True
break
if Dep.GetVersion() == GuidVerPair[1]:
Avoid deeply nested control flow statements. Open
if LineNo > Last:
if License:
License += EndOfLine
License += Comment + EndOfLine
HeaderCommentStage = HEADER_COMMENT_LICENSE
Function GetSingleValueOfKeyFromLines
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, \
Function ToXml
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ToXml(self, Dict, Key):
if self.UserExtensionBinary:
pass
BinariesNodeList = []
for Item in Dict:
- 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 GuidFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def GuidFactory(self, CName, FFE, Usage, GuidType, VariableName, HelpStr):
Function _AddModuleInPackage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=None, \
Function PrepareTest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def PrepareTest(String):
SectionString = StringToSectionString(String)
ItemList = []
for Item in SectionString:
ValueList = Item[0].split('|')
- 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 IsValidFeatureFlagExp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def IsValidFeatureFlagExp(Token, Flag=False):
#
# Not do the check right now, keep the implementation for future enhancement.
#
if not Flag:
- 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 CheckDpDepexSatisfied
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def CheckDpDepexSatisfied(self, DpObj, ReturnCode=DEPEX_CHECK_SUCCESS):
for PkgKey in DpObj.PackageSurfaceArea.keys():
PkgObj = DpObj.PackageSurfaceArea[PkgKey]
if self.CheckPackageDepexSatisfied(PkgObj, DpObj, ReturnCode):
- 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 _AddModuleDepex
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=None, \
Function ReplaceMacro
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ReplaceMacro(String, MacroDefinitions = None, SelfReplacement = False, Line = None, FileName = None, Flag = False):
Function ValidateValues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ValidateValues(Key, Value, SectionName):
if SectionName == 'DistributionHeader':
Valid, Cause = ValidateRegValues(Key, Value)
if not Valid:
return Valid, Cause
- 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 GenSourceStatement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=None,
ToolCode=None, HelpStr=None):
Statement = ''
if HelpStr:
Statement += GenGenericCommentF(HelpStr)
- 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 PcdExDict.has_key(Arch):
PcdExDict[Arch].append(Statement)
else:
PcdExDict[Arch] = [Statement]
return GenSection('PcdEx', PcdExDict)