hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File LzmaDecoder.cs has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;

namespace SevenZip.Compression.LZMA
{
    using RangeCoder;
Severity: Minor
Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaDecoder.cs - About 4 hrs to fix

    File urlparse.py has 332 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Parse (absolute and relative) URLs.
    
    urlparse module is based upon the following RFC specifications.
    
    RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/urlparse.py - About 4 hrs to fix

      File urlparse.py has 332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Parse (absolute and relative) URLs.
      
      urlparse module is based upon the following RFC specifications.
      
      RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/urlparse.py - About 4 hrs to fix

        File gencodec.py has 331 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """ Unicode Mapping Parser and Codec Generator.
        
        This script parses Unicode mapping files as available from the Unicode
        site (ftp://ftp.unicode.org/Public/MAPPINGS/) and creates Python codec
        modules from them. The codecs use the standard character mapping codec
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/unicode/gencodec.py - About 3 hrs to fix

          Method ParseString has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  bool ParseString(string srcString, SwitchForm[] switchForms)
                  {
                      int len = srcString.Length;
                      if (len == 0)
                          return false;
          Severity: Major
          Found in vector-uefi/insyde/7zip/CS/7zip/Common/CommandLineParser.cs - About 3 hrs to fix

            Function GenLibraries has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenLibraries(self, ContainerFile):
                    EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARIES)
                    Libraries = {}
                    #
                    # 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 __GetRegionDataType has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetRegionDataType(self, RegionObj):
                    
                    if not self.__IsKeyword( "DATA"):
                        raise Warning("expected Region Data type At Line ", self.FileName, self.CurrentLineNumber)
            
            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 __GetRuleEncapsulationSection has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetRuleEncapsulationSection(self, Rule):
            
                    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 SetDepex has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def SetDepex(self, DepexContent, KeyList=None, CommentList=None):
                    for KeyItem in KeyList:
                        Arch = KeyItem[0]
                        ModuleType = KeyItem[1]
                        InfDepexItemIns = InfDepexItem()
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.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 GenFd has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenFd (OutputDir, FdfParser, WorkSpace, ArchList):
                    GenFdsGlobalVariable.SetDir ('', FdfParser, WorkSpace, ArchList)
            
                    GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and their required FV and Capsule images!")
                    if GenFds.OnlyGenerateThisCap != None and GenFds.OnlyGenerateThisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict.keys():
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/GenFds.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 __GetRuleEncapsulationSection has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetRuleEncapsulationSection(self, Rule):
            
                    if self.__IsKeyword( "COMPRESS"):
                        Type = "PI_STD"
                        if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.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 GenVtfFile has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenVtfFile (self) :
                    #
                    # Get this Fd's all Fv name
                    #
                    FvAddDict ={}
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/Fd.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 _CollectFvMapBuffer has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def _CollectFvMapBuffer (self, MapBuffer, Wa, ModuleList):
                    if self.Fdf:
                        # First get the XIP base address for FV map file.
                        GuidPattern = re.compile("[-a-fA-F0-9]+")
                        GuidName = re.compile("\(GUID=[-a-fA-F0-9]+")
            Severity: Minor
            Found in BaseTools/Source/Python/build/build.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 CreateUnicodeStringCode has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH, UniGenCFlag, UniGenBinBuffer):
                WorkingDir = os.getcwd()
                os.chdir(Info.WorkspaceDir)
            
                IncList = [Info.MetaFile.Dir]
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/GenC.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 GetFinalTypeValue has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict):
                Value = TypedefDict.get(Type)
                if Value == None:
                    Value = SUDict.get(Type)
                if Value == None:
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/c.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 BuildMetaDataFileDatabase has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def BuildMetaDataFileDatabase(self):
                    EdkLogger.quiet("Building database for meta data files ...")
                    Op = open(EccGlobalData.gConfig.MetaDataFileCheckPathOfGenerateFileList, 'w+')
                    #SkipDirs = Read from config file
                    SkipDirs = EccGlobalData.gConfig.SkipDirList
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/Ecc.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 main has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def main():
                filename = "gprof.out"
                if sys.argv[1:]:
                    filename = sys.argv[1]
                outputfilename = filename + ".html"
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/gprof2html.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 TrimPreprocessedVfr has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def TrimPreprocessedVfr(Source, Target):
                CreateDirectory(os.path.dirname(Target))
                
                try:
                    f = open (Source,'r')
            Severity: Minor
            Found in BaseTools/Source/Python/Trim/Trim.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 run_all_tests has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def run_all_tests(options):
                def print_label(filename, func):
                    name = re.split(r'[-.]', filename)[0]
                    out.write(
                        ("[%s] %s... "
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/iobench/iobench.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 docroutine has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                def docroutine(self, object, name=None, mod=None,
                               funcs={}, classes={}, methods={}, cl=None):
                    """Produce HTML documentation for a function or method object."""
                    realname = object.__name__
                    name = name or realname
            Severity: Minor
            Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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