hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py

Summary

Maintainability
F
5 days
Test Coverage

Function FromXml has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    def FromXml(self, Item, Key):
        if Key:
            pass
        #
        # Create a package object
Severity: Minor
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.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 ToXml has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def ToXml(self, Package):
        if self.Package:
            pass
        #
        # Create PackageSurfaceArea node
Severity: Minor
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.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 ToXml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def ToXml(self, Package):
        if self.Package:
            pass
        #
        # Create PackageSurfaceArea node
Severity: Minor
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py - About 1 hr to fix

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

        def __str__(self):
            Str = "HeaderFile = %s\n\t%s" % (self.HeaderFile, self.CommonDefines)
            for Item in self.HelpText:
                Str = Str + "\n\t" + str(Item)
            return Str
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 3 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 368..372
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 413..417
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 459..463

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 56.

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

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

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

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

    Refactorings

    Further Reading

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations/Entry'):
                Tmp = ProtocolXml('Package')
                GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
                Package.SetProtocolList(Package.GetProtocolList() + [GuidProtocolPpi])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 741..744
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 752..755
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 763..766
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 217..220
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 241..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 53.

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

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

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

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

    Refactorings

    Further Reading

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/GuidDeclarations/Entry'):
                Tmp = GuidXml('Package')
                GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
                Package.SetGuidList(Package.GetGuidList() + [GuidProtocolPpi])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 741..744
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 752..755
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 763..766
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 229..232
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 241..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 53.

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

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

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

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

    Refactorings

    Further Reading

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/PpiDeclarations/Entry'):
                Tmp = PpiXml('Package')
                GuidProtocolPpi = Tmp.FromXml(SubItem, 'Entry')
                Package.SetPpiList(Package.GetPpiList() + [GuidProtocolPpi])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 741..744
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 752..755
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 763..766
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 217..220
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 229..232

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

            for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
                HelpTextObj = HelpTextXml()
                HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
                self.HelpText.append(HelpTextObj)
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

            for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
                HelpTextObj = HelpTextXml()
                HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
                self.HelpText.append(HelpTextObj)
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations/LibraryClass'):
                Tmp = LibraryClassXml()
                LibraryClass = Tmp.FromXml(SubItem, 'LibraryClass')
                Package.SetLibraryClassList(Package.GetLibraryClassList() + [LibraryClass])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 655..658
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 694..697
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 706..709
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 718..721
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 729..732
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 774..777
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 786..789
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 192..195
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 205..208
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 253..256

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

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes/IndustryStandardHeader'):
                Tmp = IndustryStandardHeaderXml()
                Include = Tmp.FromXml(SubItem, 'IndustryStandardHeader')
                Package.SetStandardIncludeFileList(Package.GetStandardIncludeFileList() + [Include])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 655..658
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 694..697
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 706..709
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 718..721
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 729..732
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 774..777
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 786..789
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 180..183
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 205..208
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 253..256

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

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/PackageIncludes/PackageHeader'):
                Tmp = PackageIncludeHeaderXml()
                Include = Tmp.FromXml(SubItem, 'PackageHeader')
                Package.SetPackageIncludeFileList(Package.GetPackageIncludeFileList() + [Include])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 655..658
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 694..697
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 706..709
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 718..721
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 729..732
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 774..777
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 786..789
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 180..183
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 192..195
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 253..256

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

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/PcdDeclarations/PcdEntry'):
                Tmp = PcdEntryXml()
                PcdEntry = Tmp.FromXml2(SubItem, 'PcdEntry')
                Package.SetPcdList(Package.GetPcdList() + [PcdEntry])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 655..658
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 694..697
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 706..709
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 718..721
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 729..732
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 774..777
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 786..789
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 180..183
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 192..195
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 205..208

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

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

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

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

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

    Refactorings

    Further Reading

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

        def __str__(self):
            Str = "HeaderFile = %s" % (self.HeaderFile)
            for Item in self.HelpText:
                Str = Str + "\n\t" + str(Item)
            return Str
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 1 other location - About 2 hrs to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 325..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 51.

    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

            if Package.GetUserExtensionList():
                for UserExtension in Package.GetUserExtensionList():
                    Tmp = UserExtensionsXml()
                    DomPackage.appendChild(Tmp.ToXml(UserExtension, 'UserExtensions'))
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 4 other locations - About 1 hr to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 908..911
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 916..919
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 924..927
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 938..941

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

            for SubItem in XmlList(Item, '/PackageSurfaceArea/PcdRelationshipChecks/PcdCheck'):
                Tmp = PcdCheckXml()
                PcdCheck = Tmp.FromXml(SubItem, 'PcdCheck')
                Package.PcdChecks.append(PcdCheck)
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 1 other location - About 1 hr to fix
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 291..294

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

            for Item in XmlList(Item, '/PackageSurfaceArea/UserExtensions'):
                Tmp = UserExtensionsXml()
                UserExtension = Tmp.FromXml(Item, 'UserExtensions')
                Package.UserExtensionList.append(UserExtension)
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 1 other location - About 1 hr to fix
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 265..268

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

            for GuidProtocolPpi in Package.GetGuidList():
                Tmp = GuidXml('Package')
                GuidProtocolPpiNode.appendChild(Tmp.ToXml\
                                                (GuidProtocolPpi, 'Entry'))
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 45 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 866..868
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 875..877
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 884..886
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 360..363
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 369..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 35.

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

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

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

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

    Refactorings

    Further Reading

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

            for GuidProtocolPpi in Package.GetPpiList():
                Tmp = PpiXml('Package')
                GuidProtocolPpiNode.appendChild\
                (Tmp.ToXml(GuidProtocolPpi, 'Entry'))
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 45 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 866..868
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 875..877
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 884..886
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 350..353
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 360..363

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 35.

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

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

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

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

    Refactorings

    Further Reading

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

            for GuidProtocolPpi in Package.GetProtocolList():
                Tmp = ProtocolXml('Package')
                GuidProtocolPpiNode.appendChild\
                (Tmp.ToXml(GuidProtocolPpi, 'Entry'))
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 5 other locations - About 45 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 866..868
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 875..877
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 884..886
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 350..353
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 369..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 35.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations') and not \
               XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations/Entry'):
                Package.SetProtocolList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/GuidDeclarations') and not \
               XmlList(Item, '/PackageSurfaceArea/GuidDeclarations/Entry'):
                Package.SetGuidList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes') and \
            not XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes/IndustryStandardHeader'):
                Package.SetStandardIncludeFileList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/PackageIncludes') and not \
               XmlList(Item, '/PackageSurfaceArea/PackageIncludes/PackageHeader'):
                Package.SetPackageIncludeFileList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/PcdDeclarations') and not \
               XmlList(Item, '/PackageSurfaceArea/PcdDeclarations/PcdEntry'):
                Package.SetPcdList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations') and \
               not XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations/LibraryClass'):
                Package.SetLibraryClassList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 246..248
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            if XmlList(Item, '/PackageSurfaceArea/PpiDeclarations') and not \
               XmlList(Item, '/PackageSurfaceArea/PpiDeclarations/Entry'):
                Package.SetPpiList([None])
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 15 other locations - About 40 mins to fix
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 699..701
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 711..713
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 723..725
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 734..736
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 746..747
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 757..758
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 768..769
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 779..780
    BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 791..793
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 185..187
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 197..199
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 210..212
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 222..224
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 234..236
    BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 258..260

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

            for Item in PackageIncludeHeader.GetHelpTextList():
                Tmp = HelpTextXml()
                NodeList.append(Tmp.ToXml(Item))
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 30 mins to fix
    BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 802..804
    BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 823..825
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 99..101
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 166..168
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 225..227
    BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 280..282
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 283..285
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 314..316
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 345..347
    BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 377..379

    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