hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/Common/InfClassObject.py

Summary

Maintainability
F
2 wks
Test Coverage

File InfClassObject.py has 632 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define each component of INF file
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 day to fix

    Function GenModuleHeader has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenModuleHeader(self, ContainerFile):
            EdkLogger.debug(2, "Generate ModuleHeader ...")
            File = self.Identification.FileFullPath
            #
            # Update all defines item in database
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function LoadInfFile has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def LoadInfFile(self, Filename):
            #
            # Insert a record for file
            #
            Filename = NormPath(Filename)
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenPcds has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenPcds(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_PCDS)
            Pcds = {}
            PcdToken = {}
    
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenNmakes has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenNmakes(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_NMAKE)
            Nmakes = sdict()
            #
            # Get all Nmakes
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function ShowModule has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def ShowModule(self):
            M = self.Module
            for Arch in M.Header.keys():
                print '\nArch =', Arch
                print 'Filename =', M.Header[Arch].FileName
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenGuidProtocolPpis has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenGuidProtocolPpis(self, Type, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % Type)
            Lists = {}
            #
            # Get all Items
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenBuildOptions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenBuildOptions(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_BUILD_OPTIONS)
            BuildOptions = {}
            #
            # Get all BuildOptions
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenSources has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenSources(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_SOURCES)
            Sources = {}
    
            #
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenLibraryClasses has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenLibraryClasses(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARY_CLASSES)
            LibraryClasses = {}
            #
            # Get all LibraryClasses
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenBinaries has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenBinaries(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_BINARIES)
            Binaries = {}
    
            #
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function GenPackages has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenPackages(self, ContainerFile):
            EdkLogger.debug(2, "Generate %s ..." % TAB_PACKAGES)
            Packages = {}
            #
            # Get all Packages
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function ShowModule has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def ShowModule(self):
            M = self.Module
            for Arch in M.Header.keys():
                print '\nArch =', Arch
                print 'Filename =', M.Header[Arch].FileName
    Severity: Minor
    Found in BaseTools/Source/Python/Common/InfClassObject.py - About 1 hr to fix

      Function GenDepexes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def GenDepexes(self, ContainerFile):
              EdkLogger.debug(2, "Generate %s ..." % TAB_DEPEX)
              Depex = {}
              #
              # Get all Depexes
      Severity: Minor
      Found in BaseTools/Source/Python/Common/InfClassObject.py - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Avoid deeply nested control flow statements.
      Open

                              if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
                                  EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                              ArchList.append(ItemList[1].upper())
      Severity: Major
      Found in BaseTools/Source/Python/Common/InfClassObject.py - About 45 mins to fix

        Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, Filename=None, IsToDatabase=False, IsToModule=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
        Severity: Minor
        Found in BaseTools/Source/Python/Common/InfClassObject.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if CurrentSection != ItemList[0]:
                                      EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                              if CurrentSection.upper() not in self.KeyList:
          Severity: Major
          Found in BaseTools/Source/Python/Common/InfClassObject.py - About 45 mins to fix

            Function GenLibraries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenLibraries(self, ContainerFile):
                    EdkLogger.debug(2, "Generate %s ..." % TAB_LIBRARIES)
                    Libraries = sdict()
                    #
                    # Get all Includes
            Severity: Minor
            Found in BaseTools/Source/Python/Common/InfClassObject.py - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function GenIncludes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def GenIncludes(self, ContainerFile):
                    EdkLogger.debug(2, "Generate %s ..." % TAB_INCLUDES)
                    Includes = sdict()
                    #
                    # Get all Includes
            Severity: Minor
            Found in BaseTools/Source/Python/Common/InfClassObject.py - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                            for Item in LineList:
                                ItemList = GetSplitValueList(Item, TAB_SPLIT)
                                if CurrentSection == '':
                                    CurrentSection = ItemList[0]
                                else:
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 2 days to fix
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1084..1103

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

            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

                    for Record in RecordSet:
                        ValueList = GetSplitValueList(Record[0], TAB_EQUAL_SPLIT)
                        if len(ValueList) != 2:
                            RaiseParserError(Record[0], 'Defines', ContainerFile, '<Key> = <Value>', Record[2])
                        ID, Value1, Value2, Arch, LineNo = Record[3], ValueList[0], ValueList[1], Record[1], Record[2]
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 1 day to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 306..313

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

            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

                    for Arch in self.SupArchList:
                        for Record in RecordSet:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                (Name, Value) = GetGuidsProtocolsPpisOfInf(Record[0], Type, ContainerFile, Record[2])
                                MergeArches(Lists, (Name, Value), Arch)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 1 day to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 377..385

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

            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

            if __name__ == '__main__':
                EdkLogger.Initialize()
                EdkLogger.SetLevel(EdkLogger.DEBUG_0)
            
                W = os.getenv('WORKSPACE')
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 2 other locations - About 6 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 550..563
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1426..1439

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

            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

                        for Record in RecordSet2:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_PATCHABLE_IN_MODULE, ContainerFile, Record[2])
                                MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
                                PcdToken[Record[3]] = (TokenGuidCName, TokenName)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 2 other locations - About 6 hrs to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 903..907
            BaseTools/Source/Python/Common/InfClassObject.py on lines 908..912

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

            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

                        for Record in RecordSet3:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_FEATURE_FLAG, ContainerFile, Record[2])
                                MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
                                PcdToken[Record[3]] = (TokenGuidCName, TokenName)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 2 other locations - About 6 hrs to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 898..902
            BaseTools/Source/Python/Common/InfClassObject.py on lines 908..912

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

            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

                        for Record in RecordSet4:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                (TokenGuidCName, TokenName, Value, Type) = GetPcdOfInf(Record[0], TAB_PCDS_DYNAMIC_EX, ContainerFile, Record[2])
                                MergeArches(Pcds, (TokenGuidCName, TokenName, Value, Type), Arch)
                                PcdToken[Record[3]] = (TokenGuidCName, TokenName)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 2 other locations - About 6 hrs to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 898..902
            BaseTools/Source/Python/Common/InfClassObject.py on lines 903..907

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

            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 Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                (Family, ToolChain, Flag) = GetBuildOption(Record[0], ContainerFile, Record[2])
                                MergeArches(BuildOptions, (Family, ToolChain, Flag), Arch)
                                #
                                # Update to Database
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 5 hrs to fix
            BaseTools/Source/Python/Common/DscClassObject.py on lines 289..298

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

            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

                            elif D[0] == TAB_INF_DEFINES_DEFINE:
                                List = D[1].split(DataType.TAB_EQUAL_SPLIT)
                                if len(List) != 2:
                                    RaiseParserError(Item, 'DEFINE of Defines', File, 'DEFINE <Word> = <Word>', D[2])
                                else:
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 4 hrs to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 605..610

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

            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

                            elif D[0] == TAB_INF_DEFINES_SPEC:
                                List = D[1].split(DataType.TAB_EQUAL_SPLIT)
                                if len(List) != 2:
                                    RaiseParserError(Item, 'SPEC of Defines', File, 'SPEC <Word> = <Version>', D[2])
                                else:
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 4 hrs to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 599..604

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

            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 self.IsToDatabase:
                        for Key in PcdToken.keys():
                            SqlCommand = """update %s set Value2 = '%s' where ID = %s""" % (self.TblInf.Table, ".".join((PcdToken[Key][0], PcdToken[Key][1])), Key)
                            self.TblInf.Exec(SqlCommand)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 4 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 496..499

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

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

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

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

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

            Refactorings

            Further Reading

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

                    for Arch in self.SupArchList:
                        for Record in RecordSet:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                MergeArches(Includes, Record[0], Arch)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 3 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 348..351
            BaseTools/Source/Python/Common/InfClassObject.py on lines 720..723
            BaseTools/Source/Python/Common/InfClassObject.py on lines 828..831

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

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

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

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

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

            Refactorings

            Further Reading

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

                    for Arch in self.SupArchList:
                        for Record in RecordSet:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                MergeArches(Nmakes, Record[0], Arch)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 3 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 348..351
            BaseTools/Source/Python/Common/InfClassObject.py on lines 691..694
            BaseTools/Source/Python/Common/InfClassObject.py on lines 720..723

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

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

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

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

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

            Refactorings

            Further Reading

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

                    for Arch in self.SupArchList:
                        for Record in RecordSet:
                            if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON:
                                MergeArches(Libraries, Record[0], Arch)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 3 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 348..351
            BaseTools/Source/Python/Common/InfClassObject.py on lines 691..694
            BaseTools/Source/Python/Common/InfClassObject.py on lines 828..831

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

            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 Type == TAB_GUIDS:
                        ListMember = self.Module.Guids
                    elif Type == TAB_PROTOCOLS:
                        ListMember = self.Module.Protocols
                    elif Type == TAB_PPIS:
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 2 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 388..393

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

            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

                    for Key in Includes.keys():
                        Include = IncludeClass()
                        Include.FilePath = NormPath(Key)
                        Include.SupArchList = Includes[Key]
                        self.Module.Includes.append(Include)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 1 other location - About 2 hrs to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 353..357

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

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

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

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

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

            Refactorings

            Further Reading

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

                        if Line.find(TAB_COMMENT_EDK_END) > -1:
                            Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]
                            ReservedLine = ''
                            IsFindBlockComment = False
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 168..171
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1051..1054
            BaseTools/Source/Python/Eot/Parser.py on lines 56..59

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

            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 CurrentSection == TAB_UNKNOWN:
                            ErrorMsg = "%s is not in any defined section" % Line
                            EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 2 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 227..229
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1110..1112

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

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

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

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

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

            Refactorings

            Further Reading

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

                        if Line.find(TAB_COMMENT_EDK_START) > -1:
                            ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]
                            IsFindBlockComment = True
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 165..167
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1048..1050
            BaseTools/Source/Python/Eot/Parser.py on lines 53..55

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

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

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

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

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

            Refactorings

            Further Reading

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

                            elif D[0] == TAB_INF_DEFINES_UNLOAD_IMAGE:
                                Image = ModuleExternImageClass()
                                Image.ModuleUnloadImage = CleanString(D[1])
                                self.Module.ExternImages.append(Image)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 583..586
            BaseTools/Source/Python/Common/InfClassObject.py on lines 591..594
            BaseTools/Source/Python/Common/InfClassObject.py on lines 595..598

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

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

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

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

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

            Refactorings

            Further Reading

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

                            elif D[0] == TAB_INF_DEFINES_DESTRUCTOR:
                                LibraryClass = ModuleExternLibraryClass()
                                LibraryClass.Destructor = CleanString(D[1])
                                self.Module.ExternLibraries.append(LibraryClass)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 583..586
            BaseTools/Source/Python/Common/InfClassObject.py on lines 587..590
            BaseTools/Source/Python/Common/InfClassObject.py on lines 591..594

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

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

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

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

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

            Refactorings

            Further Reading

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

                            elif D[0] == TAB_INF_DEFINES_ENTRY_POINT:
                                Image = ModuleExternImageClass()
                                Image.ModuleEntryPoint = CleanString(D[1])
                                self.Module.ExternImages.append(Image)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 587..590
            BaseTools/Source/Python/Common/InfClassObject.py on lines 591..594
            BaseTools/Source/Python/Common/InfClassObject.py on lines 595..598

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

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

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

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

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

            Refactorings

            Further Reading

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

                            elif D[0] == TAB_INF_DEFINES_CONSTRUCTOR:
                                LibraryClass = ModuleExternLibraryClass()
                                LibraryClass.Constructor = CleanString(D[1])
                                self.Module.ExternLibraries.append(LibraryClass)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 1 hr to fix
            BaseTools/Source/Python/Common/InfClassObject.py on lines 583..586
            BaseTools/Source/Python/Common/InfClassObject.py on lines 587..590
            BaseTools/Source/Python/Common/InfClassObject.py on lines 595..598

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

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

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

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

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

            Refactorings

            Further Reading

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

                            LineList = GetSplitValueList(Line[len(TAB_SECTION_START):len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)
            Severity: Major
            Found in BaseTools/Source/Python/Common/InfClassObject.py and 3 other locations - About 50 mins to fix
            BaseTools/Source/Python/Common/DecClassObject.py on lines 202..202
            BaseTools/Source/Python/Common/DscClassObject.py on lines 1083..1083
            BaseTools/Source/Python/Eot/InfParserLite.py on lines 129..129

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

            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

            There are no issues that match your filters.

            Category
            Status