hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function refilemessages has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def refilemessages(self, list, tofolder, keepsequences=0):
        """Refile one or more messages -- may raise os.error.
        'tofolder' is an open folder object."""
        errors = []
        refiled = {}
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mhlib.py - About 2 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 genops has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def genops(pickle):
    """Generate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pickletools.py - About 2 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 walk has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def walk(top, topdown=True, onerror=None, followlinks=False):
    """Directory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/os.py - About 2 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_windows_registry has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def read_windows_registry(self, strict=True):
        """
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mimetypes.py - About 2 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 __str__ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self, eng=False, context=None):
        """Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        """
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/decimal.py - About 2 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 ntransfercmd has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def ntransfercmd(self, cmd, rest=None):
        """Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 2 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 test has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def test():
    '''Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ftplib.py - About 2 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 Ecc.py has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to be the main entrance of ECC tool
#
# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Minor
Found in BaseTools/Source/Python/Ecc/Ecc.py - About 2 hrs to fix

    File CommentParsing.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ## @file
    # This file is used to define comment parsing interface
    #
    # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
    #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/CommentParsing.py - About 2 hrs to fix

      File base64.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #! /usr/bin/env python
      
      """RFC 3548: Base16, Base32, Base64 Data Encodings"""
      
      # Modified 04-Oct-1995 by Jack Jansen to use binascii module
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/base64.py - About 2 hrs to fix

        File build_py.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """distutils.command.build_py
        
        Implements the Distutils 'build_py' command."""
        
        __revision__ = "$Id$"

          File base64.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #! /usr/bin/env python
          
          """RFC 3548: Base16, Base32, Base64 Data Encodings"""
          
          # Modified 04-Oct-1995 by Jack Jansen to use binascii module
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/base64.py - About 2 hrs to fix

            File build_py.py has 258 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """distutils.command.build_py
            
            Implements the Distutils 'build_py' command."""
            
            __revision__ = "$Id$"
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/build_py.py - About 2 hrs to fix

              GenFdsGlobalVariable has 21 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class GenFdsGlobalVariable:
                  FvDir = ''
                  OutputDirDict = {}
                  BinDir = ''
                  # will be FvDir + os.sep + 'Ffs'
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 2 hrs to fix

                Ffs has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Ffs(Image):
                    _FfsFormat = "24B%(payload_size)sB"
                    # skip IntegrityCheck
                    _HEADER_ = struct.Struct("1I2H8B 2x 1B 1B 3B 1B")
                    _HEADER_SIZE_ = _HEADER_.size
                Severity: Minor
                Found in BaseTools/Source/Python/Eot/FvImage.py - About 2 hrs to fix

                  MyHTMLParser has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class MyHTMLParser(sgmllib.SGMLParser):
                  
                      def __init__(self, url, verbose=VERBOSE, checker=None):
                          self.myverbose = verbose # now unused
                          self.checker = checker

                    UnparseTestCase has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class UnparseTestCase(ASTTestCase):
                        # Tests for specific bugs found in earlier versions of unparse
                    
                        def test_del_statement(self):
                            self.check_roundtrip("del x, y, z")
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Demo/parser/test_unparse.py - About 2 hrs to fix

                      WeakValueDictionary has 21 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class WeakValueDictionary(UserDict.UserDict):
                          """Mapping class that references values weakly.
                      
                          Entries in the dictionary will be discarded when no strong
                          reference to the value exists anymore
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/weakref.py - About 2 hrs to fix

                        CookieJar has 21 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class CookieJar:
                            """Collection of HTTP cookies.
                        
                            You may not need to know about this class: try
                            urllib2.build_opener(HTTPCookieProcessor).open(url).
                        Severity: Minor
                        Found in AppPkg/Applications/Python/Python-2.7.2/Lib/cookielib.py - About 2 hrs to fix

                          Node has 21 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Node(xml.dom.Node):
                              namespaceURI = None # this is non-null only for elements and attributes
                              parentNode = None
                              ownerDocument = None
                              nextSibling = None
                          Severity: Minor
                          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/minidom.py - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language