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

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

        if SectionType == "COMPAT16":
            if FileType not in ("COMPAT16", "SEC_COMPAT16"):
                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 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 3746..3748
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

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

            if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
                InString = not InString
Severity: Major
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

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

            if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
                InString = not InString
Severity: Major
Found in BaseTools/Source/Python/Eot/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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/Eot/CodeFragmentCollector.py and 2 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 397..399
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 519..521

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 == "PE32":
            if FileType not in ("PE32", "SEC_PE32"):
                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 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 3746..3748
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

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

        elif SectionType == "TE":
            if FileType not in ("TE", "SEC_TE"):
                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 3740..3742
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3743..3745
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
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

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

            if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
                InCharLiteral = not InCharLiteral
Severity: Major
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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

            if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
                InCharLiteral = not InCharLiteral
Severity: Major
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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 in self.DataType:
                if self.DataType[self._SectionName] not in self._SectionType:
                    self._SectionType.append(self.DataType[self._SectionName])
            else:
                EdkLogger.error("Parser", FORMAT_UNKNOWN_ERROR, "%s is not a valid section name" % Item,
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 293..295

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 == "UI":
            if FileType not in ("UI", "SEC_UI"):
                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 3743..3745
BaseTools/Source/Python/GenFds/FdfParser.py on lines 3746..3748
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

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

            if not InComment and self.__CurrentChar() == T_CHAR_DOUBLE_QUOTE:
                InString = not InString
Severity: Major
Found in BaseTools/Source/Python/Ecc/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 290..291

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 == "PIC":
            if FileType not in ("PIC", "PIC"):
                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 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 3746..3748
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

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

        elif SectionType == "VERSION":
            if FileType not in ("VERSION", "SEC_VERSION"):
                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 3746..3748
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

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

            if not InComment and self.__CurrentChar() == T_CHAR_SINGLE_QUOTE:
                InCharLiteral = not InCharLiteral
Severity: Major
Found in BaseTools/Source/Python/Eot/CodeFragmentCollector.py and 5 other locations - About 30 mins to fix
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 297..298
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 300..301
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 419..420
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py on lines 422..423
BaseTools/Source/Python/Eot/CodeFragmentCollector.py on lines 287..288

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 == "GUID":
            if FileType not in ("PE32", "SEC_GUID"):
                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 3746..3748

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

        return Complex(math.cos(phi)*r, math.sin(phi)*r)
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Demo/classes/Complex.py and 1 other location - About 30 mins to fix
AppPkg/Applications/Python/Python-2.7.2/Demo/classes/Complex.py on lines 84..84

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

            if not IsFound:
                EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Parameter))
Severity: Minor
Found in BaseTools/Source/Python/Eot/Parser.py and 1 other location - About 30 mins to fix
BaseTools/Source/Python/Eot/Parser.py on lines 556..557

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