hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function __init__ has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
                       int=None, version=None):
        r"""Create a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/uuid.py - About 4 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 31 (exceeds 5 allowed). Consider refactoring.
Open

def main(fixer_pkg, args=None):
    """Main program.

    Args:
        fixer_pkg: the name of a package where the fixers are located.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/main.py - About 4 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 deepcopy has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def deepcopy(x, memo=None, _nil=[]):
    """Deep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    """
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/copy.py - About 4 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 copy_file has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
              link=None, verbose=1, dry_run=0):
    """Copy a file 'src' to 'dst'.

    If 'dst' is a directory, then 'src' is copied there with the same name;
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/file_util.py - About 4 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 31 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse(self, file, fp):
        lexer = shlex.shlex(fp)
        lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
        lexer.commenters = lexer.commenters.replace('#', '')
        while 1:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/netrc.py - About 4 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 _install_loggers has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def _install_loggers(cp, handlers, disable_existing_loggers):
    """Create and install loggers"""

    # configure the root first
    llist = cp.get("loggers", "keys")
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/config.py - About 4 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 _get_response has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_response(self):

        # Read response and store.
        #
        # Returns None for continuation responses,
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/imaplib.py - About 4 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

ModuleObject has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class ModuleObject(ModuleHeaderObject):
    def __init__(self):
        #
        # {Arch : ModuleHeaderObject}
        #
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py - About 4 hrs to fix

    XMLParser has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class XMLParser:
        attributes = {}                     # default, to be overridden
        elements = {}                       # default, to be overridden
    
        # parsing options, settable using keyword args in __init__
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xmllib.py - About 4 hrs to fix

      NNTP has 35 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class NNTP:
          def __init__(self, host, port=NNTP_PORT, user=None, password=None,
                       readermode=None, usenetrc=True):
              """Initialize an instance.  Arguments:
              - host: hostname to connect to
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/nntplib.py - About 4 hrs to fix

        XMLParser has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class XMLParser:
            attributes = {}                     # default, to be overridden
            elements = {}                       # default, to be overridden
        
            # parsing options, settable using keyword args in __init__
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/xmllib.py - About 4 hrs to fix

          NNTP has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class NNTP:
              def __init__(self, host, port=NNTP_PORT, user=None, password=None,
                           readermode=None, usenetrc=True):
                  """Initialize an instance.  Arguments:
                  - host: hostname to connect to
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/nntplib.py - About 4 hrs to fix

            File sdist.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """distutils.command.sdist
            
            Implements the Distutils 'sdist' command (create a source distribution)."""
            
            __revision__ = "$Id$"

              File sdist.py has 354 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """distutils.command.sdist
              
              Implements the Distutils 'sdist' command (create a source distribution)."""
              
              __revision__ = "$Id$"
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/sdist.py - About 4 hrs to fix

                Method Code has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
                            Int64 inSize, Int64 outSize, ICodeProgress progress)
                        {
                            Init(inStream, outStream);
                
                Severity: Major
                Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaDecoder.cs - About 4 hrs to fix

                  File fileinput.py has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """Helper class to quickly write a loop over all standard input files.
                  
                  Typical use is:
                  
                      import fileinput
                  Severity: Minor
                  Found in AppPkg/Applications/Python/Python-2.7.2/Lib/fileinput.py - About 4 hrs to fix

                    File fileinput.py has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """Helper class to quickly write a loop over all standard input files.
                    
                    Typical use is:
                    
                        import fileinput
                    Severity: Minor
                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/fileinput.py - About 4 hrs to fix

                      File ntpath.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
                      """Common pathname manipulations, WindowsNT/95 version.
                      
                      Instead of importing this module directly, import os and refer to this
                      module as os.path.
                      Severity: Minor
                      Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/ntpath.py - About 4 hrs to fix

                        File ntpath.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # Module 'ntpath' -- common operations on WinNT/Win95 pathnames
                        """Common pathname manipulations, WindowsNT/95 version.
                        
                        Instead of importing this module directly, import os and refer to this
                        module as os.path.
                        Severity: Minor
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/ntpath.py - About 4 hrs to fix

                          Function GenPcds has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def GenPcds(self, ContainerFile):
                                  EdkLogger.debug(2, "Generate %s ..." % TAB_PCDS)
                                  Pcds = {}
                                  PcdToken = {}
                                  #
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/DecClassObject.py - About 4 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