hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function handle_read has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def handle_read (self):

        try:
            data = self.recv (self.ac_in_buffer_size)
        except socket.error, why:
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/asynchat.py - About 4 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 quantize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def quantize(self, exp, rounding=None, context=None, watchexp=True):
        """Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        """
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/decimal.py - About 4 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 run_loaded_modules has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def run_loaded_modules():
    from chipsec.module_common import ModuleResult

    failed   = []
    errors   = []
Severity: Minor
Found in vector-uefi/fd/tool/chipsec_main.py - About 4 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 join has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def join(a, *p):
    """Join two or more pathname components, inserting "\\" as needed.
    If any component is an absolute path, all previous path components
    will be discarded."""
    path = a
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ntpath.py - About 4 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 decode has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def decode(in_file, out_file=None, mode=None, quiet=0):
    """Decode uuencoded file"""
    #
    # Open the input file, if needed.
    #
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/uu.py - About 4 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 _lock_file has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def _lock_file(f, dotlock=True):
    """Lock file f using lockf and dot locking."""
    dotlock_done = False
    try:
        if fcntl:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.py - About 4 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 _explain_to has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def _explain_to(self, message):
        """Copy Babyl-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            labels = set(self.get_labels())
            if 'unseen' in labels:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.py - About 4 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 readheaders has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def readheaders(self):
        """Read header lines.

        Read header lines up to the entirely blank line that terminates them.
        The (normally blank) line that ends the headers is skipped, but not
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/rfc822.py - About 4 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 addtoken has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def addtoken(self, type, value, context):
        """Add a token; return True iff this is the end of the program."""
        # Map from token to label
        ilabel = self.classify(type, value, context)
        # Loop until the token is shifted; may raise exceptions
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/parse.py - About 4 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 upload_file has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def upload_file(self, command, pyversion, filename):
        # Makes sure the repository URL is compliant
        schema, netloc, url, params, query, fragments = \
            urlparse.urlparse(self.repository)
        if params or query or fragments:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/upload.py - About 4 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 setup has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def setup(**attrs):
    """The gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/core.py - About 4 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 quantize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def quantize(self, exp, rounding=None, context=None, watchexp=True):
        """Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        """
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 4 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 handle_read has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def handle_read (self):

        try:
            data = self.recv (self.ac_in_buffer_size)
        except socket.error, why:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/asynchat.py - About 4 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 __truediv__ has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def __truediv__(self, other, context=None):
        """Return self / other."""
        other = _convert_other(other)
        if other is NotImplemented:
            return NotImplemented
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 4 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 StrGather.py has 343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution.  The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
Severity: Minor
Found in BaseTools/Source/Python/AutoGen/StrGather.py - About 4 hrs to fix

    File fixer_util.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Utility functions, node construction macros, etc."""
    # Author: Collin Winter
    
    from itertools import islice
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixer_util.py - About 4 hrs to fix

      File htmllib.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """HTML 2.0 parser.
      
      See the HTML 2.0 specification:
      http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
      """
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/htmllib.py - About 4 hrs to fix

        File fixer_util.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Utility functions, node construction macros, etc."""
        # Author: Collin Winter
        
        from itertools import islice
        
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/fixer_util.py - About 4 hrs to fix

          File htmllib.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """HTML 2.0 parser.
          
          See the HTML 2.0 specification:
          http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
          """
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/htmllib.py - About 4 hrs to fix

            Encoder has 33 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class Encoder
            {
                public static final int EMatchFinderTypeBT2 = 0;
                public static final int EMatchFinderTypeBT4 = 1;
            
            Severity: Minor
            Found in vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java - About 4 hrs to fix
              Severity
              Category
              Status
              Source
              Language