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 EnumerationDefinition :
    ## 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 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 166..168
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 225..227
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 error( self, text ):
        """Logs an Error message"""
        text = "ERROR: " + 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 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 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

    def log_important( self, text ):
        """Logs a important message."""
        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 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

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

                if self._SectionName not in SECTIONS_HAVE_ITEM_AFTER_ARCH and len(ItemList) > 3:
                    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 293..295
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 Struct:
    def __init__(self, name, head, members):
        self.name = name
        self.head = head
        self.members = members
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
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_zip(x):
    return ( x.find('__init__') == -1 and ZIP_UTILCMD_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/chipsec_util.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 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_zip(x):
    return ( x.find('__init__') == -1 and ZIP_UTILCMD_RE.match(x) )
Severity: Major
Found in vector-uefi/fd/tool/patch.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 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 11 locations. Consider refactoring.
Open

        for Item in LibraryClass.GetHelpTextList():
            Tmp = HelpTextXml()
            NodeList.append(Tmp.ToXml(Item))
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/CommonXml.py and 10 other locations - About 30 mins to fix
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 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_failed( self, text ):
        """Logs a failed message."""
        text = "[-] FAILED: " + text
        self._log(text, RED, 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 269..272
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 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/flash.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 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 11 locations. Consider refactoring.
Open

        for Item in PackageIncludeHeader.GetHelpTextList():
            Tmp = HelpTextXml()
            NodeList.append(Tmp.ToXml(Item))
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.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/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

        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 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_skipped( self, text ):
        """Logs a skipped message."""
        text = "[*] SKIPPED: " + text
        self._log(text, YELLOW, 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 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 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

    def log_good( self, text ):
        """Logs a message, if colors available, displays in green."""
        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 299..302
vector-uefi/fd/tool/chipsec/logger.py on lines 304..307
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

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/AutoGen/AutoGen.py and 2 other locations - About 30 mins to fix
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 985..986
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

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

        if InComment and HashComment and not PPExtend:
            PPDirectiveObj.EndPos = EndLinePos
            FileProfile.PPDirectiveList.append(PPDirectiveObj)
Severity: Minor
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 2 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 519..521
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 370..372

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 PP_Directive :
    ## 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 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 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 345..347

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

        elif SectionType == "PEI_DEPEX":
            if FileType not in ("PEI_DEPEX", "SEC_PEI_DEPEX"):
                raise Warning("Incorrect section file type '%s'" % FileType, self.FileName, self.CurrentLineNumber)
Severity: Major
Found in BaseTools/Source/Python/GenFds/FdfParser.py and 7 other locations - About 30 mins to fix
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3722..3724
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3725..3727
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3728..3730
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3731..3733
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3740..3742
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3749..3751

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