hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Common/FdfParserLite.py

Summary

Maintainability
F
4 mos
Test Coverage

File FdfParserLite.py has 2209 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# parse FDF file
#
#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 6 days to fix

    Function PreprocessConditionalStatement has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
    Open

        def PreprocessConditionalStatement(self):
            # IfList is a stack of if branches with elements of list [Pos, CondSatisfied, BranchDetermined]
            IfList = []
            while self.__GetNextToken():
                if self.__Token == 'DEFINE':
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.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 __EvaluateConditional has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
    Open

        def __EvaluateConditional(self, Name, Line, Op = None, Value = None):
            
            FileLineTuple = GetRealFileLine(self.FileName, Line)
            if Name in InputMacroDict:
                MacroValue = InputMacroDict[Name]
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 __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/Common/FdfParserLite.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

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

    class FdfParser(object):
        ## The constructor
        #
        #   @param  self        The object pointer
        #   @param  FileName    The file that to be parsed
    Severity: Major
    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 1 day to fix

      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 At Line ", self.FileName, self.CurrentLineNumber)
              
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 CycleReferenceCheck has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

          def CycleReferenceCheck(self):
              
              CycleRefExists = False
              
              try:
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 __GetComponentStatement has a Cognitive Complexity of 42 (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/Common/FdfParserLite.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 '=' At Line ", self.FileName, self.CurrentLineNumber)
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 At Line ", self.FileName, self.CurrentLineNumber)
              elif SectionType == "PE32":
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 __GetRegionDataType has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetRegionDataType(self, RegionObj):
              
              if not self.__IsKeyword( "DATA"):
                  raise Warning("expected Region Data type At Line ", self.FileName, self.CurrentLineNumber)
      
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 __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/Common/FdfParserLite.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 26 (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/Common/FdfParserLite.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 __GetFileOpts has a Cognitive Complexity of 24 (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/Common/FdfParserLite.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 __ReplaceMacros has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def __ReplaceMacros(self, Str, File, Line):
              MacroEnd = 0
              while Str.find('$(', MacroEnd) >= 0:
                  MacroStart = Str.find('$(', MacroEnd)
                  if Str.find(')', MacroStart) > 0:
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 __GetVtf has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          def __GetVtf(self):
              
              if not self.__GetNextToken():
                  return False
      
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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 18 (exceeds 5 allowed). Consider refactoring.
      Open

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

          def __GetRegionLayout(self, Fd):
              if not self.__GetNextHexNumber():
                  return False
              
              RegionObj = CommonDataClass.FdfClass.RegionClassObject()
      Severity: Minor
      Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.py - About 2 hrs to fix

        Function __GetFilePart has a Cognitive Complexity of 15 (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/Common/FdfParserLite.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 __GetDefines has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def __GetDefines(self):
        
                if not self.__GetNextToken():
                    return False
        
        Severity: Minor
        Found in BaseTools/Source/Python/Common/FdfParserLite.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 13 (exceeds 5 allowed). Consider refactoring.
        Open

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

              def __GetTokenStatements(self, Obj):
                  if not self.__IsKeyword( "BaseAddress"):
                      raise Warning("BaseAddress missing At Line ", self.FileName, self.CurrentLineNumber)
                     
                  if not self.__IsToken( "="):
          Severity: Minor
          Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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/Common/FdfParserLite.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/Common/FdfParserLite.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 11 (exceeds 5 allowed). Consider refactoring.
            Open

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

                def __GetFd(self):
            
                    if not self.__GetNextToken():
                        return False
                    
            Severity: Minor
            Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 __GetFv has a Cognitive Complexity of 10 (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/Common/FdfParserLite.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/Common/FdfParserLite.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 '=' At Line ", self.FileName, self.CurrentLineNumber)
            Severity: Minor
            Found in BaseTools/Source/Python/Common/FdfParserLite.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 10 (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/Common/FdfParserLite.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 __GetSetStatement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def __GetSetStatement(self, Obj):
                    if self.__IsKeyword("SET"):
                        PcdPair = self.__GetNextPcdName()
                        
                        if not self.__IsToken( "="):
            Severity: Minor
            Found in BaseTools/Source/Python/Common/FdfParserLite.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 __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/Common/FdfParserLite.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 __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/Common/FdfParserLite.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 __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/Common/FdfParserLite.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( ")"):
                                        raise Warning("expected ')'", self.FileName, self.CurrentLineNumber)
                                    self.__Token = 'PCD('+PcdPair[1]+'.'+PcdPair[0]+')'
            Severity: Major
            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if os.path.exists(Str):
                                          if not os.path.isabs(Str):
                                              Str = os.path.abspath(Str)
                                      IncFileName = Str
              Severity: Major
              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if not self.__GetNextOp():
                                            raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)
                                    
                Severity: Major
                Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.py - About 45 mins to fix

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

                        def __GetFvAttributes(self, FvObj):
                            
                            while self.__GetNextWord():
                                name = self.__Token
                                if name not in ("ERASE_POLARITY", "MEMORY_MAPPED", \
                    Severity: Minor
                    Found in BaseTools/Source/Python/Common/FdfParserLite.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 self.__GetStringData():
                                                pass
                                            MacroValue = self.__Token
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if MacroVal <= InputVal:
                                                  return True
                                              else:
                                                  return False
                                          else:
                      Severity: Major
                      Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 Profile.FileName == File and Profile.MacroName == Name and Profile.DefinedAtLine <= Line:
                                                    Value = Profile.MacroValue
                                                    
                        Severity: Major
                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if self.__Token in ('!=', '==', '>', '<', '>=', '<='):
                                                      Op = self.__Token
                                                      if not self.__GetNextToken():
                                                          raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
                                                      if self.__GetStringData():
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        for FvObj in FvInFdList:
                                                            LogStr += FvObj
                                                            LogStr += ' \n'
                                                            if FvObj not in RefFvStack:
                                                                RefFvStack.append(FvObj)
                            Severity: Major
                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                              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' at line", self.FileName, self.CurrentLineNumber)
                              
                              Severity: Minor
                              Found in BaseTools/Source/Python/Common/FdfParserLite.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 __GetAprioriSection has a Cognitive Complexity of 8 (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/Common/FdfParserLite.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 Pattern.match(self.__Token):
                                                          raise Warning("expected KeyString \"Target_Tag_Arch\" At Line ", self.FileName, self.CurrentLineNumber)
                                                      KeyStringList.append(self.__Token)
                              Severity: Major
                              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                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/Common/FdfParserLite.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if MacroVal < InputVal:
                                                              return True
                                                          else:
                                                              return False
                                                      elif Op == '<=':
                                  Severity: Major
                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if not self.__GetNextToken():
                                                                raise Warning("expected value At Line ", self.FileName, self.CurrentLineNumber)
                                                            if self.__GetStringData():
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/FdfParserLite.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\" At Line ", self.FileName, self.CurrentLineNumber)
                                                              FfsFileObj.KeyStringList.append(self.__Token)
                                      Severity: Major
                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if MacroVal >= InputVal:
                                                                    return True
                                                                else:
                                                                    return False
                                                            elif Op == '<':
                                        Severity: Major
                                        Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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' At Line ", self.FileName, self.CurrentLineNumber)
                                                    
                                            Severity: Minor
                                            Found in BaseTools/Source/Python/Common/FdfParserLite.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 os.path.isabs(self.FileName):
                                                                        FullFdf = os.path.join(os.environ.get('WORKSPACE'), self.FileName)
                                                            
                                            Severity: Major
                                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if NotFlag:
                                                                          ConditionSatisfied = not ConditionSatisfied
                                                                      BranchDetermined = ConditionSatisfied
                                              Severity: Major
                                              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if Op == '>':
                                                                            if MacroVal > InputVal:
                                                                                return True
                                                                            else:
                                                                                return False
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

                                                  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' At Line ", self.FileName, self.CurrentLineNumber)
                                                  
                                                  Severity: Minor
                                                  Found in BaseTools/Source/Python/Common/FdfParserLite.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 NotFlag:
                                                                              ConditionSatisfied = not ConditionSatisfied
                                                                          BranchDetermined = ConditionSatisfied
                                                  Severity: Major
                                                  Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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/Common/FdfParserLite.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                if MacroVal > InputVal:
                                                                                    return True
                                                                                else:
                                                                                    return False
                                                                            elif Op == '>=':
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 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/Common/FdfParserLite.py - About 40 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/Common/FdfParserLite.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.__StringToList()
                                                                          self.PreprocessFile()
                                                              Severity: Minor
                                                              Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 True
                                                              Severity: Major
                                                              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                            return False
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                              return False
                                                                  Severity: Major
                                                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                                                    return False
                                                                    Severity: Major
                                                                    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

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

                                                                        Avoid too many return statements within this function.
                                                                        Open

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

                                                                          Avoid too many return statements within this function.
                                                                          Open

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

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                                            return False
                                                                            Severity: Major
                                                                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

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

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                                            return False
                                                                                Severity: Major
                                                                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

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

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

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

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                                  return False
                                                                                      Severity: Major
                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                return False
                                                                                        Severity: Major
                                                                                        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

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

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                                            return False
                                                                                            Severity: Major
                                                                                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

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

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                                return False
                                                                                                Severity: Major
                                                                                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                                          return False
                                                                                                  Severity: Major
                                                                                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                            return False
                                                                                                    Severity: Major
                                                                                                    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

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

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

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

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

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

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                                return False
                                                                                                            Severity: Major
                                                                                                            Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

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

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                        return False
                                                                                                                Severity: Major
                                                                                                                Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                                              return False
                                                                                                                  Severity: Major
                                                                                                                  Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                                            return False
                                                                                                                    Severity: Major
                                                                                                                    Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 30 mins to fix

                                                                                                                      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/Common/FdfParserLite.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 '.' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  
                                                                                                                              Ext = ""
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.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 __GetBlockStatements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                          def __GetBlockStatements(self, Obj):
                                                                                                                              
                                                                                                                              if not self.__GetBlockStatement(Obj):
                                                                                                                                  #set default block size is 1
                                                                                                                                  Obj.BlockSizeList.append((1, Obj.Size, None))
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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/Common/FdfParserLite.py and 1 other location - About 4 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 501..555

                                                                                                                      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 '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 4 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2392..2442

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 3 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 390..414

                                                                                                                      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 At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
                                                                                                                                  
                                                                                                                                  if not self.__IsToken('='):
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 2 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3579..3604

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 2 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1184..1210

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 2 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3640..3663

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 2 days to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 951..972

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 4297..4311

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 913..930

                                                                                                                      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 '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1550..1570

                                                                                                                      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' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                              
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 5 other locations - About 1 day to fix
                                                                                                                      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
                                                                                                                      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 __GetRegionCapType(self, RegionObj):
                                                                                                                      
                                                                                                                              if not self.__IsKeyword("CAPSULE"):
                                                                                                                                  raise Warning("expected Keyword 'CAPSULE' at line", self.FileName, self.CurrentLineNumber)
                                                                                                                      
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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 1718..1740
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1834..1856
                                                                                                                      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' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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/GenFds/FdfParser.py on lines 1834..1856
                                                                                                                      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

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1223..1242

                                                                                                                      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 At Line %d" % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.CurrentLineNumber)
                                                                                                                                  EfiSectionObj.Optional = True
                                                                                                                              
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3606..3619

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3764..3786

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3528..3547

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2965..2984

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3376..3385

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2474..2483

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 85..94

                                                                                                                      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

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 417..430

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3433..3454

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 886..900

                                                                                                                      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

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 4277..4286

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2593..2607

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1653..1668

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 day to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3400..3414

                                                                                                                      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 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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1337..1342

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1016..1037

                                                                                                                      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 TemplateName == '' :
                                                                                                                                  self.Profile.RuleDict['RULE'             + \
                                                                                                                                                    '.'                    + \
                                                                                                                                                    Arch.upper()           + \
                                                                                                                                                    '.'                    + \
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3293..3306

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 776..779

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2649..2662

                                                                                                                      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 Op == '>':
                                                                                                                                              if MacroVal > InputVal:
                                                                                                                                                  return True
                                                                                                                                              else:
                                                                                                                                                  return False
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 738..759

                                                                                                                      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 115.

                                                                                                                      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 Op == '>':
                                                                                                                                                  if MacroVal > InputVal:
                                                                                                                                                      return True
                                                                                                                                                  else:
                                                                                                                                                      return False
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 693..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 115.

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3621..3626

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 7 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 767..772

                                                                                                                      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/Common/FdfParserLite.py and 3 other locations - About 6 hrs to fix
                                                                                                                      BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 210..214
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 204..208
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 360..364

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 6 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2812..2819

                                                                                                                      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 PcdTokenSpaceCName.PcdCName At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                              pcdTokenSpaceCName = self.__Token
                                                                                                                              
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 6 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1161..1173

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 6 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1107..1116

                                                                                                                      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("[FD."):
                                                                                                                                  if not S.startswith("[FV.") and not S.startswith("[CAPSULE.") \
                                                                                                                                      and not S.startswith("[VTF.") and not S.startswith("[RULE."):
                                                                                                                                      raise Warning("Unknown section At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  self.__UndoToken()
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 6 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2022..2027

                                                                                                                      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 5 locations. Consider refactoring.
                                                                                                                      Open

                                                                                                                              if not self.__IsToken("[FV.", 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("Unknown Keyword At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 4 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1267..1271
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2639..2643
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2762..2766
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 3349..3353

                                                                                                                      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

                                                                                                                      Similar blocks of code found in 5 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.] At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 4 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1835..1839
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2639..2643
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2762..2766
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 3349..3353

                                                                                                                      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

                                                                                                                      Similar blocks of code found in 5 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.] At Line ", self.FileName, self.CurrentLineNumber)        
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 4 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1267..1271
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1835..1839
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2762..2766
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 3349..3353

                                                                                                                      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

                                                                                                                      Similar blocks of code found in 5 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.] At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 4 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1267..1271
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1835..1839
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2639..2643
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2762..2766

                                                                                                                      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

                                                                                                                      Similar blocks of code found in 5 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.] At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 4 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1267..1271
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1835..1839
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2639..2643
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 3349..3353

                                                                                                                      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/Common/FdfParserLite.py and 2 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 118..126
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 274..282

                                                                                                                      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/Common/FdfParserLite.py and 3 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 166..175
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 161..170
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 319..328

                                                                                                                      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/Common/FdfParserLite.py and 3 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 100..110
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 98..108
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 254..264

                                                                                                                      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("[FV."):
                                                                                                                                  if not S.startswith("[CAPSULE.") \
                                                                                                                                      and not S.startswith("[VTF.") and not S.startswith("[RULE."):
                                                                                                                                      raise Warning("Unknown section or section appear sequence error \n(The correct sequence should be [FD.], [FV.], [Capsule.], [VTF.], [Rule.]) At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  self.__UndoToken()
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 2 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2632..2636
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3000..3004

                                                                                                                      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 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/Common/FdfParserLite.py and 2 other locations - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 1827..1832
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3000..3004

                                                                                                                      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 self.__IsKeyword( "NumBlocks"):
                                                                                                                                  if not self.__IsToken( "="):
                                                                                                                                      raise Warning("expected '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                      
                                                                                                                                  if not self.__GetNextDecimalNumber() and not self.__GetNextHexNumber():
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1619..1626

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3559..3568

                                                                                                                      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 '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 5 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1470..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 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

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3947..3948

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3390..3397

                                                                                                                      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 not self.__EndOfLine():
                                                                                                                                  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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 991..1001

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3836..3840

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 620..626

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 292..299

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1100..1105

                                                                                                                      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 '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 4 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2630..2639

                                                                                                                      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 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/Common/FdfParserLite.py and 3 other locations - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 183..188
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 178..183
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 336..341

                                                                                                                      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.SizePcd = pcdPair
                                                                                                                                  self.Profile.PcdDict[pcdPair] = Obj.Size
                                                                                                                                  FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1501..1506

                                                                                                                      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 '=' At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  
                                                                                                                                  if not self.__GetNextToken():
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2692..2699

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1610..1615

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1047..1056

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2069..2072

                                                                                                                      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/Common/FdfParserLite.py and 2 other locations - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2364..2367
                                                                                                                      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 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/Common/FdfParserLite.py and 1 other location - About 3 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3259..3263

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 2 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2686..2689

                                                                                                                      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 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/Common/FdfParserLite.py and 1 other location - About 2 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2755..2758

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 2 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2804..2805

                                                                                                                      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

                                                                                                                          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/Common/FdfParserLite.py and 1 other location - About 2 hrs to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 386..388

                                                                                                                      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 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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 756..758

                                                                                                                      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 ConditionSatisfied:
                                                                                                                                              self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 749..750

                                                                                                                      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/Common/FdfParserLite.py and 2 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Ecc/c.py on lines 2606..2610
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 4445..4449

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2321..2324

                                                                                                                      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

                                                                                                                      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) At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 3 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2572..2573
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2582..2583
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2190..2191

                                                                                                                      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

                                                                                                                          def __GetNextHexNumber(self):
                                                                                                                              if not self.__GetNextToken():
                                                                                                                                  return False
                                                                                                                              if self.__IsHex(self.__Token):
                                                                                                                                  return True
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1126..1133

                                                                                                                      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) At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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/GenFds/FdfParser.py on lines 2190..2191

                                                                                                                      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) At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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 2582..2583
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2190..2191

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2097..2100

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2801..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 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

                                                                                                                              for Item in Obj.BlockSizeList:
                                                                                                                                  if Item[0] == None or Item[1] == None:
                                                                                                                                      raise Warning("expected block statement for Fd Section", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1585..1586

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1144..1151

                                                                                                                      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 = ffsInf
                                                                                                                                  Obj.CapsuleDataList.append(capsuleFfs)
                                                                                                                              else:
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 3 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2147..2152
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2377..2382
                                                                                                                      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

                                                                                                                      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/Common/FdfParserLite.py and 3 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 4336..4337
                                                                                                                      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

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

                                                                                                                          def __GetCapsuleStatements(self, Obj):
                                                                                                                              self.__GetCapsuleTokens(Obj)
                                                                                                                              self.__GetDefineStatements(Obj)
                                                                                                                              self.__GetSetStatements(Obj)
                                                                                                                              
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3044..3048

                                                                                                                      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 = FfsFileObj
                                                                                                                                  Obj.CapsuleDataList.append(capsuleFfs)
                                                                                                                              else:
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 3 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2040..2045
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2377..2382
                                                                                                                      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

                                                                                                                      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/Common/FdfParserLite.py and 5 other locations - About 1 hr to fix
                                                                                                                      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
                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3463..3465

                                                                                                                      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 At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                                  TemplateName = self.__Token
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3281..3284

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3275..3276

                                                                                                                      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

                                                                                                                                              IfList[-1] = [IfList[-1][0], ConditionSatisfied, IfList[-1][2]]
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 765..765

                                                                                                                      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

                                                                                                                                          % (self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithinLine :].rstrip('\n').rstrip('\r'), FileLineTuple[1], self.CurrentOffsetWithinLine)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1320..1320

                                                                                                                      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/Common/FdfParserLite.py and 3 other locations - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 223..224
                                                                                                                      BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 217..218
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 373..374

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 628..631

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1365..1366

                                                                                                                      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

                                                                                                                                                  ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, None, 'Bool')
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 598..598

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 122..132

                                                                                                                      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

                                                                                                                                              ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, Op, MacroValue)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 637..637

                                                                                                                      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

                                                                                                                                              ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, None, 'Bool')
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 643..643

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3321..3326

                                                                                                                      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

                                                                                                                                                  ConditionSatisfied = self.__EvaluateConditional(MacroName, IfList[-1][0][0] + 1, Op, MacroValue)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 592..592

                                                                                                                      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 At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 1 hr to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1533..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 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 == "COMPRESS" or self.__Token == "GUIDED":
                                                                                                                                      self.SetFileBufferPos(OldPos)
                                                                                                                                      return False
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 55 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 2797..2799

                                                                                                                      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.CurrentLineNumber != StartLine:
                                                                                                                                  EndPos = len(self.Profile.FileLinesList[StartLine-1])
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 55 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1008..1009

                                                                                                                      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 not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
                                                                                                                                          raise Warning("Incorrect alignment At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 55 mins to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2924..2925

                                                                                                                      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 not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
                                                                                                                                      raise Warning("Incorrect alignment At Line ", self.FileName, self.CurrentLineNumber)
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 55 mins to fix
                                                                                                                      BaseTools/Source/Python/Common/FdfParserLite.py on lines 2988..2989

                                                                                                                      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(((DefineLine, DefineOffset), (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
                                                                                                                      Severity: Major
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 2 other locations - About 50 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 714..714
                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 45 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 350..351

                                                                                                                      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 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/Common/FdfParserLite.py and 1 other location - About 35 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 3519..3522

                                                                                                                      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 3 locations. Consider refactoring.
                                                                                                                      Open

                                                                                                                                  Obj.TokensDict[NameValue[0].strip()] = NameValue[1].strip()
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 2 other locations - About 35 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/GenFds.py on lines 170..171
                                                                                                                      BaseTools/Source/Python/GenFds/GenFds.py on lines 170..173

                                                                                                                      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

                                                                                                                              while self.__CurrentChar().isspace():
                                                                                                                                  if not self.__UndoOneChar():
                                                                                                                                      self.__GetOneChar()
                                                                                                                                      return
                                                                                                                      Severity: Minor
                                                                                                                      Found in BaseTools/Source/Python/Common/FdfParserLite.py and 1 other location - About 30 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1066..1069

                                                                                                                      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/Common/FdfParserLite.py and 1 other location - About 30 mins to fix
                                                                                                                      BaseTools/Source/Python/GenFds/FdfParser.py on lines 1796..1800

                                                                                                                      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