hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function main has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    import sys
    import getopt
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'td')
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/quopri.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 seek has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def seek(self, cookie, whence=0):
        if self.closed:
            raise ValueError("tell on closed file")
        if not self._seekable:
            raise IOError("underlying stream is not seekable")
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/_pyio.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 loadTestsFromName has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def loadTestsFromName(self, name, module=None):
        """Return a suite of all tests cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/unittest/loader.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 __init__ has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
        """Open the ZIP file with mode read "r", write "w" or append "a"."""
        if mode not in ("r", "w", "a"):
            raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/zipfile.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 get_libraries has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def get_libraries (self, ext):
        """Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows and OS/2, we add the Python library (eg. python20.dll).
        """

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 finalize_options has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def finalize_options (self):

        # This method (and its pliant slaves, like 'finalize_unix()',
        # 'finalize_other()', and 'select_scheme()') is where the default
        # installation directories for modules, extension modules, and
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/install.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 make_zipfile has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
    """Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/archive_util.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 compile has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def compile(self, sources,
                output_dir=None, macros=None, include_dirs=None, debug=0,
                extra_preargs=None, extra_postargs=None, depends=None):

        if not self.initialized:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/msvc9compiler.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 parse_known_args has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_known_args(self, args=None, namespace=None):
        # args default to the system args
        if args is None:
            args = _sys.argv[1:]
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.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

Method Skip has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
Open

        public void Skip(UInt32 num)
        {
            do
            {
                UInt32 lenLimit;
Severity: Minor
Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZ/LzBinTree.cs - 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

File Tuples.py has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from pybench import Test

class TupleSlicing(Test):

    version = 2.0
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Tuples.py - About 3 hrs to fix

    File weakref.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Weak reference support for Python.
    
    This module is an implementation of PEP 205:
    
    http://www.python.org/dev/peps/pep-0205/
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/weakref.py - About 3 hrs to fix

      File weakref.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Weak reference support for Python.
      
      This module is an implementation of PEP 205:
      
      http://www.python.org/dev/peps/pep-0205/
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/weakref.py - About 3 hrs to fix

        Function makeunicodetype has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def makeunicodetype(unicode, trace):
        
            FILE = "Objects/unicodetype_db.h"
        
            print "--- Preparing", FILE, "..."

          File DecClassObject.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is used to define each component of DEC file
          #
          # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
          # This program and the accompanying materials
          Severity: Minor
          Found in BaseTools/Source/Python/Common/DecClassObject.py - About 3 hrs to fix

            File pulldom.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import xml.sax
            import xml.sax.handler
            import types
            
            try:
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/pulldom.py - About 3 hrs to fix

              File pulldom.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import xml.sax
              import xml.sax.handler
              import types
              
              try:
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/pulldom.py - About 3 hrs to fix

                DscParser has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class DscParser(MetaFileParser):
                    # DSC file supported data types (one type per section)
                    DataType = {
                        TAB_SKUIDS.upper()                          :   MODEL_EFI_SKU_ID,
                        TAB_LIBRARIES.upper()                       :   MODEL_EFI_LIBRARY_INSTANCE,
                Severity: Minor
                Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                  if LA64 == IDENTIFIER or LA64 == HEX_LITERAL or LA64 == OCTAL_LITERAL or LA64 == DECIMAL_LITERAL or LA64 == CHARACTER_LITERAL or LA64 == STRING_LITERAL or LA64 == FLOATING_POINT_LITERAL or LA64 == 62:
                                      alt64 = 1
                                  elif LA64 == 72:
                                      alt64 = 2
                                  elif LA64 == 73:
                  Severity: Critical
                  Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix

                    DscParser has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class DscParser(MetaFileParser):
                        # DSC file supported data types (one type per section)
                        DataType = {
                            TAB_SKUIDS.upper()                          :   MODEL_EFI_SKU_ID,
                            TAB_LIBRARIES.upper()                       :   MODEL_EFI_LIBRARY_INSTANCE,
                    Severity: Minor
                    Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language