hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File warnings.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Python part of the warnings subsystem."""

# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/warnings.py - About 3 hrs to fix

    Function GenBuildOptions has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenBuildOptions(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_BUILD_OPTIONS)
            BuildOptions = {}
            #
            # Get all include files
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 GenDynamicHiiPcds has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenDynamicHiiPcds(self, Type='', ContainerFile=''):
            Pcds = {}
            SkuInfoList = {}
            if Type == DataType.TAB_PCDS_DYNAMIC_HII:
                Model = MODEL_PCD_DYNAMIC_HII
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 GenDynamicVpdPcds has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenDynamicVpdPcds(self, Type='', ContainerFile=''):
            Pcds = {}
            SkuInfoList = {}
            if Type == DataType.TAB_PCDS_DYNAMIC_VPD:
                Model = MODEL_PCD_DYNAMIC_VPD
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 GenDynamicDefaultPcds has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenDynamicDefaultPcds(self, Type='', ContainerFile=''):
            Pcds = {}
            SkuInfoList = {}
            if Type == DataType.TAB_PCDS_DYNAMIC_DEFAULT:
                Model = MODEL_PCD_DYNAMIC_DEFAULT
    Severity: Minor
    Found in BaseTools/Source/Python/Common/DscClassObject.py - About 3 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 _GetAllValues has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetAllValues(self, FirstKey, RestKeys):
            Value = []
            if self._Level_ > 1:
                if FirstKey == self._Wildcard:
                    for Key in self.data:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.py - About 3 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 __GetCglSection has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetCglSection(self, Obj, AlignValue = None):
            
            if self.__IsKeyword( "COMPRESS"):
                type = "PI_STD"
                if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 3 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 UpdateLibrariesOfPlatform has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def UpdateLibrariesOfPlatform(self, InfList = []):
            for Arch in self.SupArchList:
                PlatformDatabase = self.Build[Arch].PlatformDatabase
                for Dsc in PlatformDatabase:
                    Platform = PlatformDatabase[Dsc]
    Severity: Minor
    Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 3 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 _GenSpecialComments has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenSpecialComments(self):
            SpecialCommentsList = self.Parser.InfSpecialCommentSection.GetSpecialComments()
            for Key in SpecialCommentsList:
                if Key == DT.TYPE_HOB_SECTION:
                    HobList = []
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 3 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 ReplaceExprMacro has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def ReplaceExprMacro(String, Macros, ExceptionList = None):
        StrList = SplitString(String)
        for i, String in enumerate(StrList):
            InQuote = False
            if String.startswith('"'):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Expression.py - About 3 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 ValidateDistributionPackage has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def ValidateDistributionPackage(self):
            XmlTreeLevel = ['DistributionPackage']
            if self.DistP:
                #
                # Check DistributionPackage -> DistributionHeader
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 3 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 InfPackageParser has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def InfPackageParser(self, SectionString, InfSectionObject, FileName):
            #
            # Macro defined in this section 
            #
            SectionMacros = {}
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py - About 3 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 ParseDecComment has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def ParseDecComment(self):
            IsFileHeader = False
            IsBinaryHeader = False
            FileHeaderLineIndex = -1
            BinaryHeaderLineIndex = -1
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Parser/DecParser.py - About 3 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 InfAsBuiltBuildOptionParser has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def InfAsBuiltBuildOptionParser(SectionString, FileName):
        BuildOptionList = []       
        #
        # AsBuild Binary INF file.
        #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py - About 3 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 InfSourceParser has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def InfSourceParser(self, SectionString, InfSectionObject, FileName):
            SectionMacros = {}
            ValueList     = []
            SourceList    = []
            StillCommentFalg  = False
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py - About 3 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 Start has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def Start(self):
            Content = ''
            try:
                Content = open(str(self.MetaFile), 'r').readlines()
            except:
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 3 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 __FindExtendTool__ has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def __FindExtendTool__(self):
            # if user not specify filter, try to deduce it from global data.
            if self.KeyStringList == None or self.KeyStringList == []:
                Target = GenFdsGlobalVariable.TargetName
                ToolChain = GenFdsGlobalVariable.ToolChainTag
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/GuidSection.py - About 3 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 GenSection has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
    
            OutputFileList = []
            if self.FvFileType != None:
                FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FvFileType, self.FvFileExtension)
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/FvImageSection.py - About 3 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 Optimize has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def Optimize(self):
            ValidOpcode = list(set(self.OpcodeList))
            if len(ValidOpcode) != 1 or ValidOpcode[0] not in ['AND', 'OR']:
                return
            Op = ValidOpcode[0]
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenDepex.py - About 3 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 CreateCFileContent has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateCFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniBinBuffer, FilterInfo):
        #
        # Init array length
        #
        TotalLength = EFI_HII_ARRAY_SIZE_LENGTH
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/StrGather.py - About 3 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