hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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

        if len(TokenList) == 2:
            self._ValueList[2] = TokenList[1]
Severity: Major
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 3 other locations - About 35 mins to fix
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 984..985
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1042..1043
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1151..1152

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

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

        if len(TokenList) == 2:                 # value
            self._ValueList[2] = TokenList[1]
Severity: Major
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 3 other locations - About 35 mins to fix
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 984..985
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1042..1043
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1078..1079

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

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 Close(self):
        self.Conn.commit()
        self.Cur.close()
        self.Conn.close()
Severity: Minor
Found in BaseTools/Source/Python/Common/Database.py and 2 other locations - About 35 mins to fix
BaseTools/Source/Python/Ecc/Database.py on lines 147..157
BaseTools/Source/Python/Eot/Database.py on lines 153..159

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

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

        if len(TokenList) == 2:
            self._ValueList[2] = TokenList[1]
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py on lines 1042..1043
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1078..1079
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1151..1152

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

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 Close(self):
        # Commit to file
        self.Conn.commit()

        # Close connection and cursor
Severity: Minor
Found in BaseTools/Source/Python/Eot/Database.py and 2 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/Database.py on lines 100..103
BaseTools/Source/Python/Ecc/Database.py on lines 147..157

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

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 Close(self):
        #
        # Commit to file
        #
        self.Conn.commit()
Severity: Minor
Found in BaseTools/Source/Python/Ecc/Database.py and 2 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/Database.py on lines 100..103
BaseTools/Source/Python/Eot/Database.py on lines 153..159

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

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

                for Item in Module.Protocols:
                    if Arch in Item.SupArchList:
                        Pb.Protocols.append(Item.CName)
Severity: Major
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py and 6 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 684..686
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 808..810
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 815..817
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 822..824
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 829..831
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 882..884

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

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

                for Item in Module.Includes:
                    if Arch in Item.SupArchList:
                        Pb.Includes.append(Item.FilePath)
Severity: Major
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py and 6 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 684..686
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 801..803
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 808..810
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 815..817
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 829..831
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 882..884

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

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

    def testCase7(self):
        Line = 'Copyright (c) line'
        Result = _IsCopyrightLine(Line)
        self.failIf(not Result)
Severity: Major
Found in BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py and 5 other locations - About 35 mins to fix
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 852..855
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 860..863
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 876..879
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 884..887
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 908..911

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

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

                for Item in Module.PackageDependencies:
                    if Arch in Item.SupArchList:
                        Pb.Packages.append(Item.FilePath)
Severity: Major
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py and 6 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 684..686
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 801..803
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 808..810
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 815..817
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 822..824
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 882..884

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

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

