hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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

                    {
                        reps[0] = opt.Backs1;
                        reps[1] = opt.Backs0;
                        reps[2] = opt.Backs2;
                        reps[3] = opt.Backs3;
vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java on lines 780..785
vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java on lines 773..778
vector-uefi/insyde/7zip/Java/SevenZip/Compression/LZMA/Encoder.java on lines 759..764

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

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

        if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
Severity: Major
Found in BaseTools/Source/Python/Workspace/WorkspaceCommon.py and 2 other locations - About 45 mins to fix
BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1586..1586
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 1088..1088

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

            if len(ItemList) > 1:
                S1 = ItemList[1].upper()
            else:
                S1 = 'COMMON'
Severity: Major
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 6 other locations - About 45 mins to fix
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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

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

            if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
Severity: Major
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py and 2 other locations - About 45 mins to fix
BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1586..1586
BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 203..203

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

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

            if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
Severity: Major
Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 45 mins to fix
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 1088..1088
BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 203..203

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

            if len(ItemList) > 2:
                S2 = ItemList[2].upper()
            else:
                S2 = 'COMMON'
Severity: Major
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 6 other locations - About 45 mins to fix
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714

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

            if len(ItemList) > 1:
                S1 = ItemList[1].upper()
            else:
                S1 = 'COMMON'
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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

            if len(ItemList) > 2:
                S2 = ItemList[2].upper()
            else:
                S2 = 'COMMON'
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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

            if len(ItemList) > 2:
                S2 = ItemList[2].upper()
            else:
                S2 = 'COMMON'
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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 Module.GetPpiList():
            Tmp = PpiXml('Module')
            GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Ppi'))
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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/PackageSurfaceAreaXml.py on lines 350..353
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.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 7 locations. Consider refactoring.
Open

            if len(ItemList) > 1:
                S1 = ItemList[1].upper()
            else:
                S1 = 'COMMON'
Severity: Major
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 6 other locations - About 45 mins to fix
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1603..1606
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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

            if len(ItemList) > 1:
                S1 = ItemList[1].upper()
            else:
                S1 = 'COMMON'
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 290..293
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 296..299
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1609..1612
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 300..303
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1711..1714
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1717..1720

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 Module.GetGuidList():
            Tmp = GuidXml('Module')
            GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'GuidCName'))
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py and 5 other locations - About 45 mins to fix
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
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.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 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 Module.GetProtocolList():
            Tmp = ProtocolXml('Module')
            GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Protocol'))
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.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 884..886
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 350..353
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 5 locations. Consider refactoring.
Open

    def testNormalCase5(self):
        CommentLines = 'coment line 1\n coment line 2\n'
        Result = GenGenericCommentF(CommentLines)
        Expected = '# coment line 1\n# coment line 2\n'
        self.assertEqual(Result, Expected)          
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1387..1391
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1393..1397
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1399..1403
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1405..1409

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

    def testNormalCase3(self):
        CommentLines = '\n\n\n'
        Result = GenGenericCommentF(CommentLines)
        Expected = '#\n#\n#\n'
        self.assertEqual(Result, Expected)  
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1387..1391
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1393..1397
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1405..1409
BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py on lines 1411..1415

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

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

    try:
        XmlFile = open(FileName)
        Dom = xml.dom.minidom.parse(XmlFile)
        XmlFile.close()
        return Dom
Severity: Minor
Found in BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py and 1 other location - About 45 mins to fix
BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py on lines 211..215

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

Severity
Category
Status
Source
Language