hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File UniClassObject.py has 390 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2007 - 2012, 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/UniClassObject.py - About 5 hrs to fix

    File uefi_platform.py has 389 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/local/bin/python
    #CHIPSEC: Platform Security Assessment Framework
    #Copyright (c) 2010-2014, Intel Corporation
    # 
    #This program is free software; you can redistribute it and/or
    Severity: Minor
    Found in vector-uefi/fd/tool/chipsec/hal/uefi_platform.py - About 5 hrs to fix

      Message has 40 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Message:
          """Basic message object.
      
          A message object is defined as something that has a bunch of RFC 2822
          headers and a payload.  It may optionally have an envelope header
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/message.py - About 5 hrs to fix

        Message has 40 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Message:
            """Basic message object.
        
            A message object is defined as something that has a bunch of RFC 2822
            headers and a payload.  It may optionally have an envelope header
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/email/message.py - About 5 hrs to fix

          File profile.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #! /usr/bin/env python
          #
          # Class for profiling python code. rev 1.0  6/2/94
          #
          # Based on prior profile module by Sjoerd Mullender...
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/profile.py - About 5 hrs to fix

            File profile.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #! /usr/bin/env python
            #
            # Class for profiling python code. rev 1.0  6/2/94
            #
            # Based on prior profile module by Sjoerd Mullender...
            Severity: Minor
            Found in vector-uefi/fd/efi/StdLib/lib/python.27/profile.py - About 5 hrs to fix

              Function GetSingleValueOfKeyFromLines has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
                  Lines = Lines.split('\n')
                  Keys = []
                  Value = ''
                  DefineValues = ['']
              Severity: Minor
              Found in BaseTools/Source/Python/Common/String.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 PackageToDec has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def PackageToDec(Package):
                  #
                  # Init global information for the file
                  #
                  ContainerFile = Package.GetFullPath()
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.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 GenAsBuiltPacthPcdSections has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def GenAsBuiltPacthPcdSections(ModuleObject):
                  PatchPcdDict = {}
                  for BinaryFile in ModuleObject.GetBinaryFileList():
                      if not BinaryFile.AsBuiltList:
                          continue            
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 __ProcessDirective has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __ProcessDirective(self):
                      Result = None
                      if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
                                            MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF]:
                          Macros = self._Macros
              Severity: Minor
              Found in BaseTools/Source/Python/Workspace/MetaFileParser.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 __GetFvExtEntryStatement has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetFvExtEntryStatement(self, FvObj):
              
                      if not self.__IsKeyword( "FV_EXT_ENTRY"):
                          return False
              
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetCapsuleTokens has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetCapsuleTokens(self, Obj):
                      if not self.__GetNextToken():
                          return False
                      while self.__Token in ("CAPSULE_GUID", "CAPSULE_HEADER_SIZE", "CAPSULE_FLAGS", "OEM_CAPSULE_FLAGS"):
                          Name = self.__Token.strip()
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.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 ParseMacro has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def ParseMacro(Parser):
                  def MacroParser(self):
                      Match = gMacroDefPattern.match(self._CurrentLine)
                      if not Match:
                          # Not 'DEFINE/EDK_GLOBAL' statement, call decorated method
              Severity: Minor
              Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.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 __ProcessDirective has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __ProcessDirective(self):
                      Result = None
                      if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
                                            MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF]:
                          Macros = self._Macros
              Severity: Minor
              Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.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 main has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def main(self):
              
                      rounds = self.values['-n']
                      reportfile = self.values['-f']
                      show_bench = self.values['-s']
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/pybench.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 check has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def check(file):
                  if os.path.isdir(file) and not os.path.islink(file):
                      if verbose:
                          print "listing directory", file
                      names = os.listdir(file)
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/reindent.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 _fancy_replace has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
                      r"""
                      When replacing one block of lines with another, search the blocks
                      for *similar* lines; the best-matching pair (if any) is used as a
                      synch point, and intraline difference marking is done on the
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/difflib.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 encode has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def encode(body, binary=False, maxlinelen=76, eol=NL):
                  """Encode with quoted-printable, wrapping at maxlinelen characters.
              
                  If binary is False (the default), end-of-line characters will be converted
                  to the canonical email end-of-line sequence \\r\\n.  Otherwise they will
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/email/quoprimime.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 parsedate_tz has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              def parsedate_tz(data):
                  """Convert a date string to a time tuple.
              
                  Accounts for military timezones.
                  """
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/rfc822.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 proxy_bypass_macosx_sysconf has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

                  def proxy_bypass_macosx_sysconf(host):
                      """
                      Return True iff this host shouldn't be accessed using a proxy
              
                      This function uses the MacOSX framework SystemConfiguration
              Severity: Minor
              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/urllib.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