hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py

Summary

Maintainability
F
3 wks
Test Coverage

Function SetBinary has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

    def SetBinary(self, UiInf=None, Ver=None, CommonBinary=None, ArchList=None):

        __SupArchList = []
        for ArchItem in ArchList:
            #
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.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 CheckVer has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
Open

    def CheckVer(self, Ver, __SupArchList):
        #
        # Check Ver
        #
        for VerItem in Ver:
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.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 ParseCommonBinary has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

    def ParseCommonBinary(self, CommonBinary, __SupArchList):
        #
        # Check common binary definitions
        # Type | FileName | Target | Family | TagName | FeatureFlagExp
        #
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.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

File InfBinaryObject.py has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define class objects of INF file [Binaries] section. 
# It will consumed by InfParser. 
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
Severity: Minor
Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 5 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                            if IsValidPath(UiContent[1], GlobalData.gINF_MODULE_DIR):
                                IsValidFileFlag = True
                            else:
                                Logger.Error("InfParser",
                                             ToolError.FORMAT_INVALID,
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if IsValidFileFlag:
                                  UiContent[0] = ConvPathFromAbsToRel(UiContent[0], GlobalData.gINF_MODULE_DIR)
                                  InfBianryUiItemObj.SetFileName(UiContent[1])
                          if len(UiContent) >= 3:
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if not FeatureFlagRtv[0]:
                                    Logger.Error("InfParser",
                                                 ToolError.FORMAT_INVALID,
                                                 ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
                                                 File=UiCurrentLine.GetFileName(),
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for VerItemObjArch in __SupArchList:
                                      if ItemArch == VerItemObjArch:
                                          #
                                          # ST.ERR_INF_PARSER_ITEM_DUPLICATE
                                          #
          Severity: Major
          Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if not (ValidFile(FullFileName) or ValidFile(UiContent[1])):
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (UiContent[1]),
                                                     File=UiCurrentLine.GetFileName(),
            Severity: Major
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if self.Binaries.has_key((InfBianryUiItemObj)):
                                          BinariesList = self.Binaries[InfBianryUiItemObj]
                                          BinariesList.append((InfBianryUiItemObj, UiComment))
                                          self.Binaries[InfBianryUiItemObj] = BinariesList
                                      else:
              Severity: Major
              Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if UiContent[0] != 'UI':
                                            Logger.Error("InfParser",
                                                         ToolError.FORMAT_INVALID,
                                                         ST.ERR_INF_PARSER_BINARY_VER_TYPE % ('UI'),
                                                         File=UiCurrentLine.GetFileName(),
                Severity: Major
                Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if UiContent[3].strip() == '':
                                              Logger.Error("InfParser",
                                                           ToolError.FORMAT_INVALID,
                                                           ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
                                                           File=UiCurrentLine.GetFileName(),
                  Severity: Major
                  Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

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

                    class InfBianryItem():
                        def __init__(self):
                            self.FileName = ''
                            self.Target = ''
                            self.FeatureFlagExp = ''
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py and 1 other location - About 1 day to fix
                    BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py on lines 44..81

                    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 200.

                    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 len(VerContent) == 4:
                                    if VerContent[3].strip() == '':
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 398..420
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 553..572

                    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 168.

                    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 len(ItemContent) == 6:
                                    #
                                    # Add FeatureFlagExp
                                    #
                                    if ItemContent[5].strip() == '':
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 216..236
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 553..572

                    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 168.

                    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 len(UiContent) == 4:
                                            if UiContent[3].strip() == '':
                                                Logger.Error("InfParser",
                                                             ToolError.FORMAT_INVALID,
                                                             ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 216..236
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 398..420

                    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 168.

                    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 InfBianryUiItemObj != None:
                                            if self.Binaries.has_key((InfBianryUiItemObj)):
                                                BinariesList = self.Binaries[InfBianryUiItemObj]
                                                BinariesList.append((InfBianryUiItemObj, UiComment))
                                                self.Binaries[InfBianryUiItemObj] = BinariesList
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 268..276
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 453..461

                    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

                                if InfBianryVerItemObj != None:
                                    if self.Binaries.has_key((InfBianryVerItemObj)):
                                        BinariesList = self.Binaries[InfBianryVerItemObj]
                                        BinariesList.append((InfBianryVerItemObj, VerComment))
                                        self.Binaries[InfBianryVerItemObj] = BinariesList
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 453..461
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 604..612

                    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

                                if InfBianryCommonItemObj != None:
                                    if self.Binaries.has_key((InfBianryCommonItemObj)):
                                        BinariesList = self.Binaries[InfBianryCommonItemObj]
                                        BinariesList.append((InfBianryCommonItemObj, ItemComment))
                                        self.Binaries[InfBianryCommonItemObj] = BinariesList
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 268..276
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 604..612

                    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 5 locations. Consider refactoring.
                    Open

                                for Item in self.Binaries:
                                    if Item.GetFileName() == InfBianryVerItemObj.GetFileName():
                                        ItemSupArchList = Item.GetSupArchList()
                                        for ItemArch in ItemSupArchList:
                                            for VerItemObjArch in __SupArchList:
                    BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py on lines 321..332
                    BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py on lines 158..168
                    BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py on lines 314..324
                    BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py on lines 283..293

                    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 88.

                    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 not (ValidFile(FullFileName) or ValidFile(VerContent[1])):
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (VerContent[1]),
                                                     File=VerCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 350..356
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 525..531

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 76.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                            if not (ValidFile(FullFileName) or ValidFile(UiContent[1])):
                                                Logger.Error("InfParser",
                                                             ToolError.FORMAT_INVALID,
                                                             ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (UiContent[1]),
                                                             File=UiCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 187..193
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 350..356

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 76.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    if not (ValidFile(FullFileName) or ValidFile(ItemContent[1])):
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (ItemContent[1]),
                                                     File=CurrentLineOfItem.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 187..193
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 525..531

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 76.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    if IsValidPath(VerContent[1], GlobalData.gINF_MODULE_DIR):
                                        IsValidFileFlag = True
                                    else:
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 360..369
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 535..544

                    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 75.

                    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 IsValidPath(ItemContent[1], GlobalData.gINF_MODULE_DIR):
                                        IsValidFileFlag = True
                                    else:
                                        Logger.Error("InfParser",
                                                    ToolError.FORMAT_INVALID,
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 197..206
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 535..544

                    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 75.

                    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 IsValidPath(UiContent[1], GlobalData.gINF_MODULE_DIR):
                                                IsValidFileFlag = True
                                            else:
                                                Logger.Error("InfParser",
                                                             ToolError.FORMAT_INVALID,
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 197..206
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 360..369

                    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 75.

                    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 len(VerContent) > 4:
                                    Logger.Error("InfParser",
                                                 ToolError.FORMAT_INVALID,
                                                 ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (VerContent[0], 4),
                                                 File=VerCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 302..309
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 498..505

                    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

                                        if len(UiContent) > 4:
                                            Logger.Error("InfParser",
                                                         ToolError.FORMAT_INVALID,
                                                         ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (UiContent[0], 4),
                                                         File=UiCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 158..165
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 302..309

                    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

                                if len(ItemContent) > 6:
                                    Logger.Error("InfParser",
                                                 ToolError.FORMAT_INVALID,
                                                 ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (ItemContent[0], 6),
                                                 File=CurrentLineOfItem.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 158..165
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 498..505

                    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

                                if len(ItemContent) < 2:
                                    Logger.Error("InfParser",
                                                 ToolError.FORMAT_INVALID,
                                                 ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (ItemContent[0]),
                                                 File=CurrentLineOfItem.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 150..157
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 489..496

                    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 66.

                    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 len(UiContent) < 2:
                                            Logger.Error("InfParser",
                                                         ToolError.FORMAT_INVALID,
                                                         ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (UiContent[0]),
                                                         File=UiCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 150..157
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 294..301

                    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 66.

                    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 len(VerContent) < 2:
                                    Logger.Error("InfParser",
                                                 ToolError.FORMAT_INVALID,
                                                 ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (VerContent[0]),
                                                 File=VerCurrentLine.GetFileName(),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 294..301
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 489..496

                    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 66.

                    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

                    class InfBianryVerItem(InfBianryItem, CurrentLine):
                        def __init__(self):
                            InfBianryItem.__init__(self)
                            CurrentLine.__init__(self)
                            self.VerTypeName = ''
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py and 1 other location - About 2 hrs to fix
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 86..95

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 61.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    class InfBianryUiItem(InfBianryItem, CurrentLine):
                        def __init__(self):
                            InfBianryItem.__init__(self)
                            CurrentLine.__init__(self)
                            self.UiTypeName = ''
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py and 1 other location - About 2 hrs to fix
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 75..84

                    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 2 locations. Consider refactoring.
                    Open

                                    if BinaryFileType not in DT.BINARY_FILE_TYPE_LIST:
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE % \
                                                     (DT.BINARY_FILE_TYPE_LIST.__str__()),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 334..341

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 49.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    if BinaryFileType == 'LIB' or BinaryFileType == 'UEFI_APP':
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
                                                     ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE % \
                                                     (DT.BINARY_FILE_TYPE_LIST.__str__()),
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 322..329

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 49.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                    if IsValidFileFlag:
                                        VerContent[0] = ConvPathFromAbsToRel(VerContent[0],
                                                                GlobalData.gINF_MODULE_DIR)
                                        InfBianryVerItemObj.SetFileName(VerContent[1])
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 370..372
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 545..547

                    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 43.

                    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 IsValidFileFlag:
                                                UiContent[0] = ConvPathFromAbsToRel(UiContent[0], GlobalData.gINF_MODULE_DIR)
                                                InfBianryUiItemObj.SetFileName(UiContent[1])
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 207..210
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 370..372

                    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 43.

                    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 IsValidFileFlag:
                                        ItemContent[0] = ConvPathFromAbsToRel(ItemContent[0], GlobalData.gINF_MODULE_DIR)
                                        InfBianryCommonItemObj.SetFileName(ItemContent[1])
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 207..210
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 545..547

                    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 43.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            for ArchItem in ArchList:
                                #
                                # Validate Arch
                                #            
                                if (ArchItem == '' or ArchItem == None):
                    BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py on lines 232..239
                    BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py on lines 74..80
                    BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py on lines 212..218
                    BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py on lines 202..208
                    BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py on lines 210..216

                    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 41.

                    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

                                    FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
                                                                                                  VerContent[1])))
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 348..349
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 523..524
                    BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py on lines 106..106

                    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

                                            FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
                                                                                                          UiContent[1])))
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 185..186
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 348..349
                    BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py on lines 106..106

                    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

                                    FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
                                                                                                  ItemContent[1])))
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 185..186
                    BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py on lines 523..524
                    BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py on lines 106..106

                    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

                    There are no issues that match your filters.

                    Category
                    Status