hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function docclass has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def docclass(self, object, name=None, mod=None, *ignored):
        """Produce text documentation for a given class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__
Severity: Minor
Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.py - About 6 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 docclass has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def docclass(self, object, name=None, mod=None, *ignored):
        """Produce text documentation for a given class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc.py - About 6 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 read_spi has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def read_spi(self, spi_fla, data_byte_count ):
        spi_base = self.rcba_spi_base  
        buf = []      

        dbc = SPI_READ_WRITE_DEF_DBC
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/spi.py - About 6 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 build_xml has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def build_xml(self):
        """Builds the XML elements."""
        ts_attributes                  = dict()
        if self.name:
            ts_attributes["name"]      = str( self.name )
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/xmlout.py - About 6 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 docclass has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    def docclass(self, object, name=None, mod=None, *ignored):
        """Produce text documentation for a given class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 6 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

File gettext.py has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/gettext.py - About 6 hrs to fix

    File gettext.py has 426 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Internationalization and localization support.
    
    This module provides internationalization (I18N) and localization (L10N)
    support for your Python programs by providing an interface to the GNU gettext
    message catalog library.
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/gettext.py - About 6 hrs to fix

      File Unicode.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      try:
          unicode
      except NameError:
          raise ImportError
      
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Unicode.py - About 6 hrs to fix

        File sre_compile.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #
        # Secret Labs' Regular Expression Engine
        #
        # convert template to internal format
        #
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/sre_compile.py - About 6 hrs to fix

          File sre_compile.py has 424 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #
          # Secret Labs' Regular Expression Engine
          #
          # convert template to internal format
          #
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_compile.py - About 6 hrs to fix

            File install.py has 423 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """distutils.command.install
            
            Implements the Distutils 'install' command."""
            
            from distutils import log

              File install.py has 423 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """distutils.command.install
              
              Implements the Distutils 'install' command."""
              
              from distutils import log
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/install.py - About 6 hrs to fix

                File bgenObjectDefinition.py has 421 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from bgenOutput import *
                from bgenGeneratorGroup import GeneratorGroup
                
                class ObjectDefinition(GeneratorGroup):
                    "Spit out code that together defines a new Python object type"

                  File CommandLine.py has 421 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """ CommandLine - Get and parse command line options
                  
                      NOTE: This still is very much work in progress !!!
                  
                      Different version are likely to be incompatible.
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/CommandLine.py - About 6 hrs to fix

                    Function InfLibraryParser has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def InfLibraryParser(self, SectionString, InfSectionObject, FileName):
                            #
                            # For Common INF file
                            #
                            if not GlobalData.gIS_BINARY_INF:
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py - About 6 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 _GetModules has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _GetModules(self):
                            if self._Modules != None:
                                return self._Modules
                    
                            self._Modules = sdict()
                    Severity: Minor
                    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 6 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 InfSpecialCommentParser has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def InfSpecialCommentParser (self, SpecialSectionList, InfSectionObject, ContainerFile, SectionType):
                            ReFindSpecialCommentRe = re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)
                            ReFindHobArchRe = re.compile(r"""[Hh][Oo][Bb]\.([^,]*)""", re.DOTALL)
                            if self.FileName:
                                pass
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Parser/InfSectionParser.py - About 6 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 Parse has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def Parse(self):
                            HeadComments = []
                            TailComments = []
                            
                            #======================================================================
                    Severity: Minor
                    Found in BaseTools/Source/Python/UPT/Parser/DecParser.py - About 6 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 BlockInfoOfRegion has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def BlockInfoOfRegion(self, BlockSizeList, FvObj):
                            Start = 0
                            End = 0
                            RemindingSize = self.Size
                            ExpectedList = []
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/Region.py - About 6 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 MetaDataFileCheckPcdType has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def MetaDataFileCheckPcdType(self):
                            if EccGlobalData.gConfig.MetaDataFileCheckPcdType == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
                                EdkLogger.quiet("Checking for pcd type in c code function usage ...")
                                SqlCommand = """
                                             select ID, Model, Value1, Value2, BelongsToFile from INF where Model > %s and Model < %s
                    Severity: Minor
                    Found in BaseTools/Source/Python/Ecc/Check.py - About 6 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