hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/AutoGen/GenPcdDb.py

Summary

Maintainability
F
2 wks
Test Coverage

Function CreatePcdDatabasePhaseSpecificAutoGen has a Cognitive Complexity of 285 (exceeds 5 allowed). Consider refactoring.
Open

def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
    AutoGenC = TemplateString()
    AutoGenH = TemplateString()

    Dict = {
Severity: Minor
Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 5 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

File GenPcdDb.py has 1235 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Routines for generating Pcd Database
#
# Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 3 days to fix

    Function BuildExDataBase has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

    def BuildExDataBase(Dict):
        # init Db items
        InitValueUint64 = Dict['INIT_DB_VALUE_UINT64']
        DbInitValueUint64 = DbComItemList(8, RawDataList = InitValueUint64)
        VardefValueUint64 = Dict['VARDEF_DB_VALUE_UINT64']
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 BuildExDataBase has 126 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def BuildExDataBase(Dict):
        # init Db items
        InitValueUint64 = Dict['INIT_DB_VALUE_UINT64']
        DbInitValueUint64 = DbComItemList(8, RawDataList = InitValueUint64)
        VardefValueUint64 = Dict['VARDEF_DB_VALUE_UINT64']
    Severity: Major
    Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 5 hrs to fix

      Function PackData has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def PackData(self):
              if self.ItemSize == 8:
                  PackStr = "=Q"
              elif self.ItemSize == 4:
                  PackStr = "=L"
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 CreatePcdDatabasePhaseSpecificAutoGen has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
          AutoGenC = TemplateString()
          AutoGenH = TemplateString()
      
          Dict = {
      Severity: Major
      Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 2 hrs to fix

        Function PackData has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def PackData(self):
                if self.ItemSize == 8:
                    PackStr = "=Q"
                elif self.ItemSize == 4:
                    PackStr = "=L"
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 GetInterOffset has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def GetInterOffset(self, Index):
                Offset = 0
                if self.ItemSize == 0:
                    #
                    # Variable length, need to calculate one by one
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 GetListSize has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def GetListSize(self):
                if self.ListSize:
                    return self.ListSize
                if len(self.RawDataList) == 0:
                    self.ListSize = 0
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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

        Avoid deeply nested control flow statements.
        Open

                            if Dict['TOKEN_CNAME'][Count] == Dict['SIZE_TABLE_CNAME'][Count1] and \
                                Dict['TOKEN_GUID'][Count] == Dict['SIZE_TABLE_GUID'][Count1]:
                                SizeCNameTempList.append(Dict['SIZE_TABLE_CNAME'][Count1])
                                SizeGuidTempList.append(Dict['SIZE_TABLE_GUID'][Count1])
                                SizeCurLenTempList.append(Dict['SIZE_TABLE_CURRENT_LENGTH'][Count1])
        Severity: Major
        Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if Pcd.MaxDatumSize != '':
                                  MaxDatumSize = int(Pcd.MaxDatumSize, 0)
                                  if MaxDatumSize < Size:
                                      EdkLogger.error("build", AUTOGEN_ERROR,
                                                      "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if StringTabLen % 2:
                                    StringTabLen += 1
                                if Sku.VpdOffset == '':
            Severity: Major
            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

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

              def GetIntegerValue(Input):
                  if type(Input) in (int, long):
                      return Input
                  String = Input
                  if String.endswith("U"):
              Severity: Minor
              Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 Sku.DefaultValue == 'TRUE':
                                      Pcd.InitString = 'INIT'
                                  else:
                                      if int(Sku.DefaultValue, 0) != 0:
                                          Pcd.InitString = 'INIT'              
              Severity: Major
              Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if StringTableIndex == 0:
                                        Dict['STRING_TABLE_INDEX'].append('')
                                    else:
                                        Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
                                    if Sku.DefaultValue[0] == 'L':
                Severity: Major
                Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if Sku.DefaultValue[0] == 'L':
                                          DefaultValueBinStructure = StringToArray(Sku.DefaultValue)
                                          Size = len(DefaultValueBinStructure.replace(',',' ').split())
                                          Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure)
                                      elif Sku.DefaultValue[0] == '"':
                  Severity: Major
                  Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for SkuName in Pcd.SkuInfoList:
                                            SkuInfo = Pcd.SkuInfoList[SkuName]
                                            if SkuInfo.SkuId == None or SkuInfo.SkuId == '':
                                                continue
                                            VariableNameStructure = StringToArray(SkuInfo.VariableName)
                    Severity: Major
                    Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if Sku.VpdOffset == '':
                                              VoidStarTypeCurrSize.append(str(Size) + 'U')
                                          Dict['STRING_TABLE_LENGTH'].append(StringTabLen)
                      Severity: Major
                      Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if Sku.DefaultValue in ["1", "0"]:
                                                ValueList.append(Sku.DefaultValue + "U")              
                                        else:
                        Severity: Major
                        Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

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

                              def __init__(self, ItemSize, DataList=None, RawDataList=None, LenList=None):
                                  if DataList is None:
                                      DataList = []
                                  if RawDataList is None:
                                      RawDataList = []
                          Severity: Minor
                          Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 Pcd.DatumType == "UINT64":
                                                  Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "ULL")
                                              elif Pcd.DatumType in ("UINT32", "UINT16", "UINT8"):
                                                  Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.HiiDefaultValue + "U")
                                              elif Pcd.DatumType == "BOOLEAN":
                          Severity: Major
                          Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 45 mins to fix

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

                            def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):
                                if Info.PcdIsDriver == "":
                                    return
                                if Info.PcdIsDriver not in gPcdPhaseMap:
                                    EdkLogger.error("build", AUTOGEN_ERROR, "Not supported PcdIsDriver type:%s" % Info.PcdIsDriver,
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 GetListSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def GetListSize(self):
                                    if self.ListSize:
                                        return self.ListSize
                                    if self.ItemSize == 0:
                                        assert(False)
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.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 GetInterOffset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def GetInterOffset(self, Index):
                                    Offset = 0
                                    if self.ItemSize == 0:
                                        #
                                        # Variable length, need to calculate one by one
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py - About 25 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

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

                                    if self.ItemSize == 8:
                                        PackStr = "=Q"
                                    elif self.ItemSize == 4:
                                        PackStr = "=L"
                                    elif self.ItemSize == 2:
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 5 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 411..422

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 93.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if self.ItemSize == 8:
                                        PackStr = "=Q"
                                    elif self.ItemSize == 4:
                                        PackStr = "=L"
                                    elif self.ItemSize == 2:
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 5 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 316..331

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 93.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 DbIndex in xrange(len(DbTotal)):
                                        if DbTotal[DbIndex] is Table:
                                            DbOffset += DbItemTotal[DbIndex].GetInterOffset(Offset)
                                            break
                                        DbOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 3 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 857..863

                            Duplicated Code

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

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

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

                                        for DbIndex in xrange(len(DbTotal)):
                                            if DbTotal[DbIndex] is VariableRefTable:
                                                DbOffset += DbItemTotal[DbIndex].GetInterOffset(VariableOffset)
                                                break
                                            DbOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 3 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 826..832

                            Duplicated Code

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

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

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

                                    if 'PCD_TYPE_HII' in Pcd.TokenTypeList:
                                        # Find index by CName, TokenSpaceGuid
                                        Offset = GetMatchedIndex(CName, Dict['VARIABLE_HEAD_CNAME_DECL'], TokenSpaceGuid, Dict['VARIABLE_HEAD_GUID_DECL'])
                                        assert(Offset != -1)
                                        Table = Dict['VARIABLE_DB_VALUE']
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1454..1457

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 56.

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

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

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 'PCD_TYPE_VPD' in Pcd.TokenTypeList:
                                        Offset = GetMatchedIndex(CName, Dict['VPD_HEAD_CNAME_DECL'], TokenSpaceGuid, Dict['VPD_HEAD_GUID_DECL'])
                                        assert(Offset != -1)
                                        Table = Dict['VPD_DB_VALUE']
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1449..1453

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 56.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if self.ItemSize == 0:
                                        self.ListSize = self.GetInterOffset(len(self.RawDataList) - 1) + len(self.RawDataList[len(self.RawDataList)-1])
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 490..491

                            Duplicated Code

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

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

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

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

                                    if self.ItemSize == 0:
                                        self.ListSize = self.GetInterOffset(len(self.RawDataList) - 1) + len(self.RawDataList[len(self.RawDataList)-1])
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 309..310

                            Duplicated Code

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

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

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

                                def __init__(self, ItemSize, DataList=None, RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 376..381
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 440..445
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 459..464
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 505..510
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 525..530

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                def __init__(self, ItemSize, DataList=None, RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 354..359
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 376..381
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 459..464
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 505..510
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 525..530

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                def __init__(self,ItemSize,DataList=None,RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []        
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 354..359
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 376..381
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 440..445
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 505..510
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 525..530

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                def __init__(self, ItemSize, DataList=None, RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 354..359
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 440..445
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 459..464
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 505..510
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 525..530

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                def __init__(self, ItemSize, DataList=None, RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []        
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 354..359
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 376..381
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 440..445
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 459..464
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 505..510

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                def __init__(self, ItemSize, DataList=None, RawDataList=None):
                                    if DataList is None:
                                        DataList = []
                                    if RawDataList is None:
                                        RawDataList = []        
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 5 other locations - About 2 hrs to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 354..359
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 376..381
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 440..445
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 459..464
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 525..530

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 54.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                for DbIndex in xrange(len(DbTotal)):
                                    if DbTotal[DbIndex] is SkuTable:
                                        break
                                    SkuTableOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 3 other locations - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 793..796
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 806..809
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 812..815

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                for DbIndex in xrange(len(DbTotal)):
                                    if DbTotal[DbIndex] is SkuidValue:
                                        break
                                    SkuIdTableOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 3 other locations - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 801..804
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 806..809
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 812..815

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                for DbIndex in xrange(len(DbTotal)):
                                    if DbTotal[DbIndex] is PcdCNameTable:
                                        break
                                    PcdCNameTableDbOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 3 other locations - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 793..796
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 801..804
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 806..809

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                for DbIndex in xrange(len(DbTotal)):
                                    if DbTotal[DbIndex] is PcdTokenTable:
                                        break
                                    PcdTokenTableDbOffset += DbItemTotal[DbIndex].GetListSize()
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 3 other locations - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 793..796
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 801..804
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 812..815

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 48.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                                        if StringTableIndex == 0:
                                                            Dict['STRING_TABLE_INDEX'].append('')
                                                        else:
                                                            Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1292..1295

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 47.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                                if StringTableIndex == 0:
                                                    Dict['STRING_TABLE_INDEX'].append('')
                                                else:
                                                    Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1195..1198

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 47.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if self.ItemSize == 0:
                                        #
                                        # Variable length, need to calculate one by one
                                        #
                                        assert(Index < len(self.RawDataList))
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 468..474

                            Duplicated Code

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

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

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

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

                                    if self.ItemSize == 0:
                                        #
                                        # Variable length, need to calculate one by one
                                        #
                                        assert(Index < len(self.RawDataList))
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 1 hr to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 290..296

                            Duplicated Code

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

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

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

                                DbTotal = [InitValueUint64, VardefValueUint64, InitValueUint32, VardefValueUint32, VpdHeadValue, ExMapTable, 
                                           LocalTokenNumberTable, GuidTable, StringHeadValue,  PcdNameOffsetTable,VariableTable,SkuTable, StringTableLen, PcdTokenTable,PcdCNameTable, 
                                           SizeTableValue, InitValueUint16, VardefValueUint16,InitValueUint8, VardefValueUint8, InitValueBoolean,
                                           VardefValueBoolean, SkuidValue, SkuIndexValue, UnInitValueUint64, UnInitValueUint32, UnInitValueUint16, UnInitValueUint8, UnInitValueBoolean]
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 45 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 781..784

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 35.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                DbItemTotal = [DbInitValueUint64, DbVardefValueUint64, DbInitValueUint32, DbVardefValueUint32, DbVpdHeadValue, DbExMapTable, 
                                           DbLocalTokenNumberTable, DbGuidTable, DbStringHeadValue,  DbPcdNameOffsetTable,DbVariableTable,DbSkuTable, DbStringTableLen, DbPcdTokenTable, DbPcdCNameTable, 
                                           DbSizeTableValue, DbInitValueUint16, DbVardefValueUint16,DbInitValueUint8, DbVardefValueUint8, DbInitValueBoolean,
                                           DbVardefValueBoolean, DbSkuidValue, DbSkuIndexValue, DbUnInitValueUint64, DbUnInitValueUint32, DbUnInitValueUint16, DbUnInitValueUint8, DbUnInitValueBoolean]
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 45 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 777..780

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 35.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                        if TokenSpaceGuid not in GuidList:
                                            GuidList += [TokenSpaceGuid]
                                            Dict['GUID_STRUCTURE'].append(TokenSpaceGuidStructure)
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 40 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1218..1220

                            Duplicated Code

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

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

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 VariableGuid not in GuidList:
                                                GuidList += [VariableGuid]
                                                Dict['GUID_STRUCTURE'].append(VariableGuidStructure)
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 40 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 1136..1138

                            Duplicated Code

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

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

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 type(Datas) in (list, tuple):
                                            for Data in Datas:
                                                if PackStr:
                                                    Buffer += pack(PackStr, GetIntegerValue(Data))
                                                else:
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 30 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 336..340

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 32.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                            for Data in Datas:
                                                if PackStr:
                                                    Buffer += pack(PackStr, GetIntegerValue(Data))
                                                else:
                                                    Buffer += PackGuid(Data)
                            Severity: Minor
                            Found in BaseTools/Source/Python/AutoGen/GenPcdDb.py and 1 other location - About 30 mins to fix
                            BaseTools/Source/Python/AutoGen/GenPcdDb.py on lines 335..345

                            Duplicated Code

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

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

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