hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def main():
    VERBOSE = 0
    DISPLAY = 0
    PROFILE = 0
    CONTINUE = 0
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/compiler/compile.py - About 5 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 _find has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    def _find(self, tests, obj, name, module, source_lines, globs, seen):
        """
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        """
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/doctest.py - About 5 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 context_diff has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def context_diff(a, b, fromfile='', tofile='',
                 fromfiledate='', tofiledate='', n=3, lineterm='\n'):
    r"""
    Compare two sequences of lines; generate the delta as a context diff.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/difflib.py - About 5 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 poll has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def poll(timeout=0.0, map=None):
    if map is None:
        map = socket_map
    if map:
        r = []; w = []; e = []
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/asyncore.py - About 5 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 order_blocks has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def order_blocks(start_block, exit_block):
    """Order blocks so that they are emitted in the right order"""
    # Rules:
    # - when a block has a next block, the next block must be emitted just after
    # - when a block has followers (relative jumps), it must be emitted before
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compiler/pyassem.py - About 5 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 listen has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
    """
    Start up a socket server on the specified port, and listen for new
    configurations.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/logging/config.py - About 5 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_uefi_region has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def parse_uefi_region( _uefi, data, uefi_region_path ):
    voln = 0
    FvOffset, FsGuid, FvLength, FvAttributes, FvHeaderLength, FvChecksum, ExtHeaderOffset, FvImage, CalcSum = NextFwVolume(data)
    while FvOffset != None:
        decode_log_path = os.path.join(uefi_region_path, "efi_firmware_volumes.log")
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/spi_uefi.py - About 5 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 getEFIvariables_NVAR has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def getEFIvariables_NVAR( nvram_buf ):
   start = nvram_buf.find( NVAR_EFIvar_signature )
   nvram_size = len(nvram_buf)
   EFI_HDR_NVAR = "<4sH3sB"
   nvar_size = struct.calcsize(EFI_HDR_NVAR)
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/uefi_platform.py - About 5 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 begin has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    def begin(self):
        if self.msg is not None:
            # we've already started reading the response
            return
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.py - About 5 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 _find has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    def _find(self, tests, obj, name, module, source_lines, globs, seen):
        """
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        """
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/doctest.py - About 5 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 poll has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def poll(timeout=0.0, map=None):
    if map is None:
        map = socket_map
    if map:
        r = []; w = []; e = []
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/asyncore.py - About 5 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 context_diff has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def context_diff(a, b, fromfile='', tofile='',
                 fromfiledate='', tofiledate='', n=3, lineterm='\n'):
    r"""
    Compare two sequences of lines; generate the delta as a context diff.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/difflib.py - About 5 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 listen has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
    """
    Start up a socket server on the specified port, and listen for new
    configurations.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/config.py - About 5 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 order_blocks has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def order_blocks(start_block, exit_block):
    """Order blocks so that they are emitted in the right order"""
    # Rules:
    # - when a block has a next block, the next block must be emitted just after
    # - when a block has followers (relative jumps), it must be emitted before
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/compiler/pyassem.py - About 5 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 DataType.py has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define common static strings used by INF/DEC/DSC files
#
# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
Severity: Minor
Found in BaseTools/Source/Python/Common/DataType.py - About 5 hrs to fix

    File InfBinaryObject.py has 398 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ## @file
    # This file is used to define class objects of INF file [Binaries] section. 
    # It will consumed by InfParser. 
    #
    # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 5 hrs to fix

      FSProxyLocal has 41 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class FSProxyLocal:
      
          def __init__(self):
              self._dirstack = []
              self._ignore = ['*.pyc'] + self._readignore()
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/FSProxy.py - About 5 hrs to fix

        Bdb has 41 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Bdb:
        
            """Generic Python debugger base class.
        
            This class takes care of details of the trace facility;
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/bdb.py - About 5 hrs to fix

          Bdb has 41 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Bdb:
          
              """Generic Python debugger base class.
          
              This class takes care of details of the trace facility;
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/bdb.py - About 5 hrs to fix

            Function GenSkuInfos has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenSkuInfos(self, ContainerFile):
                    EdkLogger.debug(2, "Generate %s ..." % TAB_SKUIDS)
                    #
                    # SkuIds
                    # <Integer>|<UiName>
            Severity: Minor
            Found in BaseTools/Source/Python/Common/DscClassObject.py - About 5 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