hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

def dump(node, annotate_fields=True, include_attributes=False):
    """
    Return a formatted dump of the tree in *node*.  This is mainly useful for
    debugging purposes.  The returned string will show the names and the values
    for fields.  This makes the code impossible to evaluate, so if evaluation is
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ast.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 shutdown has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def shutdown(handlerList=_handlerList):
    """
    Perform any cleanup actions in the logging system (e.g. flushing
    buffers).
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/__init__.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 makedirs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def makedirs(name, mode=0777):
    """makedirs(path [, mode=0777])

    Super-mkdir; create a leaf directory and all intermediate ones.
    Works like mkdir, except that any intermediate path segment (not
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/os.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,
Severity: Major
Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 1 hr to fix

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

    def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
                      owner=None, group=None, logger=None):
        """Create a (possibly compressed) tar file from all the files under
        'base_dir'.
    
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/shutil.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,
    Severity: Major
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 1 hr to fix

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

      def iter_child_nodes(node):
          """
          Yield all direct child nodes of *node*, that is, all fields that are nodes
          and all items of fields that are lists of nodes.
          """
      Severity: Minor
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/ast.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,
      Severity: Major
      Found in vector-uefi/fd/efi/StdLib/lib/python.27/argparse.py - About 1 hr to fix

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

            def readframes(self, nframes):
                if self._data_seek_needed:
                    self._data_chunk.seek(0, 0)
                    pos = self._soundpos * self._framesize
                    if pos:
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/wave.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 generic_visit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def generic_visit(self, node):
                """Called if no explicit visitor function exists for a node."""
                for field, value in iter_fields(node):
                    if isinstance(value, list):
                        for item in value:
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/ast.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 _url_collapse_path_split has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def _url_collapse_path_split(path):
            """
            Given a URL path, remove extra '/'s and '.' path elements and collapse
            any '..' references.
        
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/CGIHTTPServer.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 __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 vector-uefi/fd/efi/StdLib/lib/python.27/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 __divmod__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def __divmod__(self, other, context=None):
                """
                Return (self // other, self % other)
                """
                other = _convert_other(other)
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/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 __floordiv__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def __floordiv__(self, other, context=None):
                """self // other"""
                other = _convert_other(other)
                if other is NotImplemented:
                    return other
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/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 vector-uefi/fd/efi/StdLib/lib/python.27/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 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 vector-uefi/fd/efi/StdLib/lib/python.27/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 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 vector-uefi/fd/efi/StdLib/lib/python.27/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 ShowModule has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def ShowModule(self):
                M = self.Module
                for Arch in M.Header.keys():
                    print '\nArch =', Arch
                    print 'Filename =', M.Header[Arch].FileName
        Severity: Minor
        Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

          Function ToXml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def ToXml(self, Package):
                  if self.Package:
                      pass
                  #
                  # Create PackageSurfaceArea node
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py - About 1 hr to fix

            Function testParse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def testParse(self):
                    Content = \
                    '''# Top comment
                    [TOP]
                      # sub1 head comment
            Severity: Minor
            Found in BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language