hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py

Summary

Maintainability
F
2 mos
Test Coverage

File WorkspaceDatabase.py has 2064 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to create a database used by build tool
#
# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 5 days to fix

    Function _GetHeaderInfo has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetHeaderInfo(self):
            RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
            for Record in RecordList:
                Name, Value = Record[1], ReplaceMacro(Record[2], self._Macros, False)
                # items defined _PROPERTY_ don't need additional processing
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 3 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 _GetPcd has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetPcd(self, Type):
            Pcds = sdict()
            PcdDict = tdict(True, 4)
            PcdList = []
            RecordList = self._RawData[Type, self._Arch, self._Platform]
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetDynamicHiiPcd has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetDynamicHiiPcd(self, Type):
            
            SkuObj = SkuClass(self.SkuIdentifier,self.SkuIds)
            
            Pcds = sdict()
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetDepex has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetDepex(self):
            if self._Depex == None:
                self._Depex = tdict(False, 2)
                RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]
                
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetHeaderInfo has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetHeaderInfo(self):
            RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch]
            for Record in RecordList:
                Name = Record[1]
                # items defined _PROPERTY_ don't need additional processing
    Severity: Minor
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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

    InfBuildData has 51 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class InfBuildData(ModuleBuildClassObject):
        # dict used to convert PCD type in database to string used by build tool
        _PCD_TYPE_STRING_ = {
            MODEL_PCD_FIXED_AT_BUILD        :   "FixedAtBuild",
            MODEL_PCD_PATCHABLE_IN_MODULE   :   "PatchableInModule",
    Severity: Major
    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 7 hrs to fix

      Function _GetModules has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GetModules(self):
              if self._Modules != None:
                  return self._Modules
      
              self._Modules = sdict()
      Severity: Minor
      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetIncludes has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GetIncludes(self):
              if self._Includes == None:
                  self._Includes = []
                  if self._SourceOverridePath:
                      self._Includes.append(self._SourceOverridePath)
      Severity: Minor
      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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

      DscBuildData has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class DscBuildData(PlatformBuildClassObject):
          # dict used to convert PCD type in database to string used by build tool
          _PCD_TYPE_STRING_ = {
              MODEL_PCD_FIXED_AT_BUILD        :   "FixedAtBuild",
              MODEL_PCD_PATCHABLE_IN_MODULE   :   "PatchableInModule",
      Severity: Minor
      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 5 hrs to fix

        Function _GetDynamicVpdPcd has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetDynamicVpdPcd(self, Type):
                
                SkuObj = SkuClass(self.SkuIdentifier,self.SkuIds)
                
                Pcds = sdict()
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetLibraryClasses has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetLibraryClasses(self):
                if self._LibraryClasses == None:
                    self._LibraryInstances = []
                    #
                    # tdict is a special dict kind of type, used for selecting correct
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetDynamicPcd has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetDynamicPcd(self, Type):
                
                SkuObj = SkuClass(self.SkuIdentifier,self.SkuIds)
                
                Pcds = sdict()
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _CheckWhetherDbNeedRenew has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            def _CheckWhetherDbNeedRenew (self, force, DbPath):
                # if database does not exist, we need do nothing
                if not os.path.exists(DbPath): return False
                    
                # if user force to renew database, then not check whether database is out of date
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _ValidatePcd has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo):
                if self._DecPcds == None:
                    self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain)
                if (PcdCName, TokenSpaceGuid) not in self._DecPcds:
                    EdkLogger.error('build', PARSER_ERROR,
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetSourceFiles has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetSourceFiles(self):
                if self._Sources == None:
                    self._Sources = []
                    RecordList = self._RawData[MODEL_EFI_SOURCE_FILE, self._Arch, self._Platform]
                    Macros = self._Macros
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetBinaryFiles has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetBinaryFiles(self):
                if self._Binaries == None:
                    self._Binaries = []
                    RecordList = self._RawData[MODEL_EFI_BINARY_FILE, self._Arch, self._Platform]
                    Macros = self._Macros
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetPcd has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetPcd(self, Type):
                Pcds = sdict()
                #
                # tdict is a special dict kind of type, used for selecting correct
                # PCD settings for certain ARCH
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _Clear has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _Clear(self):
                self._HeaderComments = None
                self._TailComments = None
                self._Header_               = None
                self._AutoGenVersion        = None
        Severity: Minor
        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 1 hr to fix

          Function _GetSkuIds has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetSkuIds(self):
                  if self._SkuIds == None:
                      self._SkuIds = sdict()
                      RecordList = self._RawData[MODEL_EFI_SKU_ID, self._Arch]
                      for Record in RecordList:
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetLoadFixAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetLoadFixAddress(self):
                  if self._LoadFixAddress == None:
                      if self._Header == None:
                          self._GetHeaderInfo()
          
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 GetPackageList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

              def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):
                  self.Platform = Platform
                  PackageList =[]
                  Pa = self.BuildObject[self.Platform, 'COMMON']
                  #
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetDepexExpression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetDepexExpression(self):
                  if self._DepexExpression == None:
                      self._DepexExpression = tdict(False, 2)
                      RecordList = self._RawData[MODEL_EFI_DEPEX, self._Arch]
                      DepexExpression = sdict()
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _Clear has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def _Clear(self):
                  self._Header            = None
                  self._PlatformName      = None
                  self._Guid              = None
                  self._Version           = None
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 1 hr to fix

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

                def _GetProtocols(self):
                    if self._Protocols == None:
                        self._Protocols = sdict()
                        self._ProtocolComments = sdict()
                        RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self._Platform]
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 __getitem__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                    def __getitem__(self, Key):
                        FilePath = Key[0]
                        KeyLength = len(Key)
                        if KeyLength > 1:
                            Arch = Key[1]
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetPpis has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetPpis(self):
                    if self._Ppis == None:
                        self._Ppis = sdict()
                        self._PpiComments = sdict()
                        RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetInclude has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetInclude(self):
                    if self._Includes == None:
                        self._Includes = []
                        RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch]
                        Macros = self._Macros
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetGuids has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetGuids(self):
                    if self._Guids == None:
                        self._Guids = sdict()
                        self._GuidComments = sdict()
                        RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, FilePath, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                  def _GetProtocol(self):
                      if self._Protocols == None:
                          #
                          # tdict is a special kind of dict, used for selecting correct
                          # protocol defition for given ARCH
              Severity: Minor
              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, FilePath, RawData, BuildDatabase, Arch='COMMON', Target=None, Toolchain=None):
              Severity: Minor
              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, File, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
                Severity: Minor
                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for Index in range(1, len(ValueList)):
                                              if ValueList[Index][-1] == '=' or ValueList[Index] == '':
                                                  continue
                                              Dummy = Dummy + ' /D ' + ValueList[Index]
                                          Value = Dummy.strip()
                  Severity: Major
                  Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if Value == None:
                                                PackageList = "\n\t".join([str(P) for P in self.Packages])
                                                EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
                                                                "Value of [%s] is not found in" % Token,
                                                                ExtraData=PackageList, File=self.MetaFile, Line=Record[-1])
                    Severity: Major
                    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                          def _GetInfVersion(self):
                              if self._AutoGenVersion == None:
                                  RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
                                  for Record in RecordList:
                                      if Record[1] == TAB_INF_DEFINES_INF_VERSION:
                      Severity: Minor
                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 ToolList[0] in self._TOOL_CODE_:
                                                  Tool = self._TOOL_CODE_[ToolList[0]]
                                              else:
                                                  Tool = ToolList[0]
                                              ToolChain = "*_*_*_%s_FLAGS" % Tool
                      Severity: Major
                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                            def _GetPpi(self):
                                if self._Ppis == None:
                                    #
                                    # tdict is a special kind of dict, used for selecting correct
                                    # PPI defition for given ARCH
                        Severity: Minor
                        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 File.Ext.lower() == '.h':
                                                    EdkLogger.warn('build', 'Include file not found', ExtraData=ErrorInfo,
                                                                   File=self.MetaFile, Line=LineNo)
                                                    continue
                                                else:
                        Severity: Major
                        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if ReIsValidPcdTokenValue.match(Pcd.TokenValue) == None:
                                                      EdkLogger.error(
                                                              'build',
                                                              FORMAT_INVALID,
                                                              "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                          Severity: Major
                          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if self._BuildOptions == None:
                                                        self._BuildOptions = sdict()
                            
                            Severity: Major
                            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                                  def _GetGuid(self):
                                      if self._Guids == None:
                                          #
                                          # tdict is a special kind of dict, used for selecting correct
                                          # GUID defition for given ARCH
                              Severity: Minor
                              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 Module == None:
                                                          EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Module is not found in active platform",
                                                                          ExtraData=Token, File=self.MetaFile, Line=Record[-1])
                                                      DepexList.append(Module.Guid)
                              Severity: Major
                              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if Value == None:
                                                            Value = PpiValue(Token, self.Packages)
                                                            if Value == None:
                                                                Value = GuidValue(Token, self.Packages)
                                                        if Value == None:
                                Severity: Major
                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (PcdCName, TokenSpaceGuid, T) in Package.Pcds:
                                                              PcdType = T
                                                              break
                                                  else:
                                  Severity: Major
                                  Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                                        def _GetLibraryClass(self):
                                            if self._LibraryClasses == None:
                                                #
                                                # tdict is a special kind of dict, used for selecting correct
                                                # library class declaration for given ARCH
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 (ToolChainFamily, ToolChain) not in self._BuildOptions:
                                                                self._BuildOptions[ToolChainFamily, ToolChain] = Value
                                                            else:
                                                                OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
                                                                self._BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Value
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                  if (TokenValueInt < 0 or TokenValueInt > 4294967295):
                                                                      EdkLogger.error(
                                                                                  'build',
                                                                                  FORMAT_INVALID,
                                                                                  "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid, as a decimal it should between: 0 - 4294967295!"% (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                                      Severity: Major
                                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if timeOfToolModified < fd.st_mtime:
                                                                    timeOfToolModified = fd.st_mtime
                                                if timeOfToolModified > os.stat(DbPath).st_mtime:
                                        Severity: Major
                                        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                                          Consider simplifying this complex logical expression.
                                          Open

                                                      if self._Defs and 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs \
                                                         and 'PCI_CLASS_CODE' in self._Defs:
                                                          self._BuildType = 'UEFI_OPTIONROM'
                                                      elif self._Defs and 'UEFI_HII_RESOURCE_SECTION' in self._Defs \
                                                         and self._Defs['UEFI_HII_RESOURCE_SECTION'] == 'TRUE':
                                          Severity: Major
                                          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 40 mins to fix

                                            Function GetPackageList has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):
                                            Severity: Minor
                                            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 35 mins to fix

                                              Function _ValidatePcd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  def _ValidatePcd(self, PcdCName, TokenSpaceGuid, Setting, PcdType, LineNo):
                                              Severity: Minor
                                              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 35 mins to fix

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

                                                    def _GetModuleType(self):
                                                        if self._ModuleType == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._ModuleType == None:
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetBuildOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetBuildOptions(self):
                                                        if self._BuildOptions == None:
                                                            self._BuildOptions = sdict()
                                                            RecordList = self._RawData[MODEL_META_DATA_BUILD_OPTION, self._Arch, self._Platform]
                                                            for Record in RecordList:
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetShadow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetShadow(self):
                                                        if self._Shadow == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._Shadow != None and self._Shadow.upper() == 'TRUE':
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetSkuName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetSkuName(self):
                                                        if self._SkuName == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if (self._SkuName == None or self._SkuName not in self.SkuIds):
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetLibraryNames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetLibraryNames(self):
                                                        if self._Libraries == None:
                                                            self._Libraries = []
                                                            RecordList = self._RawData[MODEL_EFI_LIBRARY_INSTANCE, self._Arch, self._Platform]
                                                            for Record in RecordList:
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetLibraryClassUses has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetLibraryClassUses(self):
                                                        if self._LibraryClasses == None:
                                                            self._LibraryClasses = sdict()
                                                            RecordList = self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, self._Platform]
                                                            for Record in RecordList:
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def __init__(self, DbPath, RenewDb=False):
                                                        self._DbClosedFlag = False
                                                        if not DbPath:
                                                            DbPath = os.path.normpath(os.path.join(GlobalData.gWorkspace, self._DB_PATH_))
                                                
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 _GetPackages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    def _GetPackages(self):
                                                        if self._Packages == None:
                                                            self._Packages = []
                                                            RecordList = self._RawData[MODEL_META_DATA_PACKAGE, self._Arch, self._Platform]
                                                            Macros = self._Macros
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 3 locations. Consider refactoring.
                                                Open

                                                    def _GetProtocols(self):
                                                        if self._Protocols == None:
                                                            self._Protocols = sdict()
                                                            self._ProtocolComments = sdict()
                                                            RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self._Platform]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 days to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2121..2140
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2146..2165

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 241.

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

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

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

                                                    def _GetGuids(self):
                                                        if self._Guids == None:
                                                            self._Guids = sdict()
                                                            self._GuidComments = sdict()
                                                            RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 days to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2096..2115
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2121..2140

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 241.

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

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

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

                                                    def _GetPpis(self):
                                                        if self._Ppis == None:
                                                            self._Ppis = sdict()
                                                            self._PpiComments = sdict()
                                                            RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 days to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2096..2115
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2146..2165

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 241.

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

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

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

                                                    def _GetPpi(self):
                                                        if self._Ppis == None:
                                                            #
                                                            # tdict is a special kind of dict, used for selecting correct
                                                            # PPI defition for given ARCH
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 day to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1258..1280
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1308..1330

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 140.

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

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

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

                                                    def _GetGuid(self):
                                                        if self._Guids == None:
                                                            #
                                                            # tdict is a special kind of dict, used for selecting correct
                                                            # GUID defition for given ARCH
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 day to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1258..1280
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1283..1305

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 140.

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

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

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

                                                    def _GetProtocol(self):
                                                        if self._Protocols == None:
                                                            #
                                                            # tdict is a special kind of dict, used for selecting correct
                                                            # protocol defition for given ARCH
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 day to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1283..1305
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1308..1330

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 140.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():                
                                                                valuefromDec = pcdDecObject.DefaultValue
                                                                SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '', '', '', valuefromDec)
                                                                pcd.SkuInfoList['DEFAULT'] = SkuInfo
                                                            elif 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' in pcd.SkuInfoList.keys():
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 7 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 934..942
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1038..1046

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 110.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():              
                                                                valuefromDec = pcdDecObject.DefaultValue
                                                                SkuInfo = SkuInfoClass('DEFAULT', '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec)
                                                                pcd.SkuInfoList['DEFAULT'] = SkuInfo
                                                            elif 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' in pcd.SkuInfoList.keys():
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 7 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 844..852
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1038..1046

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 110.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
                                                                valuefromDec = pcdDecObject.DefaultValue
                                                                SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '','',SkuInfoObj.VpdOffset, valuefromDec)
                                                                pcd.SkuInfoList['DEFAULT'] = SkuInfo
                                                            elif 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' in pcd.SkuInfoList.keys():
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 7 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 844..852
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 934..942

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 110.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (PcdCName,TokenSpaceGuid) in Pcds.keys(): 
                                                                pcdObject = Pcds[PcdCName,TokenSpaceGuid]
                                                                pcdObject.SkuInfoList[SkuName] = SkuInfo
                                                                if MaxDatumSize.strip():
                                                                    CurrentMaxSize = int(MaxDatumSize.strip(),0)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 6 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1009..1021

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 101.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (PcdCName,TokenSpaceGuid) in Pcds.keys():  
                                                                pcdObject = Pcds[PcdCName,TokenSpaceGuid]
                                                                pcdObject.SkuInfoList[SkuName] = SkuInfo
                                                                if MaxDatumSize.strip():
                                                                    CurrentMaxSize = int(MaxDatumSize.strip(),0)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 6 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 815..827

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 101.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 not Record[2] or Record[2][0] != '"' or Record[2][-1] != '"' or len(Record[2]) == 1:
                                                                    EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'language code for ISO_LANGUAGES must have double quotes around it, for example: ISO_LANGUAGES = "engchn"',
                                                                                    File=self.MetaFile, Line=Record[-1])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 6 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 217..219

                                                Duplicated Code

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

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

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 not Record[2] or Record[2][0] != '"' or Record[2][-1] != '"' or len(Record[2]) == 1:
                                                                    EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'language code for RFC_LANGUAGES must have double quotes around it, for example: RFC_LANGUAGES = "en-us;zh-hans"',
                                                                                    File=self.MetaFile, Line=Record[-1])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 6 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 231..233

                                                Duplicated Code

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

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

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

                                                    def _Clear(self):
                                                        self._Header            = None
                                                        self._PackageName       = None
                                                        self._Guid              = None
                                                        self._Version           = None
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 4 hrs to fix
                                                BaseTools/Source/Python/CommonDataClass/DataClass.py on lines 264..277

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 85.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 SkuObj.SkuUsageType == SkuObj.SINGLE:
                                                                if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys():
                                                                    pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
                                                                del(pcd.SkuInfoList['DEFAULT'])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 853..856
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 944..947

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 83.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 SkuObj.SkuUsageType == SkuObj.SINGLE:
                                                                if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys():
                                                                    pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
                                                                del(pcd.SkuInfoList['DEFAULT'])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 853..856
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1047..1050

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 83.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 SkuObj.SkuUsageType == SkuObj.SINGLE:
                                                                if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys():
                                                                    pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
                                                                del(pcd.SkuInfoList['DEFAULT'])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 944..947
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1047..1050

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 83.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (ToolChainFamily, ToolChain) not in self._BuildOptions:
                                                                            self._BuildOptions[ToolChainFamily, ToolChain] = Value
                                                                        else:
                                                                            OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
                                                                            self._BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Value
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 559..564
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2257..2262

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 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

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

                                                                if (ToolChainFamily, ToolChain) not in self._BuildOptions:
                                                                    self._BuildOptions[ToolChainFamily, ToolChain] = Option
                                                                else:
                                                                    # concatenate the option string if they're for the same tool
                                                                    OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 559..564
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1823..1827

                                                Duplicated Code

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

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

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

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

                                                            for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3, Dummy4 in RecordList:
                                                                if (ToolChainFamily, ToolChain) not in Module.BuildOptions:
                                                                    Module.BuildOptions[ToolChainFamily, ToolChain] = Option
                                                                else:
                                                                    OptionString = Module.BuildOptions[ToolChainFamily, ToolChain]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 4 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1823..1827
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2257..2262

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 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

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

                                                    def _GetDscSpec(self):
                                                        if self._DscSpecification == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._DscSpecification == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetPackageName(self):
                                                        if self._PackageName == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._PackageName == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetFileGuid(self):
                                                        if self._Guid == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._Guid == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetBuildTarget(self):
                                                        if self._BuildTargets == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._BuildTargets == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetPlatformName(self):
                                                        if self._PlatformName == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._PlatformName == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetBaseName(self):
                                                        if self._BaseName == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._BaseName == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetSupArch(self):
                                                        if self._SupArchList == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._SupArchList == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetVersion(self):
                                                        if self._Version == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._Version == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1240..1246
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

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

                                                    def _GetFileGuid(self):
                                                        if self._Guid == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._Guid == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 8 other locations - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 261..267
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 270..276
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 279..285
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 288..294
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 306..312
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 315..321
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1231..1237
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1844..1850

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 71.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _GetTailComments(self):
                                                        if not self._TailComments:
                                                            self._TailComments = []
                                                            RecordList = self._RawData[MODEL_META_DATA_TAIL_COMMENT]
                                                            for Record in RecordList:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1644..1650

                                                Duplicated Code

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

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

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

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

                                                    def _GetHeaderComments(self):
                                                        if not self._HeaderComments:
                                                            self._HeaderComments = []
                                                            RecordList = self._RawData[MODEL_META_DATA_HEADER_COMMENT]
                                                            for Record in RecordList:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1651..1657

                                                Duplicated Code

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

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

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

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

                                                                if LibraryClass == '' or LibraryClass == 'NULL':
                                                                    self._NullLibraryNumber += 1
                                                                    LibraryClass = 'NULL%d' % self._NullLibraryNumber
                                                                    EdkLogger.verbose("Found forced library for %s\n\t%s [%s]" % (ModuleFile, LibraryPath, LibraryClass))
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 590..593

                                                Duplicated Code

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

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

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

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

                                                                if LibraryClass == '' or LibraryClass == 'NULL':
                                                                    self._NullLibraryNumber += 1
                                                                    LibraryClass = 'NULL%d' % self._NullLibraryNumber
                                                                    EdkLogger.verbose("Found forced library for arch=%s\n\t%s [%s]" % (Arch, LibraryInstance, LibraryClass))
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 3 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 523..526

                                                Duplicated Code

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

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

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

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

                                                    def _GetPcdIsDriver(self):
                                                        if self._PcdIsDriver == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._PcdIsDriver == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetFdfFile(self):
                                                        if self._FlashDefinition == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._FlashDefinition == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetDxsFile(self):
                                                        if self._DxsFile == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._DxsFile == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetBsBaseAddress(self):
                                                        if self._BsBaseAddress == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._BsBaseAddress == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetFileGuid(self):
                                                        if self._Guid == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._Guid == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetVersion(self):
                                                        if self._Version == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._Version == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetBuildNumber(self):
                                                        if self._BuildNumber == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._BuildNumber == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetVpdToolGuid(self):
                                                        if self._VpdToolGuid == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._VpdToolGuid == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetComponentType(self):
                                                        if self._ComponentType == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._ComponentType == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetMakefileName(self):
                                                        if self._MakefileName == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._MakefileName == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetVersion(self):
                                                        if self._Version == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._Version == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 388..394
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetRtBaseAddress(self):
                                                        if self._RtBaseAddress == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._RtBaseAddress == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 11 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 352..358
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 361..367
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 370..376
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 379..385
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 444..450
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1249..1255
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1853..1859
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1873..1879
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1891..1897
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1900..1906
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1909..1915

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetEntryPoint(self):
                                                        if self._ModuleEntryPointList == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._ModuleEntryPointList == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetISOLanguages(self):
                                                        if self._ISOLanguages == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._ISOLanguages == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetUnloadImage(self):
                                                        if self._ModuleUnloadImageList == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._ModuleUnloadImageList == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetDestructor(self):
                                                        if self._DestructorList == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._DestructorList == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetLibraryClass(self):
                                                        if self._LibraryClass == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._LibraryClass == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetRFCLanguages(self):
                                                        if self._RFCLanguages == None:
                                                            if self._Header == None:
                                                                self._GetHeaderInfo()
                                                            if self._RFCLanguages == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1974..1980
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

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

                                                    def _GetConstructor(self):
                                                        if self._ConstructorList == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._ConstructorList == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 427..433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 436..442
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1947..1953
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1956..1962
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1965..1971
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1983..1989

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _GetMakefile(self):
                                                        if self._CustomMakefile == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._CustomMakefile == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1938..1944

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _GetSpec(self):
                                                        if self._Specification == None:
                                                            if self._Header_ == None:
                                                                self._GetHeaderInfo()
                                                            if self._Specification == None:
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1929..1935

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 61.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
                                                            if SkuName not in AvailableSkuIdSet:
                                                                continue
                                                            PcdSet.add((PcdCName, TokenSpaceGuid, SkuName,Dummy4))
                                                            PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] = Setting
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 800..805
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 990..995

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 55.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
                                                            if SkuName not in AvailableSkuIdSet:
                                                                continue
                                                            
                                                            PcdList.append((PcdCName, TokenSpaceGuid, SkuName,Dummy4))
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 882..886
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 990..995

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 55.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
                                                            if SkuName not in AvailableSkuIdSet:
                                                                continue
                                                
                                                            PcdList.append((PcdCName, TokenSpaceGuid,SkuName, Dummy4))
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 800..805
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 882..886

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 55.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Lib in Pa.LibraryInstances:
                                                            LibObj = self.BuildObject[Lib, Arch, TargetName, ToolChainTag]
                                                            for Package in LibObj.Packages:
                                                                if Package not in PackageList:
                                                                    PackageList.append(Package)            
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2788..2792

                                                Duplicated Code

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

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

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

                                                        for Module in Pa.Modules:
                                                            ModuleObj = self.BuildObject[Module, Arch, TargetName, ToolChainTag]
                                                            for Package in ModuleObj.Packages:
                                                                if Package not in PackageList:
                                                                    PackageList.append(Package)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 2 hrs to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2796..2800

                                                Duplicated Code

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

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

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

                                                                    if File[0] == '.':
                                                                        File = os.path.join(self._ModuleDir, File)
                                                                    else:
                                                                        File = os.path.join(GlobalData.gWorkspace, File)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2184..2187
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2195..2198

                                                Duplicated Code

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

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

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

                                                                    if File[0] == '.':
                                                                        File = os.path.join(self._ModuleDir, File)
                                                                    else:
                                                                        File = os.path.join(GlobalData.gWorkspace, File)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2184..2187
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2204..2207

                                                Duplicated Code

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

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

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

                                                                    if File[0] == '.':
                                                                        File = os.path.join(self._ModuleDir, File)
                                                                    else:
                                                                        File = os.path.join(GlobalData.gWorkspace, File)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2195..2198
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2204..2207

                                                Duplicated Code

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

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

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

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

                                                                if Record[0] in [None, '']:
                                                                    EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID number',
                                                                                    File=self.MetaFile, Line=Record[-1])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 461..463

                                                Duplicated Code

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

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

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

                                                                if Record[1] in [None, '']:
                                                                    EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID name',
                                                                                    File=self.MetaFile, Line=Record[-1])
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 458..460

                                                Duplicated Code

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

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

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

                                                                        except:
                                                                            EdkLogger.error(
                                                                                        'build',
                                                                                        FORMAT_INVALID,
                                                                                        "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid, it should be hexadecimal or decimal!"% (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2428..2433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2443..2448

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

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

                                                            elif Name == 'CONSTRUCTOR':
                                                                if self._ConstructorList == None:
                                                                    self._ConstructorList = []
                                                                if not Value:
                                                                    continue
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1694..1699
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1706..1711

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 ReIsValidPcdTokenValue.match(Pcd.TokenValue) == None:
                                                                            EdkLogger.error(
                                                                                    'build',
                                                                                    FORMAT_INVALID,
                                                                                    "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2443..2448
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2451..2456

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

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

                                                            elif Name == 'UNLOAD_IMAGE':
                                                                if self._ModuleUnloadImageList == None:
                                                                    self._ModuleUnloadImageList = []
                                                                if not Value:
                                                                    continue
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1700..1705
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1706..1711

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

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

                                                            elif Name == 'DESTRUCTOR':
                                                                if self._DestructorList == None:
                                                                    self._DestructorList = []
                                                                if not Value:
                                                                    continue
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1694..1699
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1700..1705

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (TokenValueInt < 0 or TokenValueInt > 4294967295):
                                                                                EdkLogger.error(
                                                                                            'build',
                                                                                            FORMAT_INVALID,
                                                                                            "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid, as a decimal it should between: 0 - 4294967295!"% (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 2 other locations - About 1 hr to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2428..2433
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2451..2456

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 40.

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

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

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

                                                    def _SetPlatform(self, Value):
                                                        if self._Platform == Value:
                                                            return
                                                        self._Platform = Value
                                                        self._Clear()
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 172..176
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1212..1216
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1623..1627

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

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

                                                    def _SetArch(self, Value):
                                                        if self._Arch == Value:
                                                            return
                                                        self._Arch = Value
                                                        self._Clear()
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1212..1216
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1623..1627
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1639..1643

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

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

                                                    def _SetArch(self, Value):
                                                        if self._Arch == Value:
                                                            return
                                                        self._Arch = Value
                                                        self._Clear()
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 172..176
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1623..1627
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1639..1643

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

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

                                                    def _SetArch(self, Value):
                                                        if self._Arch == Value:
                                                            return
                                                        self._Arch = Value
                                                        self._Clear()
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 172..176
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1212..1216
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1639..1643

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 not LanguageCodes:
                                                                    EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or more ISO639-2 format language code must be provided for ISO_LANGUAGES statement',
                                                                                    File=self.MetaFile, Line=Record[-1])                    
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 221..223

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Arch, ModuleType in Depex:
                                                                self._Depex[Arch, ModuleType] = Depex[Arch, ModuleType]
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2334..2335

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Arch, ModuleType in DepexExpression:
                                                                self._DepexExpression[Arch, ModuleType] = DepexExpression[Arch, ModuleType]
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2315..2316

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 not LanguageCodes:
                                                                    EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or more RFC4646 format language code must be provided for RFC_LANGUAGES statement',
                                                                                    File=self.MetaFile, Line=Record[-1])                
                                                Severity: Minor
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 1 other location - About 40 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 235..237

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 34.

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

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

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

                                                                    if ErrorCode != 0:
                                                                        EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo,
                                                                                        File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo,
                                                                                    File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061

                                                Duplicated Code

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

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

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

                                                                    if ErrorCode != 0:
                                                                        EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2023..2024
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, ExtraData=ErrorInfo, File=self.MetaFile, Line=LineNo)
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 6 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1344..1345
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1367..1368
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1763..1765
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 1793..1795
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2060..2061
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 2225..2226

                                                Duplicated Code

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

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

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

                                                            if ErrorCode != 0:
                                                                EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 519..520
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 598..599
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 627..628

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 598..599
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 627..628

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 519..520
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 627..628

                                                Duplicated Code

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

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

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

                                                                if ErrorCode != 0:
                                                                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
                                                Severity: Major
                                                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 519..520
                                                BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 598..599

                                                Duplicated Code

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

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

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