hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/GenFds/FdfParser.py

Summary

Maintainability
F
4 mos
Test Coverage

File FdfParser.py has 2744 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# parse FDF file
#
#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 wk to fix

    Function CycleReferenceCheck has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring.
    Open

        def CycleReferenceCheck(self):
            #
            # Check the cycle between FV and FD image
            #
            MaxLength = len (self.Profile.FvDict)
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 days 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 __GetEfiSection has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetEfiSection(self, Obj):
    
            OldPos = self.GetFileBufferPos()
            if not self.__GetNextWord():
                return False
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 days 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 PreprocessConditionalStatement has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
    Open

        def PreprocessConditionalStatement(self):
            # IfList is a stack of if branches with elements of list [Pos, CondSatisfied, BranchDetermined]
            IfList = []
            RegionLayoutLine = 0
            ReplacedLine = -1
    Severity: Minor
    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 days 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

    FdfParser has 113 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class FdfParser:
        ## The constructor
        #
        #   @param  self        The object pointer
        #   @param  FileName    The file that to be parsed
    Severity: Major
    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 days to fix

      Function __GetLeafSection has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetLeafSection(self, Obj, MacroDict = {}):
      
              OldPos = self.GetFileBufferPos()
      
              if not self.__IsKeyword( "SECTION"):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 day 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 __GetRuleFileStatements has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRuleFileStatements(self):
      
              if not self.__IsKeyword("FILE"):
                  raise Warning("expected FILE", self.FileName, self.CurrentLineNumber)
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 day 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 __GetOptRomOverrides has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetOptRomOverrides(self, Obj):
              if self.__IsToken('{'):
                  Overrides = OptionRom.OverrideAttribs()
                  while True:
                      if self.__IsKeyword( "PCI_VENDOR_ID"):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 day 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 __GetComponentStatement has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetComponentStatement(self, VtfObj):
      
              if not self.__IsKeyword("COMP_NAME"):
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 7 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 PreprocessIncludeFile has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

          def PreprocessIncludeFile(self):
      
              while self.__GetNextToken():
      
                  if self.__Token == '!include':
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 6 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 __GetRegionDataType has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRegionDataType(self, RegionObj):
      
              if not self.__IsKeyword( "DATA"):
                  raise Warning("expected Region Data type", self.FileName, self.CurrentLineNumber)
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 6 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 __GetInfOptions has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetInfOptions(self, FfsInfObj):
      
              if self.__IsKeyword( "RuleOverride"):
                  if not self.__IsToken( "="):
                      raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
      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 __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 __CheckRuleSectionFileType has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          def __CheckRuleSectionFileType(self, SectionType, FileType):
              if SectionType == "COMPAT16":
                  if FileType not in ("COMPAT16", "SEC_COMPAT16"):
                      raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
              elif SectionType == "PE32":
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetFilePart has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFilePart(self, FfsFileObj, MacroDict = {}):
      
              self.__GetFileOpts( FfsFileObj)
      
              if not self.__IsToken("{"):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetFileOpts has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFileOpts(self, FfsFileObj):
      
              if self.__GetNextToken():
                  Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
                  if Pattern.match(self.__Token):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetRuleEncapsulationSection has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRuleEncapsulationSection(self, Rule):
      
              if self.__IsKeyword( "COMPRESS"):
                  Type = "PI_STD"
                  if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 3 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 __GetVtf has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetVtf(self):
      
              if not self.__GetNextToken():
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 3 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 __GetCglSection has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetCglSection(self, Obj, AlignValue = None):
      
              if self.__IsKeyword( "COMPRESS"):
                  type = "PI_STD"
                  if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 3 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 __GetFd has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFd(self):
      
              if not self.__GetNextToken():
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 3 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 __GetRegionLayout has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRegionLayout(self, Fd):
              Offset = self.__CalcRegionExpr() 
              if Offset == None:
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 3 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 __GetTokenStatements has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetTokenStatements(self, Obj):
              if self.__IsKeyword( "BaseAddress"):
                  if not self.__IsToken( "="):
                      raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
          
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __EvaluateConditional has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def __EvaluateConditional(self, Expression, Line, Op = None, Value = None):
              FileLineTuple = GetRealFileLine(self.FileName, Line)
              MacroPcdDict = self.__CollectMacroPcd()
              if Op == 'eval':
                  try:
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetFvInFd has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFvInFd (self, FdName):
      
              FvList = []
              if FdName.upper() in self.Profile.FdDict.keys():
                  FdObj = self.Profile.FdDict[FdName.upper()]
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetCapInFd has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetCapInFd (self, FdName):
      
              CapList = []
              if FdName.upper() in self.Profile.FdDict.keys():
                  FdObj = self.Profile.FdDict[FdName.upper()]
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetNextWord has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetNextWord(self):
              self.__SkipWhiteSpace()
              if self.__EndOfFile():
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetFileStatement has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFileStatement(self, Obj, ForCapsule = False, MacroDict = {}):
      
              if not self.__IsKeyword( "FILE"):
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 PreprocessFile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def PreprocessFile(self):
      
              self.Rewind()
              InComment = False
              DoubleSlashComment = False
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetFv has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetFv(self):
              if not self.__GetNextToken():
                  return False
      
              S = self.__Token.upper()
      Severity: Minor
      Found in BaseTools/Source/Python/GenFds/FdfParser.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

      Consider simplifying this complex logical expression.
      Open

                  if self.__CurrentChar() == T_CHAR_LF:
                      self.CurrentLineNumber += 1
                      self.CurrentOffsetWithinLine = 0
                      if InComment and DoubleSlashComment:
                          InComment = False
      Severity: Critical
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 hrs to fix

        Function __GetDefines has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetDefines(self):
        
                if not self.__GetNextToken():
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetRule has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetRule(self):
        
                if not self.__GetNextToken():
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetGuidAttrib has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetGuidAttrib(self):
        
                AttribDict = {}
                AttribDict["PROCESSING_REQUIRED"] = "NONE"
                AttribDict["AUTH_STATUS_VALID"] = "NONE"
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetReferencedFdCapTuple has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetReferencedFdCapTuple(self, CapObj, RefFdList = [], RefFvList = []):
        
                for CapsuleDataObj in CapObj.CapsuleDataList :
                    if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName != None and CapsuleDataObj.FvName.upper() not in RefFvList:
                        RefFvList.append (CapsuleDataObj.FvName.upper())
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetCapsule has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetCapsule(self):
        
                if not self.__GetNextToken():
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetInfStatement has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetInfStatement(self, Obj, ForCapsule = False, MacroDict = {}):
        
                if not self.__IsKeyword( "INF"):
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetComponentStatement has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def __GetComponentStatement(self, VtfObj):
        
                if not self.__IsKeyword("COMP_NAME"):
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 hr to fix

          Function __GetReferencedFdFvTupleFromSection has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def __GetReferencedFdFvTupleFromSection(self, FfsFile, FdList = [], FvList = []):
          
                  SectionStack = []
                  SectionStack.extend(FfsFile.SectionList)
                  while SectionStack != []:
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetStringData has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def __GetStringData(self):
                  if self.__Token.startswith("\"") or self.__Token.startswith("L\""):
                      self.__UndoToken()
                      self.__SkipToToken("\"")
                      currentLineNumber = self.CurrentLineNumber
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/FdfParser.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

          Consider simplifying this complex logical expression.
          Open

                          if (TempChar >= 'a' and TempChar <= 'z') or (TempChar >= 'A' and TempChar <= 'Z') \
                          or (TempChar >= '0' and TempChar <= '9') or TempChar == '_' or TempChar == '-':
                              self.__GetOneChar()
          
                          else:
          Severity: Critical
          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 hr to fix

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

                def __UndoToken(self):
                    self.__UndoOneChar()
                    while self.__CurrentChar().isspace():
                        if not self.__UndoOneChar():
                            self.__GetOneChar()
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetNextToken has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetNextToken(self):
                    # Skip leading spaces, if exist.
                    self.__SkipWhiteSpace()
                    if self.__EndOfFile():
                        return False
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetAddressStatements has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetAddressStatements(self, Obj):
            
                    if self.__IsKeyword("BsBaseAddress"):
                        if not self.__IsToken( "="):
                            raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.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 __GetBlockStatement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetBlockStatement(self, Obj):
                    if not self.__IsKeyword( "BlockSize"):
                        return False
            
                    if not self.__IsToken( "="):
            Severity: Minor
            Found in BaseTools/Source/Python/GenFds/FdfParser.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

            Consider simplifying this complex logical expression.
            Open

                        if not (self.__GetBlockStatement(FvObj) or self.__GetFvBaseAddress(FvObj) or 
                            self.__GetFvForceRebase(FvObj) or self.__GetFvAlignment(FvObj) or 
                            self.__GetFvAttributes(FvObj) or self.__GetFvNameGuid(FvObj) or 
                            self.__GetFvExtEntryStatement(FvObj)):
                            break
            Severity: Major
            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 1 hr to fix

              Function __GetAfileStatement has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetAfileStatement(self, CapsuleObj):
              
                      if not self.__IsKeyword("APPEND"):
                          return False
              
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 55 mins 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 __SectionHeaderParser has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __SectionHeaderParser(self, Section):
                      # [Defines]
                      # [FD.UiName]: use dummy instead if UI name is optional
                      # [FV.UiName]
                      # [Capsule.UiName]
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 55 mins 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 __GetEncapsulationSec has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetEncapsulationSec(self, FfsFileObj):
              
                      OldPos = self.GetFileBufferPos()
                      if not self.__IsKeyword( "SECTION"):
                          if len(FfsFileObj.SectionList) == 0:
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 55 mins 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 __GetRegionCapType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetRegionCapType(self, RegionObj):
              
                      if not self.__IsKeyword("CAPSULE"):
                          raise Warning("expected Keyword 'CAPSULE'", self.FileName, self.CurrentLineNumber)
              
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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 __GetFvAttributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __GetFvAttributes(self, FvObj):
                      IsWordToken = False
                      while self.__GetNextWord():
                          IsWordToken = True
                          name = self.__Token
              Severity: Minor
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                      if not self.__IsToken(","):
                                          break
              
              Severity: Major
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if elementRegionData != None and elementRegionData.upper() not in FvList:
                                            FvList.append(elementRegionData.upper())
                        return FvList
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                  Function __GetReferencedFdFvTuple has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
                  
                          for FfsObj in FvObj.FfsList:
                              if isinstance(FfsObj, FfsFileStatement.FileStatement):
                                  if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
                  Severity: Minor
                  Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                                          for FvNameInFd in FvInFdList:
                                              LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
                                              if FvNameInFd not in RefFvStack:
                                                  RefFvStack.append(FvNameInFd)
                  
                  Severity: Major
                  Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ErrorCode != 0:
                                                raise Warning("The include file does not exist under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), PlatformDir, GlobalData.gWorkspace), 
                                                              self.FileName, self.CurrentLineNumber)
                    
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if elementRegionData.endswith(".fv"):
                                                  continue
                                              if elementRegionData != None and elementRegionData.upper() not in FvList:
                      Severity: Major
                      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                        Function __GetNextOp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __GetNextOp(self):
                                # Skip leading spaces, if exist.
                                self.__SkipWhiteSpace()
                                if self.__EndOfFile():
                                    return False
                        Severity: Minor
                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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 __GetRegionFileType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __GetRegionFileType(self, RegionObj):
                        
                                if not self.__IsKeyword( "FILE"):
                                    raise Warning("expected Keyword 'FILE'", self.FileName, self.CurrentLineNumber)
                        
                        Severity: Minor
                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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

                        Avoid deeply nested control flow statements.
                        Open

                                                if MacorValue != None:
                                                    CurLine = CurLine.replace('$(' + MacroName + ')', MacorValue, 1)
                                                    if MacorValue.find('$(') != -1:
                                                        PreIndex = StartPos
                                                    else:
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if not Pattern.match(self.__Token):
                                                      raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
                                                  KeyStringList.append(self.__Token)
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not self.__IsToken( "("):
                                                        raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
                                                    PcdPair = self.__GetNextPcdName()
                            Severity: Major
                            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if CapInFdList != []:
                                                          for CapNameInFd in CapInFdList:
                                                              LogStr += "FD %s contains Capsule %s\n" % (RefFdName,CapNameInFd)
                                                              if CapNameInFd not in RefCapStack:
                                                                  RefCapStack.append(CapNameInFd)
                              Severity: Major
                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if RefFvName.upper() in self.Profile.FvDict.keys():
                                                            FvObj = self.Profile.FvDict[RefFvName.upper()]
                                                        else:
                                                            continue
                                                        self.__GetReferencedFdFvTuple(FvObj, RefFdList, RefFvList)
                                Severity: Major
                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                  Function __GetRegionFvType has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def __GetRegionFvType(self, RegionObj):
                                  
                                          if not self.__IsKeyword( "FV"):
                                              raise Warning("expected Keyword 'FV'", self.FileName, self.CurrentLineNumber)
                                  
                                  Severity: Minor
                                  Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if RefFdName in FdAnalyzedList:
                                                              continue
                                  
                                  Severity: Major
                                  Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if not Pattern.match(self.__Token):
                                                                raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
                                                            FfsFileObj.KeyStringList.append(self.__Token)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if not self.__IsToken( ")"):
                                                                  raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
                                                              self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
                                      Severity: Major
                                      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if RefFvName in FvAnalyzedList:
                                                                    continue
                                                                LogStr += "Capsule %s contains FV %s\n" % (CapNameFromStack, RefFvName)
                                        Severity: Major
                                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if FvInFdList != []:
                                                                      for FvNameInFd in FvInFdList:
                                                                          LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
                                                                          if FvNameInFd not in RefFvList:
                                                                              RefFvList.append(FvNameInFd)
                                          Severity: Major
                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if not self.__IsToken(","):
                                                                        break
                                            
                                            Severity: Major
                                            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                              Function __ReplaceFragment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                                  def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
                                                      if StartPos[0] == EndPos[0]:
                                                          Offset = StartPos[1]
                                                          while Offset <= EndPos[1]:
                                                              self.Profile.FileLinesList[StartPos[0]][Offset] = Value
                                              Severity: Minor
                                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins 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

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if IfList[-1][2]:
                                                                          IfList[-1][1] = False
                                                                      else:
                                                                          IfList[-1][2] = True
                                                                          self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                              Severity: Major
                                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if elementRegionData.endswith(".cap"):
                                                                            continue
                                                                        if elementRegionData != None and elementRegionData.upper() not in CapList:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if elementRegionData != None and elementRegionData.upper() not in CapList:
                                                                              CapList.append(elementRegionData.upper())
                                                          return CapList
                                                  Severity: Major
                                                  Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                                    Consider simplifying this complex logical expression.
                                                    Open

                                                                if not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
                                                                    and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
                                                                    raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                self.__UndoToken()
                                                    Severity: Major
                                                    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 40 mins to fix

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                              if (TempChar >= 'a' and TempChar <= 'f') or (TempChar >= 'A' and TempChar <= 'F') \
                                                                      or (TempChar >= '0' and TempChar <= '9'):
                                                                          return True
                                                              else:
                                                                  return False
                                                      Severity: Major
                                                      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 40 mins to fix

                                                        Consider simplifying this complex logical expression.
                                                        Open

                                                                    if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfile):
                                                                        break
                                                        
                                                            ## __GetFvStatement() method
                                                            #
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 40 mins to fix

                                                          Function ParseFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def ParseFile(self):
                                                          
                                                                  try:
                                                                      self.Preprocess()
                                                                      while self.__GetFd():
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __GetAprioriSection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __GetAprioriSection(self, FvObj, MacroDict = {}):
                                                          
                                                                  if not self.__IsKeyword( "APRIORI"):
                                                                      return False
                                                          
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __CalcRegionExpr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __CalcRegionExpr(self):
                                                                  StartPos = self.GetFileBufferPos()
                                                                  Expr = ''
                                                                  PairCount = 0
                                                                  while not self.__EndOfFile():
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __HexDigit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __HexDigit(self, TempChar):
                                                                  if (TempChar >= 'a' and TempChar <= 'f') or (TempChar >= 'A' and TempChar <= 'F') \
                                                                          or (TempChar >= '0' and TempChar <= '9'):
                                                                              return True
                                                                  else:
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __GetMacroValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __GetMacroValue(self, Macro):
                                                                  # Highest priority
                                                                  if Macro in GlobalData.gCommandLineDefines:
                                                                      return GlobalData.gCommandLineDefines[Macro]
                                                                  if Macro in GlobalData.gGlobalDefines:
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __GetOptRomFileStatement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __GetOptRomFileStatement(self, Obj):
                                                          
                                                                  if not self.__IsKeyword( "FILE"):
                                                                      return False
                                                          
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __GetFvForceRebase has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __GetFvForceRebase(self, Obj):
                                                          
                                                                  if not self.__IsKeyword("FvForceRebase"):
                                                                      return False
                                                          
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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 __GetOptionRom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def __GetOptionRom(self):
                                                          
                                                                  if not self.__GetNextToken():
                                                                      return False
                                                          
                                                          Severity: Minor
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 35 mins 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

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return None
                                                          Severity: Major
                                                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                            return True
                                                            Severity: Major
                                                            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return True
                                                              Severity: Major
                                                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 30 mins to fix

                                                                Function __GetOptRomInfStatement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    def __GetOptRomInfStatement(self, Obj):
                                                                
                                                                        if not self.__IsKeyword( "INF"):
                                                                            return False
                                                                
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 25 mins 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 GetRealFileLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                def GetRealFileLine (File, Line):
                                                                
                                                                    InsertedLines = 0
                                                                    for Profile in IncludeFileList:
                                                                        if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 25 mins 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 __SkipToToken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    def __SkipToToken(self, String, IgnoreCase = False):
                                                                        StartPos = self.GetFileBufferPos()
                                                                
                                                                        self.__SkippedChars = ""
                                                                        while not self.__EndOfFile():
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 25 mins 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 __GetFileExtension has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                    def __GetFileExtension(self):
                                                                        if not self.__IsToken("."):
                                                                                raise Warning("expected '.'", self.FileName, self.CurrentLineNumber)
                                                                
                                                                        Ext = ""
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 25 mins 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

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def PreprocessFile(self):
                                                                
                                                                        self.Rewind()
                                                                        InComment = False
                                                                        DoubleSlashComment = False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 412..466

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 445.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetInfOptions(self, FfsInfObj):
                                                                
                                                                        if self.__IsKeyword( "RuleOverride"):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2055..2105

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 440.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __ReplaceFragment(self, StartPos, EndPos, Value = ' '):
                                                                        if StartPos[0] == EndPos[0]:
                                                                            Offset = StartPos[1]
                                                                            while Offset <= EndPos[1]:
                                                                                self.Profile.FileLinesList[StartPos[0]][Offset] = Value
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 361..385

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 326.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__Token == "STRING":
                                                                            if not self.__RuleSectionCouldHaveString(EfiSectionObj.SectionType):
                                                                                raise Warning("%s section could NOT have string data%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
                                                                
                                                                            if not self.__IsToken('='):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3086..3111

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 260.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetStringData(self):
                                                                        if self.__Token.startswith("\"") or self.__Token.startswith("L\""):
                                                                            self.__UndoToken()
                                                                            self.__SkipToToken("\"")
                                                                            currentLineNumber = self.CurrentLineNumber
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1064..1090

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 247.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsToken('|'):
                                                                            EfiSectionObj.FileExtension = self.__GetFileExtension()
                                                                        elif self.__GetNextToken():
                                                                            if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
                                                                                       "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3147..3170

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 231.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextWord(self):
                                                                        self.__SkipWhiteSpace()
                                                                        if self.__EndOfFile():
                                                                            return False
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 days to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 831..852

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 229.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetReferencedFdFvTupleFromSection(self, FfsFile, FdList = [], FvList = []):
                                                                
                                                                        SectionStack = []
                                                                        SectionStack.extend(FfsFile.SectionList)
                                                                        while SectionStack != []:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3569..3583

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 208.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __IsKeyword(self, KeyWord, IgnoreCase = False):
                                                                        self.__SkipWhiteSpace()
                                                                
                                                                        # Only consider the same line, no multi-line token allowed
                                                                        StartPos = self.CurrentOffsetWithinLine
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 803..820

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 195.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetAddressStatements(self, Obj):
                                                                
                                                                        if self.__IsKeyword("BsBaseAddress"):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1409..1429

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 195.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                    def __GetRegionFvType(self, RegionObj):
                                                                
                                                                        if not self.__IsKeyword( "FV"):
                                                                            raise Warning("expected Keyword 'FV'", self.FileName, self.CurrentLineNumber)
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1656..1678
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1687..1709
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1718..1740
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1865..1887
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1896..1918

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 181.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                    def __GetRegionFileType(self, RegionObj):
                                                                
                                                                        if not self.__IsKeyword( "FILE"):
                                                                            raise Warning("expected Keyword 'FILE'", self.FileName, self.CurrentLineNumber)
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1656..1678
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1687..1709
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1718..1740
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1834..1856
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1865..1887

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 181.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                    def __GetRegionCapType(self, RegionObj):
                                                                
                                                                        if not self.__IsKeyword("CAPSULE"):
                                                                            raise Warning("expected Keyword 'CAPSULE'", self.FileName, self.CurrentLineNumber)
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1656..1678
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1687..1709
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1718..1740
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1834..1856
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1896..1918

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 181.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __SkipToToken(self, String, IgnoreCase = False):
                                                                        StartPos = self.GetFileBufferPos()
                                                                
                                                                        self.__SkippedChars = ""
                                                                        while not self.__EndOfFile():
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1103..1122

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 180.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsKeyword("Optional"):
                                                                            if not self.__RuleSectionCouldBeOptional(EfiSectionObj.SectionType):
                                                                                raise Warning("%s section could NOT be optional%d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
                                                                            EfiSectionObj.Optional = True
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3113..3126

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 172.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsKeyword( "COMPRESS"):
                                                                            Type = "PI_STD"
                                                                            if self.__IsKeyword("PI_STD") or self.__IsKeyword("PI_NONE"):
                                                                                Type = self.__Token
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3271..3293

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 162.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__IsToken( "{"):
                                                                                FvObj = Fv.FV()
                                                                                self.__GetDefineStatements(FvObj)
                                                                                self.__GetBlockStatement(FvObj)
                                                                                self.__GetSetStatements(FvObj)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3035..3054

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 158.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetEncapsulationSec(self, FfsFileObj):
                                                                
                                                                        OldPos = self.GetFileBufferPos()
                                                                        if not self.__IsKeyword( "SECTION"):
                                                                            if len(FfsFileObj.SectionList) == 0:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2597..2616

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 158.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsKeyword("$(NAMED_GUID)"):
                                                                            if not self.__GetNextWord():
                                                                                raise Warning("expected $(NAMED_GUID)", self.FileName, self.CurrentLineNumber)
                                                                            if self.__Token == 'PCD':
                                                                                if not self.__IsToken( "("):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2873..2882

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 157.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__GetNextGuid():
                                                                            if not self.__GetNextWord():
                                                                                raise Warning("expected File GUID", self.FileName, self.CurrentLineNumber)
                                                                            if self.__Token == 'PCD':
                                                                                if not self.__IsToken( "("):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2132..2141

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 155.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                def GetRealFileLine (File, Line):
                                                                
                                                                    InsertedLines = 0
                                                                    for Profile in IncludeFileList:
                                                                        if Line >= Profile.InsertStartLineNumber and Line < Profile.InsertStartLineNumber + Profile.InsertAdjust + len(Profile.FileLinesList):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 47..56

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 150.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetFvStatement(self, CapsuleObj):
                                                                
                                                                        if not self.__IsKeyword("FV"):
                                                                            return False
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3151..3168

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 145.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetFdStatement(self, CapsuleObj):
                                                                
                                                                        if not self.__IsKeyword("FD"):
                                                                            return False
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3123..3140

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 145.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetMacroName(self):
                                                                        if not self.__GetNextToken():
                                                                            raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
                                                                        MacroName = self.__Token
                                                                        NotFlag = False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 388..401

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 144.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsToken("{"):
                                                                            # Complex file rule expected
                                                                            Rule = RuleComplexFile.RuleComplexFile()
                                                                            Rule.FvFileType = Type
                                                                            Rule.NameGuid = NameGuid
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2928..2949

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 143.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __IsToken(self, String, IgnoreCase = False):
                                                                        self.__SkipWhiteSpace()
                                                                
                                                                        # Only consider the same line, no multi-line token allowed
                                                                        StartPos = self.CurrentOffsetWithinLine
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 776..790

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 138.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetCapInFd (self, FdName):
                                                                
                                                                        CapList = []
                                                                        if FdName.upper() in self.Profile.FdDict.keys():
                                                                            FdObj = self.Profile.FdDict[FdName.upper()]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4254..4266

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 133.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetFvInFd (self, FdName):
                                                                
                                                                        FvList = []
                                                                        if FdName.upper() in self.Profile.FdDict.keys():
                                                                            FdObj = self.Profile.FdDict[FdName.upper()]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4207..4219

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 133.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetReferencedFdFvTuple(self, FvObj, RefFdList = [], RefFvList = []):
                                                                
                                                                        for FfsObj in FvObj.FfsList:
                                                                            if isinstance(FfsObj, FfsFileStatement.FileStatement):
                                                                                if FfsObj.FvName != None and FfsObj.FvName.upper() not in RefFvList:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3549..3558

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 132.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__GetNextToken():
                                                                            Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
                                                                            if Pattern.match(self.__Token):
                                                                                FfsFileObj.KeyStringList.append(self.__Token)
                                                                                if self.__IsToken(","):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2248..2262

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 127.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetDefineStatement(self, Obj):
                                                                        if self.__IsKeyword("DEFINE"):
                                                                            self.__GetNextToken()
                                                                            Macro = self.__Token
                                                                            if not self.__IsToken( "="):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1519..1534

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 126.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__GetNextToken():
                                                                            Pattern = re.compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')
                                                                            if Pattern.match(self.__Token):
                                                                                KeyStringList.append(self.__Token)
                                                                                if self.__IsToken(","):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 day to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2897..2911

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 123.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if TemplateName == '' :
                                                                            self.Profile.RuleDict['RULE'             + \
                                                                                              '.'                    + \
                                                                                              Arch.upper()           + \
                                                                                              '.'                    + \
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2790..2803

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 121.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if S.startswith("[") and not S.startswith("[DEFINES"):
                                                                            if not S.startswith("[FD.") and not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
                                                                                and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
                                                                                raise Warning("Unknown section or section appear sequence error (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                            self.__UndoToken()
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1212..1217

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 121.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextOp(self):
                                                                        # Skip leading spaces, if exist.
                                                                        self.__SkipWhiteSpace()
                                                                        if self.__EndOfFile():
                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 896..917

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 121.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if IfList[-1][1]:
                                                                                    self.__WipeOffArea.append(((self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - len('!endif')), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                                else:
                                                                                    self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 658..661

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 118.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetSectionData(self, FfsFileObj, MacroDict = {}):
                                                                        Dict = {}
                                                                        Dict.update(MacroDict)
                                                                
                                                                        self.__GetDefineStatements(FfsFileObj)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2302..2315

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 117.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__GetAlignment():
                                                                            if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
                                                                                raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
                                                                            if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
                                                                                raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3128..3133

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 113.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                    if IfList[-1][1]:
                                                                                        if IfList[-1][2]:
                                                                                            IfList[-1][1] = False
                                                                                        else:
                                                                                            IfList[-1][2] = True
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 7 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 649..654

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 112.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                    def __NextChar(self):
                                                                        if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
                                                                            return self.Profile.FileLinesList[self.CurrentLineNumber][0]
                                                                        else:
                                                                            return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine + 1]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 6 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 307..311
                                                                BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 210..214
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 204..208

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 103.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextPcdName(self):
                                                                        if not self.__GetNextWord():
                                                                            raise Warning("expected format of <PcdTokenSpaceCName>.<PcdCName>", self.FileName, self.CurrentLineNumber)
                                                                        pcdTokenSpaceCName = self.__Token
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 6 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1041..1053

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 103.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
                                                                                if self.__FileCouldHaveRelocFlag(Obj.FvFileType) and self.__SectionCouldHaveRelocFlag(DataSectionObj.SecType):
                                                                                    if self.__Token == 'RELOCS_STRIPPED':
                                                                                        DataSectionObj.KeepReloc = False
                                                                                    else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 6 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2464..2471

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 103.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __IsHex(self, HexStr):
                                                                        if not HexStr.upper().startswith("0X"):
                                                                            return False
                                                                        if len(self.__Token) <= 2:
                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 6 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 987..996

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 99.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if S.startswith("[") and not S.startswith("[FV."):
                                                                            if not S.startswith("[CAPSULE.") \
                                                                                and not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
                                                                                raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                            self.__UndoToken()
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 6 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1259..1264

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 99.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if len (self.__Token) <= 4:
                                                                                while self.__IsToken(","):
                                                                                    if not self.__GetNextHexNumber():
                                                                                        raise Warning("Invalid Hex number", self.FileName, self.CurrentLineNumber)
                                                                                    if len(self.__Token) > 4:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1954..1961

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 96.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if len (self.__Token) <= 4:
                                                                            while self.__IsToken(","):
                                                                                if not self.__GetNextHexNumber():
                                                                                    raise Warning("Invalid Hex number", self.FileName, self.CurrentLineNumber)
                                                                                if len(self.__Token) > 4:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1994..2001

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 96.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                    def __EndOfFile(self):
                                                                        NumberOfLines = len(self.Profile.FileLinesList)
                                                                        SizeOfLastLine = len(self.Profile.FileLinesList[-1])
                                                                        if self.CurrentLineNumber == NumberOfLines and self.CurrentOffsetWithinLine >= SizeOfLastLine - 1:
                                                                            return True
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 221..229
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 118..126

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 92.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                    def __UndoOneChar(self):
                                                                
                                                                        if self.CurrentLineNumber == 1 and self.CurrentOffsetWithinLine == 0:
                                                                            return False
                                                                        elif self.CurrentOffsetWithinLine == 0:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 266..275
                                                                BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 166..175
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 161..170

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 90.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                    def __SkipWhiteSpace(self):
                                                                        Count = 0
                                                                        while not self.__EndOfFile():
                                                                            Count += 1
                                                                            if self.__CurrentChar() in (T_CHAR_NULL, T_CHAR_CR, T_CHAR_LF, T_CHAR_SPACE, T_CHAR_TAB):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 201..211
                                                                BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 100..110
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 98..108

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 89.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                        if S.startswith("[") and not S.startswith("[CAPSULE."):
                                                                            if not S.startswith("[VTF.") and not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
                                                                                raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                            self.__UndoToken()
                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1827..1832
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2632..2636

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 88.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if CompStatementObj.CompBin != '-' and CompStatementObj.CompBin.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                            #check for file path
                                                                            ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                            if ErrorCode != 0:
                                                                                EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4005..4009

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 87.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if CompStatementObj.CompSym != '-' and CompStatementObj.CompSym.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                            #check for file path
                                                                            ErrorCode, ErrorInfo = PathClass(NormPath(CompStatementObj.CompSym), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                            if ErrorCode != 0:
                                                                                EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3989..3993

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 87.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsKeyword( "NumBlocks"):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                
                                                                            if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1485..1492

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 87.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if self.__IsToken('|'):
                                                                                    FvImageSectionObj.FvFileExtension = self.__GetFileExtension()
                                                                                elif self.__GetNextToken():
                                                                                    if self.__Token not in ("}", "COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
                                                                                               "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3066..3075

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 87.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetCreateFile(self, Obj):
                                                                
                                                                        if self.__IsKeyword( "CREATE_FILE"):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 5 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1322..1334

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 86.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                    if FvInFdList != []:
                                                                                        for FvNameInFd in FvInFdList:
                                                                                            LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
                                                                                            if FvNameInFd not in RefFvStack:
                                                                                                RefFvStack.append(FvNameInFd)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4407..4415

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 84.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                        if CapInFdList != []:
                                                                                            for CapNameInFd in CapInFdList:
                                                                                                LogStr += "FD %s contains Capsule %s\n" % (RefFdName,CapNameInFd)
                                                                                                if CapNameInFd not in RefCapStack:
                                                                                                    RefCapStack.append(CapNameInFd)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4351..4359

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 84.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if not self.__Token.startswith("0x") or len(self.__Token) < 3 or len(self.__Token) > 4 or \
                                                                                not self.__HexDigit(self.__Token[2]) or not self.__HexDigit(self.__Token[-1]):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3448..3449

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 81.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsKeyword('RELOCS_STRIPPED') or self.__IsKeyword('RELOCS_RETAINED'):
                                                                            if self.__FileCouldHaveRelocFlag(Type):
                                                                                if self.__Token == 'RELOCS_STRIPPED':
                                                                                    KeepReloc = False
                                                                                else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2887..2894

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 79.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        while StartLine == self.CurrentLineNumber:
                                                                            TempChar = self.__CurrentChar()
                                                                            # Try to find the end char that is not a space and not in seperator tuple.
                                                                            # That is, when we got a space or any char in the tuple, we got the end of token.
                                                                            if not str(TempChar).isspace() and TempChar not in SEPERATOR_TUPLE:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 871..881

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 78.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if S.startswith("[") and not S.startswith("[VTF."):
                                                                            if not S.startswith("[RULE.") and not S.startswith("[OPTIONROM."):
                                                                                raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                            self.__UndoToken()
                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3342..3346

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 77.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if self.__GetNextToken():
                                                                                    if self.CurrentLineNumber == CurrentLine:
                                                                                        RemainingLine = self.__CurrentLine()[CurrentOffset:]
                                                                                        self.Profile.FileLinesList.insert(self.CurrentLineNumber, RemainingLine)
                                                                                        IncFileProfile.InsertAdjust += 1
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 511..517

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 76.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __EndOfLine(self):
                                                                        if self.CurrentLineNumber > len(self.Profile.FileLinesList):
                                                                            return True
                                                                        SizeOfCurrentLine = len(self.Profile.FileLinesList[self.CurrentLineNumber - 1])
                                                                        if self.CurrentOffsetWithinLine >= SizeOfCurrentLine:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 239..246

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 75.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __HexDigit(self, TempChar):
                                                                        if (TempChar >= 'a' and TempChar <= 'f') or (TempChar >= 'A' and TempChar <= 'F') \
                                                                                or (TempChar >= '0' and TempChar <= '9'):
                                                                                    return True
                                                                        else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 980..985

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 75.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetAlignment(self):
                                                                        if self.__IsKeyword( "Align", True):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 4 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2283..2292

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 75.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                            if VtfObj.ResetBin.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                                #check for file path
                                                                                ErrorCode, ErrorInfo = PathClass(NormPath(VtfObj.ResetBin), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                                if ErrorCode != 0:
                                                                                    EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2358..2362
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4087..4091
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4186..4190

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 74.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                        if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                            #check for file path
                                                                            ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                            if ErrorCode != 0:
                                                                                EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2358..2362
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3882..3886
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4186..4190

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 74.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                        if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                            #check for file path
                                                                            ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                            if ErrorCode != 0:
                                                                                EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2358..2362
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3882..3886
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4087..4091

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 74.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                        if ffsInf.InfFileName.replace('$(WORKSPACE)', '').find('$') == -1:
                                                                            #do case sensitive check for file path
                                                                            ErrorCode, ErrorInfo = PathClass(NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
                                                                            if ErrorCode != 0:
                                                                                EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 4 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3882..3886
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4087..4091
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4186..4190

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 74.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                    def __GetOneChar(self):
                                                                        if self.CurrentOffsetWithinLine == len(self.Profile.FileLinesList[self.CurrentLineNumber - 1]) - 1:
                                                                            self.CurrentLineNumber += 1
                                                                            self.CurrentOffsetWithinLine = 0
                                                                        else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 283..288
                                                                BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 183..188
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 178..183

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if self.__IsKeyword( "PCI_REVISION"):
                                                                                    if not self.__IsToken( "="):
                                                                                        raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                                    if not self.__GetNextHexNumber():
                                                                                        raise Warning("expected Hex revision", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4115..4121
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4123..4129
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4131..4138

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if self.__IsKeyword( "PCI_DEVICE_ID"):
                                                                                    if not self.__IsToken( "="):
                                                                                        raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                                    if not self.__GetNextHexNumber():
                                                                                        raise Warning("expected Hex device id", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4115..4121
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4123..4129
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4140..4146

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if self.__IsKeyword( "PCI_VENDOR_ID"):
                                                                                    if not self.__IsToken( "="):
                                                                                        raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                                    if not self.__GetNextHexNumber():
                                                                                        raise Warning("expected Hex vendor id", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4123..4129
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4131..4138
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4140..4146

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if self.__IsKeyword( "PCI_CLASS_CODE"):
                                                                                    if not self.__IsToken( "="):
                                                                                        raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                                    if not self.__GetNextHexNumber():
                                                                                        raise Warning("expected Hex class code", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4115..4121
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4131..4138
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4140..4146

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__IsToken( "|"):
                                                                                pcdPair = self.__GetNextPcdName()
                                                                                Obj.BaseAddressPcd = pcdPair
                                                                                self.Profile.PcdDict[pcdPair] = Obj.BaseAddress
                                                                                FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1376..1381

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 72.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsKeyword( "BUILD_NUM"):
                                                                            if not self.__IsToken( "="):
                                                                                raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
                                                                
                                                                            if not self.__GetNextToken():
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2345..2352

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 69.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsToken( "|"):
                                                                            PcdPair = self.__GetNextPcdName()
                                                                            BlockSizePcd = PcdPair
                                                                            self.Profile.PcdDict[PcdPair] = BlockSize
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1477..1482

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 68.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextGuid(self):
                                                                
                                                                        if not self.__GetNextToken():
                                                                            return False
                                                                        p = re.compile('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}')
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 927..936

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 64.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        while True:
                                                                            isInf = self.__GetInfStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
                                                                            isFile = self.__GetFileStatement(FvObj, MacroDict = FvObj.DefineVarDict.copy())
                                                                            if not isInf and not isFile:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1872..1875

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 64.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                        if not ffsInf.InfFileName in self.Profile.InfList:
                                                                            self.Profile.InfList.append(ffsInf.InfFileName)
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            self.Profile.InfFileLineList.append(FileLineTuple)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2027..2030
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4093..4096

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 62.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                        if not ffsInf.InfFileName in self.Profile.InfList:
                                                                            self.Profile.InfList.append(ffsInf.InfFileName)
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            self.Profile.InfFileLineList.append(FileLineTuple)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2027..2030
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2364..2367

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 62.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if S.startswith("[") and not S.startswith("[RULE."):
                                                                            if not S.startswith("[OPTIONROM."):
                                                                                raise Warning("Unknown section or section appear sequence error (The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.], [OptionRom.])", self.FileName, self.CurrentLineNumber)
                                                                            self.__UndoToken()
                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 3 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2756..2760

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 62.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__GetAlignment():
                                                                            if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
                                                                                raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
                                                                            AlignValue = self.__Token
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2339..2342

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 60.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            while AllStrLen > 4:
                                                                                DataString = DataString + "0x" + AllString[AllStrLen - 2: AllStrLen] + ","
                                                                                AllStrLen  = AllStrLen - 2
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1948..1950

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 58.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        while AllStrLen > 4:
                                                                            DataString = DataString + "0x" + AllString[AllStrLen - 2: AllStrLen] + ","
                                                                            AllStrLen  = AllStrLen - 2
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1988..1990

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 58.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                while True:
                                                                                    IsInf = self.__GetInfStatement(FvObj, MacroDict.copy())
                                                                                    IsFile = self.__GetFileStatement(FvObj, MacroDict.copy())
                                                                                    if not IsInf and not IsFile:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2408..2411

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 54.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if AlignValue == 'Auto'and (not self.__Token == 'PE32') and (not self.__Token == 'TE'):
                                                                                raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2457..2458

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 53.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        try:
                                                                            fsock = open(FileName, "rb", 0)
                                                                            try:
                                                                                self.FileLinesList = fsock.readlines()
                                                                            finally:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 172..180

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 51.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        try:
                                                                            fsock = open(FileName, "rb", 0)
                                                                            try:
                                                                                self.FileLinesList = fsock.readlines()
                                                                            finally:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 147..155

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 51.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __StringToList(self):
                                                                        self.Profile.FileLinesList = [list(s) for s in self.Profile.FileLinesList]
                                                                        self.Profile.FileLinesList[-1].append(' ')
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 333..335

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 50.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if ConditionSatisfied:
                                                                                    self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))                 
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 603..604

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 49.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if IfList[-1][1]:
                                                                                    IfList[-1] = [ElseStartPos, False, True]
                                                                                    self.__WipeOffArea.append((ElseStartPos, (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 619..621

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 49.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                    try:
                                                                        test_file = sys.argv[1]
                                                                    except IndexError, v:
                                                                        print "Usage: %s filename" % sys.argv[0]
                                                                        sys.exit(1)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3651..3655
                                                                BaseTools/Source/Python/Ecc/c.py on lines 2606..2610

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 48.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        while True:
                                                                            IsInf = self.__GetInfStatement( AprSectionObj, MacroDict = MacroDict)
                                                                            IsFile = self.__GetFileStatement( AprSectionObj)
                                                                            if not IsInf and not IsFile:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1990..1993

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 48.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextHexNumber(self):
                                                                        if not self.__GetNextToken():
                                                                            return False
                                                                        if self.__IsHex(self.__Token):
                                                                            return True
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1006..1013

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 47.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                            if not self.__GetNextToken() or self.__Token.upper() not in ("TRUE", "FALSE", "1", "0"):
                                                                                raise Warning("expected TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1932..1933
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2572..2573
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2582..2583

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 47.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__Token.upper() not in ("1", "2", "4", "8", "16", "32", "64", "128", "256", "512", \
                                                                                                        "1K", "2K", "4K", "8K", "16K", "32K", "64K", "128K", "256K", "512K", \
                                                                                                        "1M", "2M", "4M", "8M", "16M", "32M", "64M", "128M", "256M", "512M", \
                                                                                                        "1G", "2G"):
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1900..1903

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 46.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__Token not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
                                                                                               "UI", "VERSION", "PEI_DEPEX", "SUBTYPE_GUID", "SMM_DEPEX"):
                                                                                raise Warning("Unknown section type '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2454..2456

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 46.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if Item[0] == None or Item[1] == None:
                                                                                raise Warning("expected block statement", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1450..1452

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 46.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                self.__PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] = "0x%x" % RegionObj.Offset
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1789..1789

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 46.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                    self.__PcdDict['%s.%s' % (RegionObj.PcdSize[1], RegionObj.PcdSize[0])] = "0x%x" % RegionObj.Size
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1783..1783

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 46.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetNextDecimalNumber(self):
                                                                        if not self.__GetNextToken():
                                                                            return False
                                                                        if self.__Token.isdigit():
                                                                            return True
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1024..1031

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 45.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                        if ForCapsule:
                                                                            capsuleFfs = CapsuleData.CapsuleFfs()
                                                                            capsuleFfs.Ffs = FfsFileObj
                                                                            Obj.CapsuleDataList.append(capsuleFfs)
                                                                        else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2040..2045
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2147..2152
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2377..2382

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if CapNameFromStack.upper() in self.Profile.CapsuleDict.keys():
                                                                                    CapObj = self.Profile.CapsuleDict[CapNameFromStack.upper()]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3606..3607
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4336..4337
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4434..4435

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                        if ForCapsule:
                                                                            capsuleFfs = CapsuleData.CapsuleFfs()
                                                                            capsuleFfs.Ffs = ffsInf
                                                                            Obj.CapsuleDataList.append(capsuleFfs)
                                                                        else:
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2040..2045
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2147..2152
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 2489..2494

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __GetCapsuleStatements(self, Obj):
                                                                        self.__GetCapsuleTokens(Obj)
                                                                        self.__GetDefineStatements(Obj)
                                                                        self.__GetSetStatements(Obj)
                                                                        self.__GetCapsuleData(Obj)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2676..2681

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                if FvNameFromStack.upper() in self.Profile.FvDict.keys():
                                                                                    FvObj = self.Profile.FvDict[FvNameFromStack.upper()]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3606..3607
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4389..4390
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4434..4435

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                                        if RefFvName.upper() in self.Profile.FvDict.keys():
                                                                                            FvObj = self.Profile.FvDict[RefFvName.upper()]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3606..3607
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4336..4337
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4389..4390

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 43.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsToken("[CAPSULE.", True):
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
                                                                            #        % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                            raise Warning("expected [Capsule.]", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1220..1224
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1345..1349
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1393..1397
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3265..3269
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3843..3847

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsToken("[VTF.", True):
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
                                                                            #        % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                            raise Warning("expected [VTF.]", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1220..1224
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1345..1349
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1393..1397
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3007..3011
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3265..3269

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsToken("[Rule.", True):
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
                                                                            #        % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                            raise Warning("expected [Rule.]", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1220..1224
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1345..1349
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1393..1397
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3007..3011
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3843..3847

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
                                                                                                    "UI", "PEI_DEPEX", "VERSION", "SUBTYPE_GUID", "SMM_DEPEX"):
                                                                                raise Warning("Unknown leaf section name '%s'" % SectionName, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2976..2978

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsToken("[DEFINES", True):
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
                                                                            #        % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                            raise Warning("expected [DEFINES", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1220..1224
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1393..1397
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3007..3011
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3265..3269
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3843..3847

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 6 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__IsToken("[FD.", True):
                                                                            FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                            #print 'Parsing String: %s in File %s, At line: %d, Offset Within Line: %d' \
                                                                            #        % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :], FileLineTuple[0], FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                            raise Warning("expected [FD.]", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 5 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1220..1224
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 1345..1349
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3007..3011
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3265..3269
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3843..3847

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__IsToken("."):
                                                                            if not self.__GetNextWord():
                                                                                raise Warning("expected template name", self.FileName, self.CurrentLineNumber)
                                                                            TemplateName = self.__Token
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2778..2781

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 42.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if Arch.upper() not in ("IA32", "X64", "IPF", "EBC", "ARM", "AARCH64", "COMMON"):
                                                                            raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2772..2773

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 41.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                        if not self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]:
                                                                            self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]] = MacroDict
                                                                        else:
                                                                            MacroDict = self.__MacroDict[self.__CurSection[0], self.__CurSection[1], self.__CurSection[2]]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 451..454
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 824..827

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 41.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                            MacroDict = self.__MacroDict[
                                                                                        self.__CurSection[0],
                                                                                        self.__CurSection[1],
                                                                                        self.__CurSection[2]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 437..440
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 824..827

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 41.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                            ScopeMacro = self.__MacroDict[
                                                                                        self.__CurSection[0],
                                                                                        self.__CurSection[1],
                                                                                        self.__CurSection[2]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 437..440
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 451..454

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 41.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                % (FileLineTuple[1], self.CurrentOffsetWithinLine + 1, self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :].rstrip('\n').rstrip('\r'))
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1195..1195

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 39.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                        IfList[-1] = [IfList[-1][0], ConditionSatisfied, IfList[-1][2]]
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 647..647

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 39.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 4 locations. Consider refactoring.
                                                                Open

                                                                    def __SetCurrentCharValue(self, Value):
                                                                        self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine] = Value
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 3 other locations - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 320..321
                                                                BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 223..224
                                                                BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 217..218

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                for Line in IncFileProfile.FileLinesList:
                                                                                    self.Profile.FileLinesList.insert(InsertAtLine, Line)
                                                                                    self.CurrentLineNumber += 1
                                                                                    InsertAtLine += 1
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 519..522

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if not self.__GetNextToken() or self.__Token.startswith('['):
                                                                                raise Warning("expected MACRO value", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1234..1235

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__Token.upper() not in ("SEC", "PEI_CORE", "PEIM", "DXE_CORE", \
                                                                                             "DXE_DRIVER", "DXE_SAL_DRIVER", \
                                                                                             "DXE_SMM_DRIVER", "DXE_RUNTIME_DRIVER", \
                                                                                             "UEFI_DRIVER", "UEFI_APPLICATION", "USER_DEFINED", "DEFAULT", "BASE", \
                                                                                             "SECURITY_CORE", "COMBINED_PEIM_DRIVER", "PIC_PEIM", "RELOCATABLE_PEIM", \
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2818..2823

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                class MacroProfile :
                                                                    ## The constructor
                                                                    #
                                                                    #   @param  self        The object pointer
                                                                    #   @param  FileName    The file that to be parsed
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 81..91

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__Token != "1" and self.__Token != "0":
                                                                                raise Warning("expected 1 or 0 Erase Polarity", self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 1 hr to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1392..1393

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 38.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.CurrentLineNumber != StartLine:
                                                                            EndPos = len(self.Profile.FileLinesList[StartLine-1])
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 55 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 888..889

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 37.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                                        ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'eval')
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 55 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 740..741
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 743..743

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 37.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if self.__Token == "COMPRESS" or self.__Token == "GUIDED":
                                                                                self.SetFileBufferPos(OldPos)
                                                                                return False
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 55 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 2450..2452

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 37.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                                    ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'in')
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 55 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 740..741
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 764..764

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 37.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                                if CondLabel == '!if':
                                                                                    ConditionSatisfied = self.__EvaluateConditional(Expression, IfList[-1][0][0] + 1, 'eval')
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 55 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 743..743
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 764..764

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 37.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                                self.__WipeOffArea.append(((SetLine, SetOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 50 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 565..565
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 714..714

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 36.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 3 locations. Consider refactoring.
                                                                Open

                                                                                    self.__WipeOffArea.append(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 2 other locations - About 50 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 565..565
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 732..732

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 36.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                    def __CurrentChar(self):
                                                                        return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine]
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 45 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 297..298

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 35.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if Arch not in ("IA32", "X64", "IPF", "ARM", "AARCH64"):
                                                                            raise Warning("Unknown Arch '%s'" % Arch, self.FileName, self.CurrentLineNumber)
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 45 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3734..3736

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 35.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "RAW":
                                                                            if FileType not in ("BIN", "SEC_BIN", "RAW", "ASL", "ACPI"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 45 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3853..3854

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 35.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                if not self.__Token in ("PersistAcrossReset", "PopulateSystemTable", "InitiateReset"):
                                                                                    raise Warning("expected PersistAcrossReset, PopulateSystemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 35 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3074..3075

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 33.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                                    if not self.__Token in ("PersistAcrossReset", "PopulateSystemTable", "InitiateReset"):
                                                                                        raise Warning("expected PersistAcrossReset, PopulateSystemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 35 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3067..3068

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 33.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if SectionName not in ("COMPAT16", "PE32", "PIC", "TE", "FV_IMAGE", "RAW", "DXE_DEPEX",\
                                                                                               "UI", "VERSION", "PEI_DEPEX", "GUID", "SMM_DEPEX"):
                                                                            self.__UndoToken()
                                                                            return False
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 35 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 3026..3029

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 33.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "PEI_DEPEX":
                                                                            if FileType not in ("PEI_DEPEX", "SEC_PEI_DEPEX"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        if SectionType == "COMPAT16":
                                                                            if FileType not in ("COMPAT16", "SEC_COMPAT16"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "PE32":
                                                                            if FileType not in ("PE32", "SEC_PE32"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "TE":
                                                                            if FileType not in ("TE", "SEC_TE"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "UI":
                                                                            if FileType not in ("UI", "SEC_UI"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "PIC":
                                                                            if FileType not in ("PIC", "PIC"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "VERSION":
                                                                            if FileType not in ("VERSION", "SEC_VERSION"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 8 locations. Consider refactoring.
                                                                Open

                                                                        elif SectionType == "GUID":
                                                                            if FileType not in ("PE32", "SEC_GUID"):
                                                                                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        while self.__CurrentChar().isspace():
                                                                            if not self.__UndoOneChar():
                                                                                self.__GetOneChar()
                                                                                return
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 30 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 946..949

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                        if self.__Token == "SET":
                                                                            self.__UndoToken()
                                                                            self.__GetSetStatements( RegionObj)
                                                                            if not self.__GetNextWord():
                                                                                return True
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 30 mins to fix
                                                                BaseTools/Source/Python/Common/FdfParserLite.py on lines 1625..1629

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName != None and CapsuleDataObj.FvName.upper() not in RefFvList:
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4235..4235

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                                Open

                                                                            elif hasattr(CapsuleDataObj, 'FdName') and CapsuleDataObj.FdName != None and CapsuleDataObj.FdName.upper() not in RefFdList:
                                                                Severity: Minor
                                                                Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 30 mins to fix
                                                                BaseTools/Source/Python/GenFds/FdfParser.py on lines 4233..4233

                                                                Duplicated Code

                                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                Tuning

                                                                This issue has a mass of 32.

                                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                Refactorings

                                                                Further Reading

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status