hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File HTMLParser.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""A parser for HTML and XHTML."""

# This file is based on sgmllib.py, but the API is slightly different.

# XXX There should be a way to distinguish between PCDATA (parsed
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/HTMLParser.py - About 3 hrs to fix

    File markupbase.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Shared support for scanning document type declarations in HTML and XHTML.
    
    This module is used as a foundation for the HTMLParser and sgmllib
    modules (indirectly, for htmllib as well).  It has no documented
    public API and should not be used directly.
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/markupbase.py - About 3 hrs to fix

      File fancy_getopt.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """distutils.fancy_getopt
      
      Wrapper around the standard getopt module that provides the following
      additional features:
        * short and long options are tied together
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/fancy_getopt.py - About 3 hrs to fix

        File markupbase.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Shared support for scanning document type declarations in HTML and XHTML.
        
        This module is used as a foundation for the HTMLParser and sgmllib
        modules (indirectly, for htmllib as well).  It has no documented
        public API and should not be used directly.
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/markupbase.py - About 3 hrs to fix

          File HTMLParser.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """A parser for HTML and XHTML."""
          
          # This file is based on sgmllib.py, but the API is slightly different.
          
          # XXX There should be a way to distinguish between PCDATA (parsed
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/HTMLParser.py - About 3 hrs to fix

            File fancy_getopt.py has 306 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """distutils.fancy_getopt
            
            Wrapper around the standard getopt module that provides the following
            additional features:
              * short and long options are tied together
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/fancy_getopt.py - About 3 hrs to fix

              XMLFilterBase has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class XMLFilterBase(xmlreader.XMLReader):
                  """This class is designed to sit between an XMLReader and the
                  client application's event handlers.  By default, it does nothing
                  but pass requests up to the reader and events on to the handlers
                  unmodified, but subclasses can override specific methods to modify
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/sax/saxutils.py - About 3 hrs to fix

                ExpatBuilder has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ExpatBuilder:
                    """Document builder that uses Expat to build a ParsedXML.DOM document
                    instance."""
                
                    def __init__(self, options=None):
                Severity: Minor
                Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/expatbuilder.py - About 3 hrs to fix

                  XMLFilterBase has 28 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class XMLFilterBase(xmlreader.XMLReader):
                      """This class is designed to sit between an XMLReader and the
                      client application's event handlers.  By default, it does nothing
                      but pass requests up to the reader and events on to the handlers
                      unmodified, but subclasses can override specific methods to modify
                  Severity: Minor
                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/sax/saxutils.py - About 3 hrs to fix

                    ExpatBuilder has 28 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class ExpatBuilder:
                        """Document builder that uses Expat to build a ParsedXML.DOM document
                        instance."""
                    
                        def __init__(self, options=None):
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/expatbuilder.py - About 3 hrs to fix

                      File logger.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #!/usr/local/bin/python
                      #CHIPSEC: Platform Security Assessment Framework
                      #Copyright (c) 2010-2014, Intel Corporation
                      # 
                      #This program is free software; you can redistribute it and/or
                      Severity: Minor
                      Found in vector-uefi/fd/tool/chipsec/logger.py - About 3 hrs to fix

                        Method LzmaBenchmark has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                static public int LzmaBenchmark(Int32 numIterations, UInt32 dictionarySize)
                                {
                                    if (numIterations <= 0)
                                        return 0;
                                    if (dictionarySize < (1 << 18))
                        Severity: Major
                        Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LzmaAlone/LzmaBench.cs - About 3 hrs to fix

                          Method LzmaBenchmark has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              static public int LzmaBenchmark(int numIterations, int dictionarySize) throws Exception
                              {
                                  if (numIterations <= 0)
                                      return 0;
                                  if (dictionarySize < (1 << 18))
                          Severity: Major
                          Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 3 hrs to fix

                            Function GenFeatureFlagPcds has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def GenFeatureFlagPcds(self, Type='', ContainerFile=''):
                                    Pcds = {}
                                    if Type == DataType.TAB_PCDS_FEATURE_FLAG:
                                        Model = MODEL_PCD_FEATURE_FLAG
                                    else:
                            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 GetSplitValueList has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit= -1):
                                ValueList = []
                                Last = 0
                                Escaped = False
                                InString = False
                            Severity: Minor
                            Found in BaseTools/Source/Python/Common/String.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 StringToArray has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def StringToArray(String):
                                if isinstance(String, unicode):
                                    if len(unicode) == 0:
                                        return "{0x00, 0x00}"
                                    return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String])
                            Severity: Minor
                            Found in BaseTools/Source/Python/Common/String.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 IsModuleDefinedInPlatform has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def IsModuleDefinedInPlatform(self, Inf, Arch, InfList):
                                    for Dsc in self.DscDatabase.values():
                                        for LibraryClass in Dsc.Platform.LibraryClasses.LibraryList:
                                            if Inf == LibraryClass.FilePath and Arch in LibraryClass.SupArchList:
                                                return True
                            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 ValidatePS2 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def ValidatePS2(Package):
                                #
                                # Check DistributionPackage -> PackageSurfaceArea -> Modules -> ModuleSurfaceArea
                                #
                                XmlTreeLevel = ['DistributionPackage', 'PackageSurfaceArea', 'Modules', 'ModuleSurfaceArea']
                            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 IsValidCFormatGuid has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def IsValidCFormatGuid(Guid):
                                #
                                # Valid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 
                                #        0xaf, 0x48, 0xce }}
                                # Invalid: { 0xf0b11735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 
                            Severity: Minor
                            Found in BaseTools/Source/Python/UPT/Library/ParserValidate.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 GetFiles has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def GetFiles(Root, SkipList=None, FullPath=True):
                                OriPath = os.path.normpath(Root)
                                FileList = []
                                for Root, Dirs, Files in walk(Root):
                                    if SkipList:
                            Severity: Minor
                            Found in BaseTools/Source/Python/UPT/Library/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

                            Severity
                            Category
                            Status
                            Source
                            Language