hackedteam/vector-edk

View on GitHub

Showing 3,985 of 13,510 total issues

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

    def read_port_byte(self, io_port ):
        value = self.helper.read_io_port( io_port, 1 )
        if logger().VERBOSE:
            logger().log( "[io] reading byte from I/O port 0x%04X -> 0x%02X" % (io_port, value) )
        return value
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/io.py and 2 other locations - About 2 hrs to fix
vector-uefi/fd/tool/chipsec/hal/io.py on lines 73..77
vector-uefi/fd/tool/chipsec/hal/io.py on lines 79..83

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

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

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

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

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

Refactorings

Further Reading

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

    def read_port_word(self, io_port ):
        value = self.helper.read_io_port( io_port, 2 )
        if logger().VERBOSE:
            logger().log( "[io] reading word from I/O port 0x%04X -> 0x%04X" % (io_port, value) )
        return value
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/io.py and 2 other locations - About 2 hrs to fix
vector-uefi/fd/tool/chipsec/hal/io.py on lines 73..77
vector-uefi/fd/tool/chipsec/hal/io.py on lines 85..89

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

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

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

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

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

Refactorings

Further Reading

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

    def read_port_dword(self, io_port ):
        value = self.helper.read_io_port( io_port, 4 )
        if logger().VERBOSE:
            logger().log( "[io] reading dword from I/O port 0x%04X -> 0x%08X" % (io_port, value) )
        return value
Severity: Major
Found in vector-uefi/fd/tool/chipsec/hal/io.py and 2 other locations - About 2 hrs to fix
vector-uefi/fd/tool/chipsec/hal/io.py on lines 79..83
vector-uefi/fd/tool/chipsec/hal/io.py on lines 85..89

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

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

    def __init__(self):
        SectionClassObject.__init__(self)
        self.Fv = None
        self.FvName = None
        self.FvFileType = None
Severity: Major
Found in BaseTools/Source/Python/CommonDataClass/FdfClass.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/UPT/Object/Parser/DecObject.py on lines 414..422

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

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

                if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, RecordCat):
                    EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, OtherMsg="The PCD [%s] is defined duplicated in DEC file" % RecordCat, BelongsToTable='Dec', BelongsToItem=Record[0])
Severity: Major
Found in BaseTools/Source/Python/Ecc/Check.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/Ecc/Check.py on lines 368..369

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

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

                    Line = COMMENT_DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED
Severity: Major
Found in BaseTools/Source/Python/AutoGen/StrGather.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/AutoGen/StrGather.py on lines 185..185

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

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

                        if not EccGlobalData.gException.IsException(ERROR_INCLUDE_FILE_CHECK_NAME, Path):
                            EccGlobalData.gDb.TblReport.Insert(ERROR_INCLUDE_FILE_CHECK_NAME, OtherMsg="The file name for [%s] is duplicate" % Path, BelongsToTable='File', BelongsToItem=Item[0])
Severity: Major
Found in BaseTools/Source/Python/Ecc/Check.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/Ecc/Check.py on lines 745..746

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

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

    def __init__(self, Guid, Name, Value, DatumType,
                 Token, MaxDatumSize=''):
        _DecItemBaseObject.__init__(self)
        self.TokenCName = Name
        self.TokenSpaceGuidCName = Guid
Severity: Major
Found in BaseTools/Source/Python/UPT/Object/Parser/DecObject.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/CommonDataClass/FdfClass.py on lines 228..235

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

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

                    Line = DEFINE_STR + ' ' + Name + ' ' * (ValueStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)
Severity: Major
Found in BaseTools/Source/Python/AutoGen/StrGather.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/AutoGen/StrGather.py on lines 191..191

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

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

        if ValueString.upper() == "TRUE" or ValueString in ["1", "0x1", "0x01"]:
            try:    
                self.PcdValue =  pack(_FORMAT_CHAR[1], 1)
            except:
                EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, 
Severity: Major
Found in BaseTools/Source/Python/BPDG/GenVpd.py and 1 other location - About 2 hrs to fix
BaseTools/Source/Python/BPDG/GenVpd.py on lines 103..114

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PcdXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/CommonXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PcdXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PcdXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 51..54
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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

        for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):
            HelpTextObj = HelpTextXml()
            HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)
            self.HelpText.append(HelpTextObj)
Severity: Major
Found in BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py and 10 other locations - About 2 hrs to fix
BaseTools/Source/Python/UPT/Xml/CommonXml.py on lines 776..779
BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py on lines 68..71
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 298..301
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 344..347
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 387..390
BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py on lines 432..435
BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py on lines 90..93
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 152..155
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 195..198
BaseTools/Source/Python/UPT/Xml/PcdXml.py on lines 235..238

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

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