hackedteam/vector-edk

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

Summary

Maintainability
F
1 mo
Test Coverage

File GenC.py has 1202 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Function CreateModulePcdCode has a Cognitive Complexity of 146 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
        TokenSpaceGuidValue = Pcd.TokenSpaceGuidValue   #Info.GuidList[Pcd.TokenSpaceGuidCName]
        PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
        #
        # Write PCDs
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.py - About 2 days to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function CreateLibraryPcdCode has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
        PcdTokenNumber = Info.PlatformInfo.PcdTokenNumber
        TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
        TokenCName  = Pcd.TokenCName
        PcdTokenName = '_PCD_TOKEN_' + TokenCName
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 DynExPcdTokenNumberMapping has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

    def DynExPcdTokenNumberMapping(Info, AutoGenH):
        ExTokenCNameList = []
        PcdExList        = []
        if Info.IsLibrary:
            PcdList = Info.LibraryPcdList
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreateModuleEntryPointCode has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateModuleEntryPointCode(Info, AutoGenC, AutoGenH):
        if Info.IsLibrary or Info.ModuleType in ['USER_DEFINED', 'SEC']:
            return
        #
        # Module Entry Points
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreateUnicodeStringCode has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH, UniGenCFlag, UniGenBinBuffer):
        WorkingDir = os.getcwd()
        os.chdir(Info.WorkspaceDir)
    
        IncList = [Info.MetaFile.Dir]
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreatePcdCode has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreatePcdCode(Info, AutoGenC, AutoGenH):
    
        # Collect Token Space GUIDs used by DynamicEc PCDs
        TokenSpaceList = []
        for Pcd in Info.ModulePcdList:
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreateLibraryConstructorCode has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):
        #
        # Library Constructors
        #
        ConstructorPrototypeString = TemplateString()
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreateLibraryDestructorCode has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):
        #
        # Library Destructors
        #
        DestructorPrototypeString = TemplateString()
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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 CreateHeaderCode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def CreateHeaderCode(Info, AutoGenC, AutoGenH):
        # file header
        AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'}))
        # header file Prologue
        AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/GenC.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

    Avoid deeply nested control flow statements.
    Open

                        if Unicode:
                            NewValue = NewValue + str(ord(Value[Index]) % 0x10000) + ', '
                        else:
                            NewValue = NewValue + str(ord(Value[Index]) % 0x100) + ', '
                    if Unicode:
    Severity: Major
    Found in BaseTools/Source/Python/AutoGen/GenC.py - About 45 mins to fix

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

      def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer):
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/GenC.py - About 45 mins to fix

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

        def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH, UniGenCFlag, UniGenBinBuffer):
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/GenC.py - About 35 mins to fix

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

                  if PcdExCNameList.count(Pcd.TokenCName) > 1:
                      AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds are different Guids but same CName.\n')
                      AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName, PcdExTokenName))
                      AutoGenH.Append('// #define %s  LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
                      if Pcd.DatumType == 'VOID*':
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 2 days to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1043..1057

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 222.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 PcdExCNameList.count(Pcd.TokenCName) > 1:
                      AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGet/Set are not allowed in the case that more than one DynamicEx Pcds are different Guids but same CName.\n')
                      AutoGenH.Append('// #define %s  %s\n' % (PcdTokenName, PcdExTokenName))
                      AutoGenH.Append('// #define %s  LibPcdGetEx%s(&%s, %s)\n' % (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))
                      if Pcd.DatumType == 'VOID*':
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 2 days to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 802..816

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 222.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Lib.ModuleType in ['BASE', 'SEC']:
                      ConstructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))
                      ConstructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))
                  elif Lib.ModuleType in ['PEI_CORE','PEIM']:
                      ConstructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1160..1169

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 179.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Lib.ModuleType in ['BASE', 'SEC']:
                      DestructorPrototypeString.Append(gLibraryStructorPrototype['BASE'].Replace(Dict))
                      DestructorCallingString.Append(gLibraryStructorCall['BASE'].Replace(Dict))
                  elif Lib.ModuleType in ['PEI_CORE','PEIM']:
                      DestructorPrototypeString.Append(gLibraryStructorPrototype['PEI'].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1103..1112

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 179.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Info.IsLibrary:
                  AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
              else:
                  if Info.ModuleType in ['BASE', 'SEC']:
                      AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1185..1194

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 133.

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

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

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

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

          Refactorings

          Further Reading

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

              if Info.IsLibrary:
                  AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)
              else:
                  if Info.ModuleType in ['BASE', 'SEC']:
                      AutoGenC.Append(gLibraryString['BASE'].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1128..1137

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 133.

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

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

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

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

          Refactorings

          Further Reading

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

                      elif Pcd.DatumType == 'UINT32':
                          if ValueNumber < 0:
                              EdkLogger.error("build", AUTOGEN_ERROR,
                                              "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                              ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 851..861
          BaseTools/Source/Python/AutoGen/GenC.py on lines 873..883
          BaseTools/Source/Python/AutoGen/GenC.py on lines 884..894

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 125.

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

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

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

                      elif Pcd.DatumType == 'UINT8':
                          if ValueNumber < 0:
                              EdkLogger.error("build", AUTOGEN_ERROR,
                                              "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                              ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 851..861
          BaseTools/Source/Python/AutoGen/GenC.py on lines 862..872
          BaseTools/Source/Python/AutoGen/GenC.py on lines 873..883

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 125.

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

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

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

                      elif Pcd.DatumType == 'UINT16':
                          if ValueNumber < 0:
                              EdkLogger.error("build", AUTOGEN_ERROR,
                                              "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                              ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 851..861
          BaseTools/Source/Python/AutoGen/GenC.py on lines 862..872
          BaseTools/Source/Python/AutoGen/GenC.py on lines 884..894

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 125.

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

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

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

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

          Refactorings

          Further Reading

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

                      if Pcd.DatumType == 'UINT64':
                          if ValueNumber < 0:
                              EdkLogger.error("build", AUTOGEN_ERROR,
                                              "PCD can't be set to negative value for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                              ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 1 day to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 862..872
          BaseTools/Source/Python/AutoGen/GenC.py on lines 873..883
          BaseTools/Source/Python/AutoGen/GenC.py on lines 884..894

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 125.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:
                      # If one of the Source built modules listed in the DSC is not listed in FDF modules, 
                      # and the INF lists a PCD can only use the PcdsDynamic access method (it is only 
                      # listed in the DEC file that declares the PCD as PcdsDynamic), then build tool will 
                      # report warning message notify the PI that they are attempting to build a module 
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 5 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 986..1005

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 92.

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

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

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

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

          Refactorings

          Further Reading

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

              if Pcd.Type in gDynamicExPcd:
                  TokenNumber = int(Pcd.TokenValue, 0)
              else:
                  if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in PcdTokenNumber:
                      # If one of the Source built modules listed in the DSC is not listed in FDF modules, 
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 5 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 756..772

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 92.

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

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

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

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

          Refactorings

          Further Reading

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

          def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
              if Info.IsLibrary:
                  return
          
              if Info.ModuleType in ["USER_DEFINED", "BASE"]:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 5 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1317..1332
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1340..1355

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 91.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
              if Info.IsLibrary:
                  return
          
              if Info.ModuleType in ["USER_DEFINED", "BASE"]:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 5 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1294..1309
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1340..1355

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 91.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
              if Info.IsLibrary:
                  return
          
              if Info.ModuleType in ["USER_DEFINED", "BASE"]:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 5 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1294..1309
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1317..1332

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 91.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 Index == 1:
                              AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr)  (' % (Pcd.TokenCName))
                              AutoGenH.Append('\\\n  COMPAREGUID (GuidPtr, &%s) ? _PCD_TOKEN_%s_%s:' 
                                              % (Pcd.TokenSpaceGuidCName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
                          else:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 4 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 698..704

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 78.

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

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

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

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

          Refactorings

          Further Reading

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

                          if Index == 1:
                              AutoGenH.Append('\n#define __PCD_%s_ADDR_CMP(GuidPtr)  (' % (Pcd.TokenCName))
                              AutoGenH.Append('\\\n  (GuidPtr == &%s) ? _PCD_TOKEN_%s_%s:' 
                                              % (Pcd.TokenSpaceGuidCName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
                          else:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 4 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 718..724

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 78.

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

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

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

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

          Refactorings

          Further Reading

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

              elif Info.ModuleType == 'PEIM':
                  if NumEntryPoints < 2:
                      AutoGenC.Append(gPeimEntryPointString[NumEntryPoints].Replace(Dict))
                  else:
                      AutoGenC.Append(gPeimEntryPointString[2].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 3 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1249..1254
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1261..1266

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 69.

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

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

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

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

          Refactorings

          Further Reading

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

              elif Info.ModuleType in ['DXE_RUNTIME_DRIVER','DXE_DRIVER','DXE_SAL_DRIVER','UEFI_DRIVER']:
                  if NumEntryPoints < 2:
                      AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))
                  else:
                      AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 3 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1243..1248
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1261..1266

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 69.

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

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

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

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

          Refactorings

          Further Reading

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

              elif Info.ModuleType == 'UEFI_APPLICATION':
                  if NumEntryPoints < 2:
                      AutoGenC.Append(gUefiApplicationEntryPointString[NumEntryPoints].Replace(Dict))
                  else:
                      AutoGenC.Append(gUefiApplicationEntryPointString[2].Replace(Dict))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 3 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1243..1248
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1249..1254

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 69.

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

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

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

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

          Refactorings

          Further Reading

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

              if Pcd.DatumType not in gDatumSizeStringDatabase:
                  EdkLogger.error("build", AUTOGEN_ERROR,
                                  "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                  ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 776..779
          BaseTools/Source/Python/AutoGen/GenC.py on lines 780..783
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1007..1010

          Duplicated Code

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

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

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

              if Pcd.Type not in gItemTypeStringDatabase:
                  EdkLogger.error("build", AUTOGEN_ERROR,
                                  "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                  ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 776..779
          BaseTools/Source/Python/AutoGen/GenC.py on lines 780..783
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1011..1014

          Duplicated Code

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

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

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

              if Pcd.Type not in gItemTypeStringDatabase:
                  EdkLogger.error("build", AUTOGEN_ERROR,
                                  "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                  ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 780..783
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1007..1010
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1011..1014

          Duplicated Code

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

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

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

              if Pcd.DatumType not in gDatumSizeStringDatabase:
                  EdkLogger.error("build", AUTOGEN_ERROR,
                                  "Unknown datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
                                  ExtraData="[%s]" % str(Info))
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 3 other locations - About 2 hrs to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 776..779
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1007..1010
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1011..1014

          Duplicated Code

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

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

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

              if 'BUILD' in Info.BuildOption and Info.BuildOption['BUILD']['FLAGS'].find('-s') > -1:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1434..1434

          Duplicated Code

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

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

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

              if 'BUILD' in Info.BuildOption and Info.BuildOption['BUILD']['FLAGS'].find('-c') > -1:
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 1 hr to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1442..1442

          Duplicated Code

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

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

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

                              if Unicode:
                                  NewValue = NewValue + str(ord(Value[Index]) % 0x10000) + ', '
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 55 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 911..914

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 37.

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

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

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

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

          Refactorings

          Further Reading

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

              if 'UEFI_SPECIFICATION_VERSION' in Info.Module.Specification:
                  UefiSpecVersion = Info.Module.Specification['UEFI_SPECIFICATION_VERSION']
              else:
                  UefiSpecVersion = '0x00000000'
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 45 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1210..1213

          Duplicated Code

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

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

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 'PI_SPECIFICATION_VERSION' in Info.Module.Specification:
                  PiSpecVersion = Info.Module.Specification['PI_SPECIFICATION_VERSION']
              else:
                  PiSpecVersion = '0x00000000'
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 45 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 1214..1217

          Duplicated Code

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

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

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

          Tuning

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

                      try:
                          if Value.upper().startswith('0X'):
                              ValueNumber = int (Value, 16)
                          else:
                              ValueNumber = int (Value)
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 1 other location - About 40 mins to fix
          BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py on lines 167..170

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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 3 locations. Consider refactoring.
          Open

              GetModeName = '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 35 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 788..788
          BaseTools/Source/Python/AutoGen/GenC.py on lines 824..824

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

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

              SetModeName = '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.DatumType] + '_' + Pcd.TokenCName
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 35 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 787..787
          BaseTools/Source/Python/AutoGen/GenC.py on lines 824..824

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

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

                  PcdVariableName = '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] + '_' + Pcd.TokenCName
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/GenC.py and 2 other locations - About 35 mins to fix
          BaseTools/Source/Python/AutoGen/GenC.py on lines 787..787
          BaseTools/Source/Python/AutoGen/GenC.py on lines 788..788

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status