hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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/ModuleSurfaceAreaXml.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/PackageSurfaceAreaXml.py on lines 51..54
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

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

        for SubItem in XmlList(Item, '/ModuleSurfaceArea/SourceFiles/Filename'):
            Tmp = SourceFileXml()
            SourceFile = Tmp.FromXml(SubItem, 'Filename')
            Module.SetSourceFileList(Module.GetSourceFileList() + [SourceFile])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 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
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, '/ModuleSurfaceArea/LibraryClassDefinitions/LibraryClass'):
            Tmp = LibraryClassXml()
            LibraryClass = Tmp.FromXml(SubItem, 'LibraryClass')
            Module.SetLibraryClassList(Module.GetLibraryClassList() + [LibraryClass])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 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
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 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

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

    def _Unpack(m):
        # keep header in this Image object
        m.empty()
        m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
        return len(m)
Severity: Major
Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Eot/FvImage.py on lines 772..776
BaseTools/Source/Python/Eot/FvImage.py on lines 814..818

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, '/ModuleSurfaceArea/PackageDependencies/Package'):
            Tmp = PackageXml()
            PackageDependency = Tmp.FromXml(SubItem, 'Package')
            Module.SetPackageDependencyList(Module.GetPackageDependencyList() + [PackageDependency])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 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
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, '/ModuleSurfaceArea/Externs/Extern'):
            Tmp = ExternXml()
            Extern = Tmp.FromXml(SubItem, 'Extern')
            Module.SetExternList(Module.GetExternList() + [Extern])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 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
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

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

    def _Unpack(m):
        # keep header in this Image object
        m.empty()
        m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
        return len(m)
Severity: Major
Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Eot/FvImage.py on lines 625..629
BaseTools/Source/Python/Eot/FvImage.py on lines 814..818

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

    def _Unpack(m):
        # keep header in this Image object
        m.empty()
        m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
        return len(m)
Severity: Major
Found in BaseTools/Source/Python/Eot/FvImage.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Eot/FvImage.py on lines 625..629
BaseTools/Source/Python/Eot/FvImage.py on lines 772..776

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

    for Result in ResultSet:
        FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
Severity: Major
Found in BaseTools/Source/Python/Ecc/c.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Ecc/c.py on lines 1916..1917
BaseTools/Source/Python/Ecc/c.py on lines 2074..2075

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, '/ModuleSurfaceArea/PcdCoded/PcdEntry'):
                Tmp = PcdEntryXml()
                PcdEntry = Tmp.FromXml3(SubItem, 'PcdEntry')
                Module.SetPcdList(Module.GetPcdList() + [PcdEntry])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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/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
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 Item in XmlList(Item, '/ModuleSurfaceArea/UserExtensions'):
            Tmp = UserExtensionsXml()
            UserExtension = Tmp.FromXml(Item, 'UserExtensions')
            Module.SetUserExtensionList(Module.GetUserExtensionList() + [UserExtension])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
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
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, '/ModuleSurfaceArea/BinaryFiles/BinaryFile'):
            Tmp = BinaryFileXml()
            BinaryFile = Tmp.FromXml(SubItem, 'BinaryFile')
            Module.SetBinaryFileList(Module.GetBinaryFileList() + [BinaryFile])
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 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
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

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

    for Result in ResultSet:
        FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
Severity: Major
Found in BaseTools/Source/Python/Ecc/c.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Ecc/c.py on lines 1995..1996
BaseTools/Source/Python/Ecc/c.py on lines 2074..2075

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

    for Result in ResultSet:
        FL.append([Result[0], Result[1], Result[2], Result[3], Result[4]])
Severity: Major
Found in BaseTools/Source/Python/Ecc/c.py and 2 other locations - About 2 hrs to fix
BaseTools/Source/Python/Ecc/c.py on lines 1916..1917
BaseTools/Source/Python/Ecc/c.py on lines 1995..1996

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

            if [S1, S2, self.DataType[self._SectionName]] not in self._Scope:
                self._Scope.append([S1, S2, self.DataType[self._SectionName]])
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1721..1722

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

        try:
            fsock = open(FileName, "rb", 0)
            try:
                self.FileLinesList = fsock.readlines()
            finally:
Severity: Major
Found in BaseTools/Source/Python/GenFds/FdfParser.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/GenFds/FdfParser.py on lines 147..155

Duplicated Code

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

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

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

Tuning

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

Severity
Category
Status
Source
Language