hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py

Summary

Maintainability
F
2 wks
Test Coverage

File GenInfFile.py has 685 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file GenInfFile.py
#
# This file contained the logical of transfer package object to INF files.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
Severity: Major
Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 1 day to fix

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

    def GenLibraryClasses(ModuleObject):
        #
        # generate [LibraryClasses] section
        #
        Content = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenBuildOptions has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenBuildOptions(ModuleObject):
        Content = ''
        if not ModuleObject.BinaryModule:
            #
            # generate [BuildOptions] section
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenPcdSections has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenPcdSections(ModuleObject):
        Content = ''
        if not GlobalData.gIS_BINARY_INF:
            #
            # for each Pcd Itemtype, maintain a dict so the same type will be grouped 
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenAsBuiltPacthPcdSections has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenAsBuiltPacthPcdSections(ModuleObject):
        PatchPcdDict = {}
        for BinaryFile in ModuleObject.GetBinaryFileList():
            if not BinaryFile.AsBuiltList:
                continue            
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function GenAsBuiltPcdExSections has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenAsBuiltPcdExSections(ModuleObject):
        PcdExDict = {}
        for BinaryFile in ModuleObject.GetBinaryFileList():
            if not BinaryFile.AsBuiltList:
                continue   
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function GenDefines has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenDefines(ModuleObject):
        #
        # generate [Defines] section
        #
        Content = ''          
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenProtocolPPiSections has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenProtocolPPiSections(ObjList, IsProtocol):
        Content = ''
        Dict = Sdict()
        for Object in ObjList:
            HelpTextList = Object.GetHelpTextList()
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenUserExtensions has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenUserExtensions(ModuleObject):
        NewSectionDict = {}
        for UserExtension in ModuleObject.GetUserExtensionList():
            if UserExtension.GetIdentifier() == 'Depex':
                continue
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenBinaries has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenBinaries(ModuleObject):
        NewSectionDict = {}
        BinariesDict = []
        for UserExtension in ModuleObject.GetUserExtensionList():
            BinariesDict = UserExtension.GetBinariesDict()
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenGuidSections has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenGuidSections(GuidObjList):
        #
        # generate [Guids] section
        #
        Content = '' 
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenSpecialSections has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenSpecialSections(ObjectList, SectionName):
        #
        # generate section
        #
        Content = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenDepex has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenDepex(ModuleObject):
        #
        # generate [Depex] section
        #
        NewSectionDict = Sdict()
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenPackages has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenPackages(ModuleObject):
        Content = ''
        #
        # generate [Packages] section
        #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenBinaryStatement has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenBinaryStatement(Key, Value):
        (FileName, FileType, FFE, SortedArch) = Key
        if SortedArch:
            pass
        if Value:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 GenDefines has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def GenDefines(ModuleObject):
        #
        # generate [Defines] section
        #
        Content = ''          
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                          if LibraryClassDict.has_key('COMMON'):
                              LibraryClassDict['COMMON'].append(Statement)
                          else:
                              LibraryClassDict['COMMON'] = ['## @LIB_INSTANCES']
                              LibraryClassDict['COMMON'].append(Statement)
      Severity: Major
      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if PatchPcdDict.has_key(Arch):
                                PatchPcdDict[Arch].append(Statement)
                            else:
                                PatchPcdDict[Arch] = [Statement]
            return GenSection('PatchPcd', PatchPcdDict)
        Severity: Major
        Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if BuildOptionDict.has_key('COMMON'):
                                  if Statement not in BuildOptionDict['COMMON']:
                                      BuildOptionDict['COMMON'].append(Statement)
                              else:
                                  BuildOptionDict['COMMON'] = ['## @AsBuilt']
          Severity: Major
          Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                for Arch in BinaryFile.SupArchList:
                                    if BuildOptionDict.has_key(Arch):
                                        if Statement not in BuildOptionDict[Arch]:
                                            BuildOptionDict[Arch].append(Statement)
                                    else:
            Severity: Major
            Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

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

              def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=None, 
              Severity: Minor
              Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if PcdExDict.has_key(Arch):
                                        PcdExDict[Arch].append(Statement)
                                    else:
                                        PcdExDict[Arch] = [Statement]
                    return GenSection('PcdEx', PcdExDict)
                Severity: Major
                Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

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

                  def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=None, 
                                         ToolCode=None, HelpStr=None):
                      Statement = ''
                      if HelpStr:
                          Statement += GenGenericCommentF(HelpStr)   
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.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 SortedArch in NewSectionDict:
                                          NewSectionDict[SortedArch] = NewSectionDict[SortedArch] + [Statement]
                                      else:
                                          NewSectionDict[SortedArch] = [Statement]
                                  #
                  Severity: Major
                  Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for Arch in BinaryFile.SupArchList:
                                            if LibraryClassDict.has_key(Arch):
                                                LibraryClassDict[Arch].append(Statement)
                                            else:
                                                LibraryClassDict[Arch] = ['## @LIB_INSTANCES']
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

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

                          if FeatureFlag:
                              Statement += '|' + Family + '|' + TagName + '|' + ToolCode + '|' + FeatureFlag
                          elif ToolCode:
                              Statement += '|' + Family + '|' + TagName + '|' + ToolCode
                          elif TagName:
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 1 day to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 488..501

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 143.

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

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

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

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

                      Refactorings

                      Further Reading

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

                          if FileType in DT.BINARY_FILE_TYPE_UI_LIST + DT.BINARY_FILE_TYPE_VER_LIST:
                              if FFE:
                                  Statement += '|' + Target + '|' + FFE
                              elif Target:
                                  Statement += '|' + Target
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 1 day to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 452..459

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 143.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  if len(BinaryFile.SupArchList) == 0:
                                      if PatchPcdDict.has_key('COMMON'):
                                          PatchPcdDict['COMMON'].append(Statement)
                                      else:
                                          PatchPcdDict['COMMON'] = [Statement]
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 6 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 816..826

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 103.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  if len(BinaryFile.SupArchList) == 0:
                                      if PcdExDict.has_key('COMMON'):
                                          PcdExDict['COMMON'].append(Statement)
                                      else:
                                          PcdExDict['COMMON'] = [Statement]
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 6 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 773..783

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 103.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              for PkgInfo in GlobalData.gWSPKG_LIST:
                                  if Guid == PkgInfo[1]:
                                      if (not Version) or (Version == PkgInfo[2]):
                                          Path = PkgInfo[3]
                                          break
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py on lines 88..92

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 61.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  for Key in KeyList:
                                      if Key in NewSectionDict:
                                          NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
                                      else:
                                          NewSectionDict[Key] = [Statement]
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 374..378
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 415..419

                      Duplicated Code

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

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

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

                              for Key in KeyList:
                                  if Key in NewSectionDict:
                                      NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
                                  else:
                                      NewSectionDict[Key] = [Statement]
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 245..249
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 415..419

                      Duplicated Code

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

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

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

                              for Key in KeyList:
                                  if Key in NewSectionDict:
                                      NewSectionDict[Key] = NewSectionDict[Key] + [Statement]
                                  else:
                                      NewSectionDict[Key] = [Statement]
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 245..249
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 374..378

                      Duplicated Code

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

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

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 TokenSpaceName == '' or PcdCName == '':    
                                      Logger.Error("Upt",
                                                   ToolError.RESOURCE_NOT_AVAILABLE,
                                                   ST.ERR_INSTALL_FILE_DEC_FILE_ERROR%(TokenSpaceGuidValue, Token), 
                                                   File=ModuleObject.GetFullPath()) 
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 766..770

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 53.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  if TokenSpaceName == '' or PcdCName == '':    
                                      Logger.Error("Upt", 
                                                   ToolError.RESOURCE_NOT_AVAILABLE,
                                                   ST.ERR_INSTALL_FILE_DEC_FILE_ERROR%(TokenSpaceGuidValue, Token), 
                                                   File=ModuleObject.GetFullPath())                 
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 2 hrs to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 808..812

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 53.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  for HelpStringItem in HelpTextList:
                                      for HelpLine in GetSplitValueList(HelpStringItem.String, '\n'):
                                          HelpString += '# ' + HelpLine + '\n'
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 1 hr to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 802..804

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 38.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              if (Statement, SortedArch) in GuidDict:
                                  PreviousComment = GuidDict[Statement, SortedArch]
                                  Comment = PreviousComment +  Comment     
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 1 hr to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 633..635
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 719..721

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 38.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              if (Statement, SortedArch) in Dict:
                                  PreviousComment = Dict[Statement, SortedArch]
                                  Comment = PreviousComment + Comment
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 1 hr to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 563..565
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 719..721

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 38.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  for HelpStringItem in HelpTextList:
                                      for HelpLine in GetSplitValueList(HelpStringItem.String, '\n'):
                                          HelpString += '# ' + HelpLine + '\n'            
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 1 hr to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 759..761

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 38.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  if (Statement, SortedArch) in Dict:
                                      PreviousComment = Dict[Statement, SortedArch]
                                      Comment = PreviousComment + Comment
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 1 hr to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 563..565
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 633..635

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 38.

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

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

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

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

                      Refactorings

                      Further Reading

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

                          if ModuleObject.GetModuleType():
                              Statement = '%s = %s' % (DT.TAB_INF_DEFINES_MODULE_TYPE, ModuleObject.GetModuleType())
                              SpecialStatementList.append(Statement)
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 3 other locations - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 149..151
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 152..155
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 156..158

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 37.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  Statement = HelpString[:-3] + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue + ' | ' + PcdOffset
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 814..814

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 37.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  Statement = HelpString[:-3] + TokenSpaceName + '.' + PcdCName + ' | ' + PcdValue
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 771..771

                      Duplicated Code

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

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

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

                          if ModuleObject.GetPcdIsDriver():
                              Statement = '%s = %s' % (DT.TAB_INF_DEFINES_PCD_IS_DRIVER, ModuleObject.GetPcdIsDriver())
                              SpecialStatementList.append(Statement)
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 3 other locations - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 146..148
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 152..155
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 156..158

                      Duplicated Code

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

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

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

                          if ModuleObject.GetUefiSpecificationVersion():
                              Statement = '%s = %s' % (DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION, \
                                                       ModuleObject.GetUefiSpecificationVersion())
                              SpecialStatementList.append(Statement)
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 3 other locations - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 146..148
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 149..151
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 156..158

                      Duplicated Code

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

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

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

                          if ModuleObject.GetPiSpecificationVersion():
                              Statement = '%s = %s' % (DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION, ModuleObject.GetPiSpecificationVersion())
                              SpecialStatementList.append(Statement)        
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 3 other locations - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 146..148
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 149..151
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 152..155

                      Duplicated Code

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

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

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 UserExtension.GetIdentifier():
                                      CommonPreFix += '.' + '"' + UserExtension.GetIdentifier() + '"'
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 55 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py on lines 329..330

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 37.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  for Index in xrange(0, len(ArchList)):
                                      ArchList[Index] = ConvertArchForInstall(ArchList[Index])
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 50 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 398..399
                      BaseTools/Source/Python/UPT/Library/Parsing.py on lines 967..968

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 36.

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

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

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

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

                      Refactorings

                      Further Reading

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

                              for Index in xrange(0, len(ArchList)):
                                  ArchList[Index] = ConvertArchForInstall(ArchList[Index])
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 2 other locations - About 50 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 229..230
                      BaseTools/Source/Python/UPT/Library/Parsing.py on lines 967..968

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 36.

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

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

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

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

                      Refactorings

                      Further Reading

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

                          if BaseName.startswith('.') or BaseName.startswith('-'):
                              BaseName = '_' + BaseName
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py and 1 other location - About 30 mins to fix
                      BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py on lines 243..244

                      Duplicated Code

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

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

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