hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function __hash__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def __hash__(self):
        """x.__hash__() <==> hash(x)"""
        # Decimal integers must hash the same as the ints
        #
        # The hash of a nonspecial noninteger Decimal must depend only
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 1 hr 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 _check_nans has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_nans(self, other=None, context=None):
        """Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 1 hr 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 storlines has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        def storlines(self, cmd, fp, callback=None):
            self.voidcmd('TYPE A')
            conn = self.transfercmd(cmd)
            try:
                while 1:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/ftplib.py - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    import re
    import sys
    args = sys.argv[1:]
    inFileName = args and args[0] or "Include/token.h"
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/token.py - About 1 hr 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_module_name has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def get_module_name(full_path):
    name = full_path
    # case #1, the full path: remove prefix
    if full_path.startswith(CHIPSEC_FOLDER+os.path.sep):
        name = full_path.replace ( CHIPSEC_FOLDER+os.path.sep, '')
Severity: Minor
Found in vector-uefi/fd/tool/chipsec_main.py - About 1 hr 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 _log has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _log(self, text, color, isStatus):
        """Internal method for logging"""
        if self.LOG_TO_FILE: self._save_to_log_file( text )
        else:              
            if color: log_color( color, text )
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/logger.py - About 1 hr 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 getNVstore_NVAR has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def getNVstore_NVAR( nvram_buf ):
   l = (-1, -1, None)
   FvOffset, FsGuid, FvLength, FvAttributes, FvHeaderLength, FvChecksum, ExtHeaderOffset, FvImage, CalcSum = NextFwVolume(nvram_buf)
   while FvOffset != None:
      polarity = bit_set(FvAttributes, EFI_FVB2_ERASE_POLARITY)
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/hal/uefi_platform.py - About 1 hr 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 check_EFI_variable_authentication has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def check_EFI_variable_authentication( self, name, guid ):
        self.logger.log( "[*] Checking EFI variable %s {%s}.." % (name, guid) )
        orig_var = self._uefi.get_EFI_variable( name, guid, None )
        if not orig_var:
            self.logger.log( "[*] EFI variable %s {%s} doesn't exist" % (name, guid) )
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/modules/common/secureboot/keys.py - About 1 hr 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 saveXML has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def saveXML( self ):
        """Saves the XML info to a file in a JUnit style."""
        try:
            if self.useXML == True:
                if self.xmlFile is not None:
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/xmlout.py - About 1 hr 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 send has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def send(self, data):
        """Send `data' to the server."""
        if self.sock is None:
            if self.auto_open:
                self.connect()
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/httplib.py - About 1 hr 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 expand_args has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def expand_args(args, flist):
    """read names in flist and append to args"""
    expanded = args[:]
    if flist:
        try:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/compileall.py - About 1 hr 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 expandvars has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def expandvars(path):
    """Expand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged."""
    global _varprog
    if '$' not in path:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/posixpath.py - About 1 hr 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 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, sock, keyfile=None, certfile=None,
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ssl.py - About 1 hr to fix

    Function wrap_socket has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def wrap_socket(sock, keyfile=None, certfile=None,
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/ssl.py - About 1 hr to fix

      Function linux_distribution has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def linux_distribution(distname='', version='', id='',
      
                             supported_dists=_supported_dists,
                             full_distribution_name=1):
      
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/platform.py - About 1 hr 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_module_object has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_module_object(self):
              result = ModuleResult.PASSED
              if self.mod_obj == None :
                  try:
                      if _importlib:
      Severity: Minor
      Found in vector-uefi/fd/tool/chipsec/module.py - About 1 hr 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 ttypager has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def ttypager(text):
          """Page through text on a text terminal."""
          lines = split(plain(text), '\n')
          try:
              import tty
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 1 hr 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 markup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
              """Mark up some plain text, given a context of symbols to look for.
              Each context dictionary maps object names to anchor names."""
              escape = escape or self.escape
              results = []
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 1 hr 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 synopsis has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def synopsis(filename, cache={}):
          """Get the one-line summary out of a module file."""
          mtime = os.stat(filename).st_mtime
          lastupdate, result = cache.get(filename, (0, None))
          if lastupdate < mtime:
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.py - About 1 hr 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 save_int has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def save_int(self, obj, pack=struct.pack):
              if self.bin:
                  # If the int is small enough to fit in a signed 4-byte 2's-comp
                  # format, we can store it more efficiently than the general
                  # case.
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/pickle.py - About 1 hr 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