hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function readline has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    def readline(self, limit=None):
        if self.closed:
            raise ValueError("read from closed file")
        if limit is None:
            limit = -1
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/_pyio.py - About 5 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 _find_tests has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    def _find_tests(self, start_dir, pattern):
        """Used by discovery. Yields test suites it loads."""
        paths = os.listdir(start_dir)

        for path in paths:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/unittest/loader.py - About 5 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 has_header has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    def has_header(self, sample):
        # Creates a dictionary of types of data in each column. If any
        # column is of a single type (say, integers), *except* for the first
        # row, then the first row is presumed to be labels. If the type
        # can't be determined, it is assumed to be a string in which case
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/csv.py - About 5 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 add_files has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

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 39 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse(self, fp):
        """Override this method to support alternative .mo formats."""
        unpack = struct.unpack
        filename = getattr(fp, 'name', '')
        # Parse the .mo file header, which consists of 5 little endian 32
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/gettext.py - About 5 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 GenVpd.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
#  This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe
#  and process each entry of vpd type PCD.
#
#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
Severity: Minor
Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 5 hrs to fix

    File BaseHTTPServer.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """HTTP server base class.
    
    Note: the class in this module doesn't implement any HTTP request; see
    SimpleHTTPServer for simple implementations of GET, HEAD and POST
    (including CGI scripts).  It does, however, optionally implement HTTP/1.1
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/BaseHTTPServer.py - About 5 hrs to fix

      File mimify.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #! /usr/bin/env python
      
      """Mimification and unmimification of mail messages.
      
      Decode quoted-printable parts of a mail message or encode using
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/mimify.py - About 5 hrs to fix

        File BaseHTTPServer.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """HTTP server base class.
        
        Note: the class in this module doesn't implement any HTTP request; see
        SimpleHTTPServer for simple implementations of GET, HEAD and POST
        (including CGI scripts).  It does, however, optionally implement HTTP/1.1
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/BaseHTTPServer.py - About 5 hrs to fix

          File mimify.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #! /usr/bin/env python
          
          """Mimification and unmimification of mail messages.
          
          Decode quoted-printable parts of a mail message or encode using
          Severity: Minor
          Found in vector-uefi/fd/efi/StdLib/lib/python.27/mimify.py - About 5 hrs to fix

            File BuildEngine.py has 412 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            ## @file
            # The engine for building files
            #
            # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
            # This program and the accompanying materials
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/BuildEngine.py - About 5 hrs to fix

              Function add_ui has 147 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                Function add_ui has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  File site.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """Append module search paths for third-party packages to sys.path.
                  
                  ****************************************************************
                  * This module is automatically imported during initialization. *
                  ****************************************************************
                  Severity: Minor
                  Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/site.py - About 5 hrs to fix

                    File string.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """A collection of string operations (most are no longer used).
                    
                    Warning: most of the code you see here isn't normally used nowadays.
                    Beginning with Python 1.6, many of these functions are implemented as
                    methods on the standard string object. They used to be implemented by
                    Severity: Minor
                    Found in AppPkg/Applications/Python/Python-2.7.2/Lib/string.py - About 5 hrs to fix

                      File site.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Append module search paths for third-party packages to sys.path.
                      
                      ****************************************************************
                      * This module is automatically imported during initialization. *
                      ****************************************************************
                      Severity: Minor
                      Found in vector-uefi/fd/efi/StdLib/lib/python.27/site.py - About 5 hrs to fix

                        File string.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """A collection of string operations (most are no longer used).
                        
                        Warning: most of the code you see here isn't normally used nowadays.
                        Beginning with Python 1.6, many of these functions are implemented as
                        methods on the standard string object. They used to be implemented by
                        Severity: Minor
                        Found in vector-uefi/fd/efi/StdLib/lib/python.27/string.py - About 5 hrs to fix

                          Function FixVpdOffset has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def FixVpdOffset (self):        
                                  # At first, the offset should start at 0
                                  # Sort fixed offset list in order to find out where has free spaces for the pcd's offset
                                  # value is "*" to insert into.      
                                  
                          Severity: Minor
                          Found in BaseTools/Source/Python/BPDG/GenVpd.py - About 5 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 Eval has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def Eval(Operator, Oprand1, Oprand2 = None):
                                  WrnExp = None
                          
                                  if Operator not in ["==", "!=", ">=", "<=", ">", "<", "in", "not in"] and \
                                      (type(Oprand1) == type('') or type(Oprand2) == type('')):
                          Severity: Minor
                          Found in BaseTools/Source/Python/Common/Expression.py - About 5 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 ValidateMS3 has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def ValidateMS3(Module, TopXmlTreeLevel):
                              #
                              # Check PackageDependencies -> Package
                              #
                              XmlTreeLevel = TopXmlTreeLevel + ['PackageDependencies']
                          Severity: Minor
                          Found in BaseTools/Source/Python/UPT/Xml/XmlParser.py - About 5 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

                          Severity
                          Category
                          Status
                          Source
                          Language