hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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

SECTION_NAMES = {0x00: 'S_ALL', 0x01: 'S_COMPRESSION', 0x02: 'S_GUID_DEFINED', 0x10: 'S_PE32', 0x11: 'S_PIC', 0x12: 'S_TE', 0x13: 'S_DXE_DEPEX', 0x14: 'S_VERSION', 0x15: 'S_USER_INTERFACE', 0x16: 'S_COMPATIBILITY16', 0x17: 'S_FV_IMAGE', 0x18: 'S_FREEFORM_SUBTYPE_GUID', 0x19: 'S_RAW', 0x1B: 'S_PEI_DEPEX', 0x1C: 'S_SMM_DEPEX'}
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/uefi_common.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/pcidb.py on lines 8264..8278

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 Package.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 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 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.Ppis:
                    if Arch in Item.SupArchList:
                        Pb.Ppis.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 801..803
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.Libraries:
                    if Arch in Item.SupArchList:
                        Pb.Libraries.append(Item.Library)
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 829..831

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.Guids:
                    if Arch in Item.SupArchList:
                        Pb.Ppis.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 801..803
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 808..810
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 6 locations. Consider refactoring.
Open

    def testCase2(self):
        Line = 'this is a 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 876..879
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

        try:
            self._ZipFile.writestr(ArcName, Data)
        except BaseException, Xstr:
            Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,
                            ExtraData="%s (%s)" % (ArcName, str(Xstr)))
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 47..55
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

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 testCase5(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 876..879
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 6 locations. Consider refactoring.
Open

    def testCase1(self):
        Line = 'this is a 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 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
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 6 locations. Consider refactoring.
Open

0x108D : { 0x0001 : "Token-Ring 16/4 PCI Adapter",
           0x0002 : "Fastload 16/4 PCI/III Token Ring Adapter",
           0x0004 : "RapidFire Token Ring 16/4 Adapter",
           0x0005 : "GoCard Token Ring 16/4 Adapter",
           0x0006 : "RapidFire Token Ring 100 Adapter",
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 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/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 SubPcdSet5:
                        Pcd.append([DataType.TAB_PCDS_DYNAMIC, 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 787..788
BaseTools/Source/Python/Common/DscClassObject.py on lines 789..790

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:
            #
            # avoid packing same file multiple times
            #
            if platform.system() != 'Windows':
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 47..55
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 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 5 locations. Consider refactoring.
Open

                    for SubPcd in SubPcdSet4:
                        Pcd.append([DataType.TAB_PCDS_DYNAMIC_EX, 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 787..788
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

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

    return not (Value and Key in ValidateMap and not ValidateMap[Key](Value))
Severity: Minor
Found in BaseTools/Source/Python/UPT/Xml/IniToXml.py and 1 other location - About 35 mins to fix
BaseTools/Source/Python/UPT/Xml/IniToXml.py on lines 289..289

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:
            ToFile.write(FileContent)
            ToFile.close()
        except BaseException, Xstr:
            Logger.Error("PackagingTool", FILE_WRITE_FAILURE, 
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 47..55
BaseTools/Source/Python/UPT/Core/PackageFile.py on lines 113..122
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 4 locations. Consider refactoring.
Open

    if "EDK_SOURCE" not in os.environ:
        os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
Severity: Major
Found in BaseTools/Source/Python/build/build.py and 3 other locations - About 35 mins to fix
BaseTools/Source/Python/Ecc/Ecc.py on lines 73..74
BaseTools/Source/Python/Ecc/Ecc.py on lines 75..76
BaseTools/Source/Python/build/build.py on lines 111..112

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

        if ( 0 != (address & (size - 1)) ):
            logger().warn( "Config register address is not naturally aligned" )
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/helper/oshelper.py and 1 other location - About 35 mins to fix
vector-uefi/fd/tool/chipsec/helper/oshelper.py on lines 183..184

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:
            CreateDirectory(os.path.dirname(ToDest))
            if os.path.exists(ToDest) and not os.access(ToDest, os.W_OK):
                Logger.Warn("PackagingTool", \
                            ST.WRN_FILE_NOT_OVERWRITTEN % ToDest)
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 47..55
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 3 locations. Consider refactoring.
Open

                DecFileRelaPath = \
                DecFile[DecFile.find(WorkSP) + len(WorkSP) + 1:]
Severity: Minor
Found in BaseTools/Source/Python/UPT/Core/DependencyRules.py and 2 other locations - About 35 mins to fix
BaseTools/Source/Python/UPT/Core/DependencyRules.py on lines 232..232
BaseTools/Source/Python/UPT/InstallPkg.py on lines 417..417

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

    try:
        fp = open(filename, 'r')
    except:
        sys.stderr.write('Cannot open %s\n' % filename)
        return
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/ptags.py and 1 other location - About 35 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/eptags.py on lines 26..30

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