hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function py_make_scanner has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def py_make_scanner(context):
    parse_object = context.parse_object
    parse_array = context.parse_array
    parse_string = context.parse_string
    match_number = NUMBER_RE.match
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/scanner.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 _escape has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def _escape(source, escape, state):
    # handle escape code in expression
    code = CATEGORIES.get(escape)
    if code:
        return code
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_parse.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 has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0):
    """Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/cgi.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 _read_unlocked has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def _read_unlocked(self, n=None):
        nodata_val = b""
        empty_values = (b"", None)
        buf = self._read_buf
        pos = self._read_pos
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 _default has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def _default(self, text):
        prefix = text[:1]
        if prefix == "&":
            # deal with undefined entities
            try:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/etree/ElementTree.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 _update has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def _update(self, iterable):
        # The main loop for update() and the subclass __init__() methods.
        data = self._data

        # Use the fast update() method when a dictionary is available.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sets.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 getproxies_registry has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def getproxies_registry():
        """Return a dictionary of scheme -> proxy server URL mappings.

        Win32 uses the registry to store proxies.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.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_label has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def make_label(self, c, label):
        # XXX Maybe this should be a method on a subclass of converter?
        ilabel = len(c.labels)
        if label[0].isalpha():
            # Either a symbol name or a named token
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/pgen.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_node has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def compile_node(self, node):
        """Compiles a node, recursively.

        This is one big switch on the node type.
        """
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/patcomp.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 findDepth has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def findDepth(self, insts, debug=0):
        depth = 0
        maxDepth = 0
        for i in insts:
            opname = i[0]
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/compiler/pyassem.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 assure_pickle_consistency has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def assure_pickle_consistency(verbose=False):
    import pickle, re

    copy = code2op.copy()
    for name in pickle.__all__:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pickletools.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 initiate_send has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def initiate_send(self):
        while self.producer_fifo and self.connected:
            first = self.producer_fifo[0]
            # handle empty string/buffer or None entry
            if not first:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/asynchat.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 __format__ has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def __format__(self, specifier, context=None, _localeconv=None):
        """Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.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

File mkstringprep.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import re, unicodedata, sys

if sys.maxunicode == 65535:
    raise RuntimeError("need UCS-4 Python")
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/unicode/mkstringprep.py - About 3 hrs to fix

    File cmd.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """distutils.cmd
    
    Provides the Command class, the base class for the command classes
    in the distutils.command package.
    """
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/cmd.py - About 3 hrs to fix

      File cmd.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """distutils.cmd
      
      Provides the Command class, the base class for the command classes
      in the distutils.command package.
      """
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/cmd.py - About 3 hrs to fix

        Function parse_spi_flash_descriptor has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def parse_spi_flash_descriptor( rom ):
            if not (type(rom) == str):
                logger().error('Invalid fd object type %s'%type(rom))
                return
            
        Severity: Major
        Found in vector-uefi/fd/tool/chipsec/hal/spi_descriptor.py - About 3 hrs to fix

          File IniToXml.py has 308 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ## @file
          # This file is for converting package information data file to xml file.
          #
          # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
          #
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Xml/IniToXml.py - About 3 hrs to fix

            File Report.py has 307 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            ## @file
            # This file is used to create report for Eot tool
            #
            # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
            # This program and the accompanying materials
            Severity: Minor
            Found in BaseTools/Source/Python/Eot/Report.py - About 3 hrs to fix

              Function __init__ has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def __init__(self, Filename):
                      self.Filename = Filename
              
                      self.Version = 0.1
              
              Severity: Major
              Found in BaseTools/Source/Python/Ecc/Configuration.py - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language