hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Eot/FvImage.py

Summary

Maintainability
F
3 wks
Test Coverage

File FvImage.py has 1085 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Parse FV image
#
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/Eot/FvImage.py - About 2 days to fix

    Function DisPatchDxe has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
    Open

        def DisPatchDxe(self, Db):
            IsInstalled = False
            ScheduleList = sdict()
            for FfsID in self.UnDispatchedFfsDict:
                CouldBeLoaded = False
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/FvImage.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 Dispatch has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        def Dispatch(self, Db = None):
            if Db == None:
                return False
            self.UnDispatchedFfsDict = copy.copy(self.FfsDict)
            # Find PeiCore, DexCore, PeiPriori, DxePriori first
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/FvImage.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 DisPatchPei has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

        def DisPatchPei(self, Db):
            IsInstalled = False
            for FfsID in self.UnDispatchedFfsDict:
                CouldBeLoaded = True
                DepexString = ''
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/FvImage.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 ParseDepex has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def ParseDepex(self, Depex, Type):
            List = None
            if Type == 'Ppi':
                List = EotGlobalData.gPpiList
            if Type == 'Protocol':
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/FvImage.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 _GetSections has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetSections(m):
            SectionList = []
            Guid = gGuidStringFormat % m.SectionDefinitionGuid
            if Guid == m.CRC32_GUID:
                # skip the CRC32 value, we don't do CRC32 verification here
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/FvImage.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

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

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

      Function _Unpack has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          def _Unpack(self):
              Size = self._LENGTH_.unpack_from(self._BUF_, self._OFF_)[0]
              self.empty()
              self.extend(self._BUF_[self._OFF_:self._OFF_+Size])
      
      Severity: Minor
      Found in BaseTools/Source/Python/Eot/FvImage.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 _GetExpression has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GetExpression(m):
              if m._ExprList == []:
                  Offset = 0
                  CurrentData = m._OPCODE_
                  while Offset < len(m):
      Severity: Minor
      Found in BaseTools/Source/Python/Eot/FvImage.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 _Parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def _Parse(self):
              MapFile = open(self.File, 'r')
              MappingTitle = self._StartFlag[self.MapType]
              MappingFormat = self._MappingFormat[self.MapType]
              MappingStart = False
      Severity: Minor
      Found in BaseTools/Source/Python/Eot/FvImage.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 LoadCallbackProtocol has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def LoadCallbackProtocol(self):
              IsLoad = True
              for Protocol in self.ProtocolList:
                  for Callback in self.ProtocolList[Protocol][1]:
                      if Callback[0] not in self.OrderedFfsDict.keys():
      Severity: Minor
      Found in BaseTools/Source/Python/Eot/FvImage.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

                              while len(Section) > Start:
                                  Guid = GuidStruct.unpack_from(Section[Start : Start + 16])
                                  GuidString = gGuidStringFormat % Guid
                                  Start = Start + 16
                                  if GuidString in self.UnDispatchedFfsDict:
      Severity: Major
      Found in BaseTools/Source/Python/Eot/FvImage.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for CompressSection in CompressSections.Sections:
                                    if CompressSection.Type == 0x13:
                                        IsFoundDepex = True
                                        CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Protocol')
                                        break
        Severity: Major
        Found in BaseTools/Source/Python/Eot/FvImage.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  while len(Section) > Start:
                                      Guid = GuidStruct.unpack_from(Section[Start : Start + 16])
                                      GuidString = gGuidStringFormat % Guid
                                      Start = Start + 16
                                      if GuidString in self.UnDispatchedFfsDict:
          Severity: Major
          Found in BaseTools/Source/Python/Eot/FvImage.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for CompressSection in CompressSections.Sections:
                                        if CompressSection.Type == 0x1B:
                                            CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Ppi')
                                            break
                                        if CompressSection.Type == 0x02:
            Severity: Major
            Found in BaseTools/Source/Python/Eot/FvImage.py - About 45 mins to fix

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

                  def __str__(m):
                      global gIndention
                      gIndention += 4
                      Indention = ' ' * gIndention
                      S = '\n'
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.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 GetOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              def GetOptions():
                  OptionList = [
                      make_option("-a", "--arch", dest="Arch",
                                        help="The input file is preprocessed source code, including C or assembly code"),
                      make_option("-p", "--platform", dest="ActivePlatform",
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.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 _Unpack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _Unpack(self):
                      Size1, Size2, Size3 = self._SIZE_.unpack_from(self._BUF_, self._OFF_)
                      Size = Size1 + (Size2 << 8) + (Size3 << 16)
                      self.empty()
                      self.extend(self._BUF_[self._OFF_ : self._OFF_ + Size])
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.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

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

                      if FfsDxeCoreGuid != None:
                          self.OrderedFfsDict[FfsDxeCoreGuid] = self.UnDispatchedFfsDict.pop(FfsDxeCoreGuid)
                          self.LoadProtocol(Db, FfsDxeCoreGuid)
                          if FfsDxePrioriGuid != None:
                              # Load PEIM described in priori file
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 days to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 244..261

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                      if FfsPeiCoreGuid != None:
                          self.OrderedFfsDict[FfsPeiCoreGuid] = self.UnDispatchedFfsDict.pop(FfsPeiCoreGuid)
                          self.LoadPpi(Db, FfsPeiCoreGuid)
                          if FfsPeiPrioriGuid != None:
                              # Load PEIM described in priori file
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 days to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 266..283

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                      elif Guid == m.LZMA_COMPRESS_GUID:
                          try:
                              import LzmaCompressor
                              # skip the header
                              Offset = m.DataOffset - 4
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 1 day to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 665..684

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 149.

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

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

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

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

              Refactorings

              Further Reading

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

                      elif Guid == m.TIANO_COMPRESS_GUID:
                          try:
                              import EfiCompressor
                              # skip the header
                              Offset = m.DataOffset - 4
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 1 day to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 686..705

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 149.

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

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

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

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

              Refactorings

              Further Reading

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

                          elif Item == 0x01:
                              Index = Index + 1
                              Guid = gGuidStringFormat % Depex.Expression[Index]
                              if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] == 0x08:
                                  return (True, 'AFTER %s' % Guid, [Guid, 'AFTER'])
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 4 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 165..169

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 84.

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

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

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

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

              Refactorings

              Further Reading

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

                          if Item == 0x00:
                              Index = Index + 1
                              Guid = gGuidStringFormat % Depex.Expression[Index]
                              if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] == 0x08:
                                  return (True, 'BEFORE %s' % Guid, [Guid, 'BEFORE'])
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 4 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 170..174

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 84.

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

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

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

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

              Refactorings

              Further Reading

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

                  def _SetSize(m, Size):
                      Size1 = Size & 0xFF
                      Size2 = (Size & 0xFF00) >> 8
                      Size3 = (Size & 0xFF0000) >> 16
                      m.SetField(m._SIZE_, 0, Size1, Size2, Size3)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 3 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 1081..1085

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 67.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _SetSize(m, Size):
                      Size1 = Size & 0xFF
                      Size2 = (Size & 0xFF00) >> 8
                      Size3 = (Size & 0xFF0000) >> 16
                      m.SetField(m._SIZE_, 0, Size1, Size2, Size3)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 3 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 912..916

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 67.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

                      except:
                          import EfiCompressor
                          TmpData = EfiCompressor.UefiDecompress(
                                                      m[m._HEADER_SIZE_:],
                                                      len(m) - m._HEADER_SIZE_
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 558..565

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                      try:
                          import EfiCompressor
                          TmpData = EfiCompressor.FrameworkDecompress(
                                                      m[m._HEADER_SIZE_:],
                                                      len(m) - m._HEADER_SIZE_
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 566..573

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                              DepexList.append(str(DepexList.pop()) + ' ' + Depex._OPCODE_STRING_[Item].upper() + ' ' + str(DepexList.pop()))
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 186..186

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                              DepexStack.append(eval(str(DepexStack.pop()) + ' ' + Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop())))
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 187..187

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
              Open

                  def _Unpack(m):
                      # keep header in this Image object
                      m.empty()
                      m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
                      return len(m)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 625..629
              BaseTools/Source/Python/Eot/FvImage.py on lines 814..818

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                  def _Unpack(m):
                      # keep header in this Image object
                      m.empty()
                      m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
                      return len(m)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 625..629
              BaseTools/Source/Python/Eot/FvImage.py on lines 772..776

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                  def _Unpack(m):
                      # keep header in this Image object
                      m.empty()
                      m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
                      return len(m)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 772..776
              BaseTools/Source/Python/Eot/FvImage.py on lines 814..818

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 51.

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

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

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

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

              Refactorings

              Further Reading

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

                  def _GetSize(m):
                      Size1, Size2, Size3 = m.GetField(m._SIZE_)
                      return Size1 + (Size2 << 8) + (Size3 << 16)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 1087..1089

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                  def _GetSize(m):
                      Size1, Size2, Size3 = m.GetField(m._SIZE_)
                      return Size1 + (Size2 << 8) + (Size3 << 16)
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 2 hrs to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 918..920

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

                  _TypeName = {
                      0x00    :   "<unknown>",
                      0x01    :   "RAW",
                      0x02    :   "FREEFORM",
                      0x03    :   "SECURITY_CORE",
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 6 other locations - About 1 hr to fix
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 2682..2702
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 4134..4154
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 5153..5173
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 6111..6131
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 7126..7146
              vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 7338..7358

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
              Open

                                  if Section.Type == 0x13:
                                      IsFoundDepex = True
                                      CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(Section._SubImages[4], 'Protocol')
                                      break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 1 hr to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 363..366
              BaseTools/Source/Python/Eot/FvImage.py on lines 369..373

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
              Open

                                              for NewSection in NewSections.Sections:
                                                  if NewSection.Type == 0x13:
                                                      IsFoundDepex = True
                                                      CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(NewSection._SubImages[4], 'Protocol')
                                                      break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 1 hr to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 356..359
              BaseTools/Source/Python/Eot/FvImage.py on lines 363..366

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
              Open

                                          if CompressSection.Type == 0x13:
                                              IsFoundDepex = True
                                              CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Protocol')
                                              break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 1 hr to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 356..359
              BaseTools/Source/Python/Eot/FvImage.py on lines 369..373

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
              Open

                                  if Section.Type == 0x1B:
                                      CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(Section._SubImages[4], 'Ppi')
                                      break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 55 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 426..428
              BaseTools/Source/Python/Eot/FvImage.py on lines 431..434

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 37.

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

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

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

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

              Refactorings

              Further Reading

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

                                          if CompressSection.Type == 0x1B:
                                              CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(CompressSection._SubImages[4], 'Ppi')
                                              break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 55 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 419..421
              BaseTools/Source/Python/Eot/FvImage.py on lines 431..434

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                                              for NewSection in NewSections.Sections:
                                                  if NewSection.Type == 0x1B:
                                                      CouldBeLoaded, DepexString, FileDepex = self.ParseDepex(NewSection._SubImages[4], 'Ppi')
                                                      break
              Severity: Major
              Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 55 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 419..421
              BaseTools/Source/Python/Eot/FvImage.py on lines 426..428

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
              Open

                          elif Item == 0x07:
                              DepexStack.append(False)
                              DepexList.append('False')
                              DepexString = DepexString + 'FALSE' + ' '
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 50 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 191..194

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                          elif Item == 0x06:
                              DepexStack.append(True)
                              DepexList.append('TRUE')
                              DepexString = DepexString + 'TRUE' + ' '
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 50 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 195..198

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                          if ((self.Attributes & 0x00000800) != 0 and len(FfsObj) == 0xFFFFFF) \
                              or ((self.Attributes & 0x00000800) == 0 and len(FfsObj) == 0):
                              if LastFfsObj != None:
                                  LastFfsObj.FreeSpace = EndOfFv - LastFfsObj._OFF_ - len(LastFfsObj)
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 45 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 483..484

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                              if LastFfsObj != None:
                                  LastFfsObj.FreeSpace = FfsStartAddress - LastFfsObj._OFF_ - len(LastFfsObj)
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 45 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 472..475

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                              DepexList.append(Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexList.pop()))
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 35 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 189..189

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
              Open

                              DepexStack.append(eval(Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop())))
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 35 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 190..190

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
              Open

                      SectionInfo = '\n'.join([str(self.Sections[Offset]) for Offset in self.Sections])
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 35 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 455..455

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
              Open

                      FfsInfo = "\n".join([str(self.FfsDict[FfsId]) for FfsId in self.FfsDict])
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 35 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 1027..1027

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
              Open

                  def _GetFixed(self):
                      if (self.Attributes & self.FFS_ATTRIB_FIXED) != 0:
                          return True
                      return False
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 30 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 1108..1111

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 32.

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

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

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

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

              Refactorings

              Further Reading

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

                  def _GetCheckSum(self):
                      if (self.Attributes & self.FFS_ATTRIB_CHECKSUM) != 0:
                          return True
                      return False
              Severity: Minor
              Found in BaseTools/Source/Python/Eot/FvImage.py and 1 other location - About 30 mins to fix
              BaseTools/Source/Python/Eot/FvImage.py on lines 1103..1106

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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