hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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

class PP_Directive :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
Severity: Major
Found in BaseTools/Source/Python/Eot/CodeFragment.py and 10 other locations - About 30 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/structparse.py on lines 10..14
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 14..18
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 50..54
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 53..64
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 106..117
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 122..133
BaseTools/Source/Python/Eot/CodeFragment.py on lines 71..82
BaseTools/Source/Python/Eot/CodeFragment.py on lines 124..135
BaseTools/Source/Python/Eot/CodeFragment.py on lines 140..151

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

    def log_result( self, text ):
        """Logs a result message."""
        text = "[+] " + text
        self._log(text, GREEN, None)
Severity: Major
Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

def f_mod_zip(x):
    return ( x.find('__init__') == -1 and ZIP_HELPER_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/chipsec/helper/oshelper.py and 9 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec_main.py on lines 88..89
vector-uefi/fd/tool/chipsec_util.py on lines 66..67
vector-uefi/fd/tool/chipsec_util.py on lines 72..73
vector-uefi/fd/tool/flash.py on lines 73..74
vector-uefi/fd/tool/flash.py on lines 79..80
vector-uefi/fd/tool/patch.py on lines 73..74
vector-uefi/fd/tool/patch.py on lines 79..80
vector-uefi/fd/tool/test.py on lines 73..74
vector-uefi/fd/tool/test.py on lines 79..80

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

def f_mod(x):
    return ( x.find('__init__') == -1 and MODFILE_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/test.py and 9 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/helper/oshelper.py on lines 58..59
vector-uefi/fd/tool/chipsec_main.py on lines 88..89
vector-uefi/fd/tool/chipsec_util.py on lines 66..67
vector-uefi/fd/tool/chipsec_util.py on lines 72..73
vector-uefi/fd/tool/flash.py on lines 73..74
vector-uefi/fd/tool/flash.py on lines 79..80
vector-uefi/fd/tool/patch.py on lines 73..74
vector-uefi/fd/tool/patch.py on lines 79..80
vector-uefi/fd/tool/test.py on lines 73..74

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

                if ErrorCode != 0:
                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
Severity: Major
Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 598..599
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 627..628

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

                if ErrorCode != 0:
                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
Severity: Major
Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 519..520
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 627..628

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

                if ErrorCode != 0:
                    EdkLogger.error('build', ErrorCode, File=self.MetaFile, Line=LineNo,
Severity: Major
Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py and 3 other locations - About 30 mins to fix
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 487..488
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 519..520
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py on lines 598..599

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

class PredicateExpression :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
Severity: Major
Found in BaseTools/Source/Python/Eot/CodeFragment.py and 10 other locations - About 30 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/structparse.py on lines 10..14
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 14..18
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 50..54
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 53..64
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 106..117
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 122..133
BaseTools/Source/Python/Eot/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Eot/CodeFragment.py on lines 124..135
BaseTools/Source/Python/Eot/CodeFragment.py on lines 140..151

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

    def log_bad( self, text ):
        """Logs a bad message, so it calls attention in the information displayed."""
        text = "[-] " + text
        self._log(text, RED, None)
Severity: Major
Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
vector-uefi/fd/tool/chipsec/logger.py on lines 269..272
vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

def f_mod_zip(x):
    return ( x.find('__init__') == -1 and ZIP_UTILCMD_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/test.py and 9 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/helper/oshelper.py on lines 58..59
vector-uefi/fd/tool/chipsec_main.py on lines 88..89
vector-uefi/fd/tool/chipsec_util.py on lines 66..67
vector-uefi/fd/tool/chipsec_util.py on lines 72..73
vector-uefi/fd/tool/flash.py on lines 73..74
vector-uefi/fd/tool/flash.py on lines 79..80
vector-uefi/fd/tool/patch.py on lines 73..74
vector-uefi/fd/tool/patch.py on lines 79..80
vector-uefi/fd/tool/test.py on lines 79..80

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

            elif self._Version >= 0x00010005:
                EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
                                self.MetaFile, self._LineIndex + 1, self._CurrentLine)
Severity: Minor
Found in BaseTools/Source/Python/Workspace/MetaFileParser.py and 2 other locations - About 30 mins to fix
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 290..292
BaseTools/Source/Python/Workspace/MetaFileParser.py on lines 1694..1699

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

class EnumerationDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
Severity: Major
Found in BaseTools/Source/Python/Ecc/CodeFragment.py and 10 other locations - About 30 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/structparse.py on lines 10..14
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 14..18
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 50..54
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 53..64
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 122..133
BaseTools/Source/Python/Eot/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Eot/CodeFragment.py on lines 71..82
BaseTools/Source/Python/Eot/CodeFragment.py on lines 124..135
BaseTools/Source/Python/Eot/CodeFragment.py on lines 140..151

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

        class d:
            def __init__(self,a,b,c):
                self.a = a
                self.b = b
                self.c = c
AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/structparse.py on lines 10..14
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 50..54
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 53..64
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 106..117
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 122..133
BaseTools/Source/Python/Eot/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Eot/CodeFragment.py on lines 71..82
BaseTools/Source/Python/Eot/CodeFragment.py on lines 124..135
BaseTools/Source/Python/Eot/CodeFragment.py on lines 140..151

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

def f_mod(x):
    return ( x.find('__init__') == -1 and ZIP_MODULES_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/chipsec_main.py and 9 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/helper/oshelper.py on lines 58..59
vector-uefi/fd/tool/chipsec_util.py on lines 66..67
vector-uefi/fd/tool/chipsec_util.py on lines 72..73
vector-uefi/fd/tool/flash.py on lines 73..74
vector-uefi/fd/tool/flash.py on lines 79..80
vector-uefi/fd/tool/patch.py on lines 73..74
vector-uefi/fd/tool/patch.py on lines 79..80
vector-uefi/fd/tool/test.py on lines 73..74
vector-uefi/fd/tool/test.py on lines 79..80

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

                if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
                    Constructor.append(LibraryModule)
Severity: Minor
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py and 2 other locations - About 30 mins to fix
BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1512..1513
BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 129..130

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

    def log_passed( self, text ):
        """Logs a passed message."""
        text = "[+] PASSED: " + text
        self._log(text, GREEN, True)
Severity: Major
Found in vector-uefi/fd/tool/chipsec/logger.py and 10 other locations - About 30 mins to fix
vector-uefi/fd/tool/chipsec/logger.py on lines 224..227
vector-uefi/fd/tool/chipsec/logger.py on lines 229..232
vector-uefi/fd/tool/chipsec/logger.py on lines 274..277
vector-uefi/fd/tool/chipsec/logger.py on lines 279..282
vector-uefi/fd/tool/chipsec/logger.py on lines 285..288
vector-uefi/fd/tool/chipsec/logger.py on lines 294..297
vector-uefi/fd/tool/chipsec/logger.py on lines 299..302
vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
vector-uefi/fd/tool/chipsec/logger.py on lines 309..312
vector-uefi/fd/tool/chipsec/logger.py on lines 314..317

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

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

class StructUnionDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
Severity: Major
Found in BaseTools/Source/Python/Eot/CodeFragment.py and 10 other locations - About 30 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Tools/framer/framer/structparse.py on lines 10..14
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 14..18
AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/Instances.py on lines 50..54
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 53..64
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 106..117
BaseTools/Source/Python/Ecc/CodeFragment.py on lines 122..133
BaseTools/Source/Python/Eot/CodeFragment.py on lines 37..48
BaseTools/Source/Python/Eot/CodeFragment.py on lines 71..82
BaseTools/Source/Python/Eot/CodeFragment.py on lines 124..135

Duplicated Code

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

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

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

Tuning

This issue has a mass of 32.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language