hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function SearchPpi has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

def SearchPpi(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMode, PpiMode = 1):
    ItemName, ItemType, GuidName, GuidMacro, GuidValue = '', 'Ppi', '', '', ''
    BelongsToFunctionID, BelongsToFunction = -1, ''
    Db = EotGlobalData.gDb.TblReport
    RecordSet = Db.Exec(SqlCommand)
Severity: Minor
Found in BaseTools/Source/Python/Eot/Parser.py - About 7 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 open has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

def open(file, mode="r", buffering=-1,
         encoding=None, errors=None,
         newline=None, closefd=True):

    r"""Open file and return a stream.  Raise IOError upon failure.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/_pyio.py - About 7 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_section has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

def parse_uefi_section( _uefi, data, Size, offset, polarity, parent_offset, parent_path, decode_log_path ):
   sec_offset, next_sec_offset, SecName, SecType, SecBody, SecHeaderSize = NextFwFileSection(data, Size, offset, polarity)
   secn = 0
   ui_string = None
   efi_file = None
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/spi_uefi.py - About 7 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 spi has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

def spi(argv):

    if 3 > len(argv):
      print usage
      return
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/utilcmd/spi_cmd.py - About 7 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 open has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

def open(file, mode="r", buffering=-1,
         encoding=None, errors=None,
         newline=None, closefd=True):

    r"""Open file and return a stream.  Raise IOError upon failure.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/_pyio.py - About 7 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 uefi_common.py has 457 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/local/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2014, Intel Corporation
# 
#This program is free software; you can redistribute it and/or
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/uefi_common.py - About 7 hrs to fix

    Function Main has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def Main(Options = None):
    
        try:
            DataBase = GlobalData.gDB        
            if not Options.DistributionFile:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/RmPkg.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 GetAll has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def GetAll(self):
    
            def progress(received, blockSize, fileSize):
                if fileSize < 0: return
                wDots = (100 * received * blockSize) / fileSize / 10
    Severity: Minor
    Found in BaseTools/gcc/mingw-gcc-build.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 merge_old_version has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def merge_old_version(version, new, old):
        # Changes to exclusion file not implemented yet
        if old.exclusions != new.exclusions:
            raise NotImplementedError, "exclusions differ"
    

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

    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/i18n/msgfmt.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 main has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        """Script main program."""
        import getopt
        try:
            opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:')
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/compileall.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 JSONObject has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def JSONObject(s_and_end, encoding, strict, scan_once, object_hook,
                   object_pairs_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
        s, end = s_and_end
        pairs = []
        pairs_append = pairs.append
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/decoder.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 main has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def main():
        """Script main program."""
        import getopt
        try:
            opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:')
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/compileall.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 JSONObject has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def JSONObject(s_and_end, encoding, strict, scan_once, object_hook,
                   object_pairs_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
        s, end = s_and_end
        pairs = []
        pairs_append = pairs.append
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/decoder.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 pkgutil.py has 453 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Utilities to support packages."""
    
    # NOTE: This module must remain compatible with Python 2.3, as it is shared
    # by setuptools for distribution with Python 2.3 and up.
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pkgutil.py - About 6 hrs to fix

      File pkgutil.py has 453 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Utilities to support packages."""
      
      # NOTE: This module must remain compatible with Python 2.3, as it is shared
      # by setuptools for distribution with Python 2.3 and up.
      
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pkgutil.py - About 6 hrs to fix

        File InfPcdObject.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ## @file
        # This file is used to define class objects of INF file [Pcds] 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/InfPcdObject.py - About 6 hrs to fix

          File CommonObject.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is used to define common items of class object
          #
          # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
          #
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Object/POM/CommonObject.py - About 6 hrs to fix

            File _abcoll.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Copyright 2007 Google, Inc. All Rights Reserved.
            # Licensed to PSF under a Contributor Agreement.
            
            """Abstract Base Classes (ABCs) for collections, according to PEP 3119.
            
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/_abcoll.py - About 6 hrs to fix

              File _abcoll.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2007 Google, Inc. All Rights Reserved.
              # Licensed to PSF under a Contributor Agreement.
              
              """Abstract Base Classes (ABCs) for collections, according to PEP 3119.
              
              Severity: Minor
              Found in vector-uefi/fd/efi/StdLib/lib/python.27/_abcoll.py - About 6 hrs to fix
                Severity
                Category
                Status
                Source
                Language