hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function configure has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    def configure(self):
        """Do the configuration."""

        config = self.config
        if 'version' not in config:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/config.py - About 1 day 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 uname has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

def uname():

    """ Fairly portable uname interface. Returns a tuple
        of strings (system,node,release,version,machine,processor)
        identifying the underlying platform.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/platform.py - About 1 day 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 has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    def _read(self, fp, fpname):
        """Parse a sectioned setup file.

        The sections in setup file contains a title line at the top,
        indicated by a name in square brackets (`[]'), plus key/value
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ConfigParser.py - About 1 day 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 configure has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    def configure(self):
        """Do the configuration."""

        config = self.config
        if 'version' not in config:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/config.py - About 1 day 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 os.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""OS routines for Mac, NT, Posix, or UEFI depending on what system we're on.

This exports:
  - all functions from edk2, posix, nt, os2, or ce, e.g. unlink, stat, etc.
  - os.path is one of the modules uefipath, posixpath, or ntpath
Severity: Major
Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/os.py - About 1 day to fix

    File os.py has 607 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """OS routines for Mac, NT, Posix, or UEFI depending on what system we're on.
    
    This exports:
      - all functions from edk2, posix, nt, os2, or ce, e.g. unlink, stat, etc.
      - os.path is one of the modules uefipath, posixpath, or ntpath
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/os.py - About 1 day to fix

      File refactor.py has 603 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Copyright 2006 Google, Inc. All Rights Reserved.
      # Licensed to PSF under a Contributor Agreement.
      
      """Refactoring framework.
      
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/refactor.py - About 1 day to fix

        File refactor.py has 603 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # Copyright 2006 Google, Inc. All Rights Reserved.
        # Licensed to PSF under a Contributor Agreement.
        
        """Refactoring framework.
        
        Severity: Major
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/refactor.py - About 1 day to fix

          File msilib.py has 601 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # Microsoft Installer Library
          # (C) 2003 Martin v. Loewis
          
          import win32com.client.gencache
          import win32com.client
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/msi/msilib.py - About 1 day to fix

            Method Code has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean Code(java.io.InputStream inStream, java.io.OutputStream outStream,
                        long outSize) throws IOException
                {
                    m_RangeDecoder.SetStream(inStream);
                    m_OutWindow.SetStream(outStream);
            Severity: Minor
            Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Decoder.java - About 1 day 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 enum_specifier has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                def enum_specifier(self, ):
            
                    retval = self.enum_specifier_return()
                    retval.start = self.input.LT(1)
                    enum_specifier_StartIndex = self.input.index()
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day 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 type_specifier has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                def type_specifier(self, ):
            
                    type_specifier_StartIndex = self.input.index()
                    s = None
            
            Severity: Minor
            Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day 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 type_specifier has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                def type_specifier(self, ):
            
                    type_specifier_StartIndex = self.input.index()
                    s = None
            
            Severity: Minor
            Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day 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 enum_specifier has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
            Open

                def enum_specifier(self, ):
            
                    retval = self.enum_specifier_return()
                    retval.start = self.input.LT(1)
                    enum_specifier_StartIndex = self.input.index()
            Severity: Minor
            Found in BaseTools/Source/Python/Eot/CParser.py - About 1 day 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

            Method CodeOneBlock has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring.
            Open

                    public void CodeOneBlock(out Int64 inSize, out Int64 outSize, out bool finished)
                    {
                        inSize = 0;
                        outSize = 0;
                        finished = true;
            Severity: Minor
            Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZMA/LzmaEncoder.cs - About 1 day 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 Arithmetic.py has 596 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from pybench import Test
            
            class SimpleIntegerArithmetic(Test):
            
                version = 2.0
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Arithmetic.py - About 1 day to fix

              File os.py has 595 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              r"""OS routines for Mac, NT, or Posix depending on what system we're on.
              
              This exports:
                - all functions from posix, nt, os2, or ce, e.g. unlink, stat, etc.
                - os.path is one of the modules posixpath, or ntpath
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/os.py - About 1 day to fix

                Function PatchBinaryFile has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
                    #
                    # Length of Binary File
                    #
                    FileHandle = open (FileName, 'rb')
                Severity: Minor
                Found in BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py - About 1 day 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 _GenDepexes has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _GenDepexes(self):
                        Logger.Debug(2, "Generate %s ..." % DT.TAB_DEPEX)
                
                        PEI_LIST = [DT.SUP_MODULE_PEIM]
                        SMM_LIST = [DT.SUP_MODULE_DXE_SMM_DRIVER]
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 1 day 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 iteration_statement has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                Open

                    def iteration_statement(self, ):
                
                        iteration_statement_StartIndex = self.input.index()
                        e = None
                
                Severity: Minor
                Found in BaseTools/Source/Python/Ecc/CParser.py - About 1 day 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