0x18C9 : { 0x1011 : "Video processor",
           0x1012 : "Video processor",
           0x1013 : "Video processor",
           0x1014 : "Video processor",
           0x1015 : "Video processor",
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/pcidb.py and 5 other locations - About 35 mins to fix
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 3949..3963
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 4434..4448
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 6840..6854
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 7370..7384
vector-uefi/fd/tool/chipsec/hal/uefi_common.py on lines 319..319

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

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

0x10DC : { 0x0001 : "PCI-SCI  PMC  mezzanine",
           0x0002 : "SCI bridge  on PCI 5 Volt card",
           0x0004 : "ALTERA STRATIX",
           0x0010 : "Simple PMC/PCI to S-LINK interface",
           0x0011 : "Simple S-LINK to PMC/PCI interface",
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/pcidb.py and 5 other locations - About 35 mins to fix
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 3949..3963
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 6840..6854
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 7370..7384
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 8264..8278
vector-uefi/fd/tool/chipsec/hal/uefi_common.py on lines 319..319

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

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

    def testCase4(self):
        Line = 'this is Copyright( line'
        Result = _IsCopyrightLine(Line)
        self.failIf(not Result)
Severity: Major
Found in BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py and 5 other locations - About 35 mins to fix
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 852..855
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 860..863
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 884..887
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 900..903
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 908..911

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

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

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

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

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

Refactorings

Further Reading

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

                    for SubPcd in SubPcdSet1:
                        Pcd.append([DataType.TAB_PCDS_FIXED_AT_BUILD, SubPcd[0], SubPcd[3]])
Severity: Major
Found in BaseTools/Source/Python/Common/DscClassObject.py and 4 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/DscClassObject.py on lines 785..786
BaseTools/Source/Python/Common/DscClassObject.py on lines 787..788
BaseTools/Source/Python/Common/DscClassObject.py on lines 789..790
BaseTools/Source/Python/Common/DscClassObject.py on lines 791..792

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

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

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

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

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

Refactorings

Further Reading

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

                    for SubPcd in SubPcdSet2:
                        Pcd.append([DataType.TAB_PCDS_PATCHABLE_IN_MODULE, SubPcd[0], SubPcd[3]])
Severity: Major
Found in BaseTools/Source/Python/Common/DscClassObject.py and 4 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/DscClassObject.py on lines 783..784
BaseTools/Source/Python/Common/DscClassObject.py on lines 787..788
BaseTools/Source/Python/Common/DscClassObject.py on lines 789..790
BaseTools/Source/Python/Common/DscClassObject.py on lines 791..792

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

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

        try:
            self._ZipFile = zipfile.ZipFile(FileName, Mode, \
                                            zipfile.ZIP_DEFLATED)
            self._Files = {}
            for Filename in self._ZipFile.namelist():
Severity: Major
Found in BaseTools/Source/Python/UPT/Core/PackageFile.py and 4 other locations - About 35 mins to fix
BaseTools/Source/Python/UPT/Core/PackageFile.py on lines 113..122
BaseTools/Source/Python/UPT/Core/PackageFile.py on lines 124..129
BaseTools/Source/Python/UPT/Core/PackageFile.py on lines 214..228
BaseTools/Source/Python/UPT/Core/PackageFile.py on lines 236..240

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

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

    def testCase8(self):
        Line = ' Copyright (c) line'
        Result = _IsCopyrightLine(Line)
        self.failIf(not Result)
Severity: Major
Found in BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py and 5 other locations - About 35 mins to fix
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 852..855
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 860..863
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 876..879
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 884..887
BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py on lines 900..903

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

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

0x12C7 : { 0x0546 : "D120JCT-LS Card",
           0x0561 : "BRI/2 Type Card (Voice Driver)",
           0x0647 : "D/240JCT-T1 Card",
           0x0648 : "D/300JCT-E1 Card",
           0x0649 : "D/300JCT-E1 Card",
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/pcidb.py and 5 other locations - About 35 mins to fix
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 3949..3963
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 4434..4448
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 7370..7384
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 8264..8278
vector-uefi/fd/tool/chipsec/hal/uefi_common.py on lines 319..319

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

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

0x144A : { 0x348A : "Low-profile High-Performance IEEE488 GPIB Interface Card for PCI Bus",
           0x7230 : "",
           0x7248 : "PLX PCI9052",
           0x7250 : "PLX PCI9052",
           0x7256 : "PCI-7256 16-CH Latching Relay & 16-CH Isolated Digital Input Card",
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/pcidb.py and 5 other locations - About 35 mins to fix
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 3949..3963
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 4434..4448
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 6840..6854
vector-uefi/fd/tool/chipsec/hal/pcidb.py on lines 8264..8278
vector-uefi/fd/tool/chipsec/hal/uefi_common.py on lines 319..319

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

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

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

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

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

Refactorings

Further Reading

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

                    for SubPcd in SubPcdSet3:
                        Pcd.append([DataType.TAB_PCDS_FEATURE_FLAG, SubPcd[0], SubPcd[3]])
Severity: Major
Found in BaseTools/Source/Python/Common/DscClassObject.py and 4 other locations - About 35 mins to fix
BaseTools/Source/Python/Common/DscClassObject.py on lines 783..784
BaseTools/Source/Python/Common/DscClassObject.py on lines 785..786
BaseTools/Source/Python/Common/DscClassObject.py on lines 789..790
BaseTools/Source/Python/Common/DscClassObject.py on lines 791..792

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

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