hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function makeunicodename has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def makeunicodename(unicode, trace):

    FILE = "Modules/unicodename_db.h"

    print "--- Preparing", FILE, "..."

    Function _PackByteArray has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _PackByteArray(self, ValueString, Size):
            if (Size < 0):        
                EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter Size %s of PCD %s!(File: %s Line: %s)" % (self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno))
            if (ValueString == ""):
                EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invalid parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (self.PcdUnpackValue, self.PcdCName, self.FileName, self.Lineno)) 
    Severity: Minor
    Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 2 hrs to fix

    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 __GetFvInFd has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetFvInFd (self, FdName):
        
            FvList = []
            if FdName.upper() in self.Profile.FdDict.keys():
                FdObj = self.Profile.FdDict[FdName.upper()]
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 hrs to fix

    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 Validate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def Validate(self, Type='', CaseSensitive=True):
            if GlobalData.gCaseInsensitive:
                CaseSensitive = False
            if Type and Type.lower() != self.Type:
                return FILE_TYPE_MISMATCH, '%s (expect %s but got %s)' % (self.File, Type, self.Type)
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.py - About 2 hrs to fix

    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 __GetFileStatement has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetFileStatement(self, Obj, ForCapsule = False, MacroDict = {}):
    
            if not self.__IsKeyword( "FILE"):
                return False
            
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 hrs to fix

    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 __GetRegionLayout has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetRegionLayout(self, Fd):
            if not self.__GetNextHexNumber():
                return False
            
            RegionObj = CommonDataClass.FdfClass.RegionClassObject()
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 hrs to fix

    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 PreCheck has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def PreCheck(FileName, FileContent, SupSectionTag):
        LineNo = 0
        IsFailed = False
        NewFileContent = ''
        for Line in FileContent.splitlines():
    Severity: Minor
    Found in BaseTools/Source/Python/Common/String.py - About 2 hrs to fix

    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 __init__ has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
                     Arch='COMMON', ToolChainFamily='', Target='', TagName='', ToolCode=''):
            self.Arch = Arch
            self.File = str(File)
            if os.path.isabs(self.File):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.py - About 2 hrs to fix

    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 GenLibraryClasses has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenLibraryClasses(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
            LibraryClasses = {}
            #
            # Get all Guids
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DecClassObject.py - About 2 hrs to fix

    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 GenBinaryData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryFileObjectList, SupArchList, BinaryModule):
        if BinaryModule:
            pass
        OriSupArchList = SupArchList
        for Item in BinaryData:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py - About 2 hrs to fix

    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 ValidatePS1 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def ValidatePS1(Package):
        #
        # Check DistributionPackage -> PackageSurfaceArea -> Header
        #
        XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'Header']
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 2 hrs to fix

    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 XmlNode has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def XmlNode(Dom, String):
        if String == None or String == ""  or Dom == None or Dom == "":
            return None
        if Dom.nodeType == Dom.DOCUMENT_NODE:
            Dom = Dom.documentElement
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py - About 2 hrs to fix

    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 ValidRange has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def ValidRange(self):
            if self.IsCurrentOp(["("]):
                self.RangeExpression()
                if not self.IsCurrentOp([")"]):
                    raise _ExprError('')
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.py - About 2 hrs to fix

    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 XmlList has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def XmlList(Dom, String):
        if String == None or String == "" or Dom == None or Dom == "":
            return []
        if Dom.nodeType == Dom.DOCUMENT_NODE:
            Dom = Dom.documentElement
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py - About 2 hrs to fix

    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 _CheckToken has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CheckToken(self, MatchList):
            for Match in MatchList:
                if Match and Match.start() == 0:
                    if not _ValidateToken(
                                self.Token[self.Index:self.Index+Match.end()]
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ExpressionValidate.py - About 2 hrs to fix

    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 GetModuleList has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList):
        #
        # ModulePathList will keep track of the standalone module path that
        # we just installed. If a new module's path in that list 
        # (only multiple INF in one directory will be so), we will 
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/InstallPkg.py - About 2 hrs to fix

    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 InfUserExtensionParser has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def InfUserExtensionParser(self, SectionString, InfSectionObject, FileName):
    
            UserExtensionContent = ''
    
            #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py - About 2 hrs to fix

    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 Validate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def Validate(self, Type='', CaseSensitive=True):
            if GlobalData.gCASE_INSENSITIVE:
                CaseSensitive = False
            if Type and Type.lower() != self.Type:
                return ToolError.FILE_TYPE_MISMATCH, '%s (expect %s but got %s)' % \
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 2 hrs to fix

    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 __init__ has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
                     Arch='COMMON', ToolChainFamily='', Target='', TagName='', \
                     ToolCode=''):
            self.Arch = Arch
            self.File = str(File)
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 2 hrs to fix

    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 IsValidPath has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def IsValidPath(Path, Root):
        Path = Path.strip()
        OrigPath = Path.replace('\\', '/')
        
        Path = os.path.normpath(Path).replace('\\', '/')
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/ParserValidate.py - About 2 hrs to fix

    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

    Severity
    Category
    Status
    Source
    Language