hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/UPT/Library/Parsing.py

Summary

Maintainability
F
3 wks
Test Coverage

File Parsing.py has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define common parsing related functions used in parsing 
# INF/DEC/DSC process
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
Severity: Major
Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 1 day to fix

    Function GetComponents has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetComponents(Lines, KeyValues, CommentCharacter):
        if Lines.find(DataType.TAB_SECTION_END) > -1:
            Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
        (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
         FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 7 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 GetComponent has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetComponent(Lines, KeyValues):
        (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
         FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
         FindPcdsDynamicEx) = (False, False, False, False, False, False, False, \
                               False)
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 7 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 GenSection has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def GenSection(SectionName, SectionDict, SplitArch=True):
        Content = ''
        for SectionAttrs in SectionDict:
            StatementList = SectionDict[SectionAttrs]
            if SectionAttrs and SectionName != 'Defines' and SectionAttrs.strip().upper() != DataType.TAB_ARCH_COMMON:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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 GetWorkspacePackage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetWorkspacePackage():
        DecFileList = []
        WorkspaceDir = os.environ["WORKSPACE"]
        for Root, Dirs, Files in os.walk(WorkspaceDir):
            if 'CVS' in Dirs:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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 GetWorkspaceModule has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetWorkspaceModule():
        InfFileList = []
        WorkspaceDir = os.environ["WORKSPACE"]
        for Root, Dirs, Files in os.walk(WorkspaceDir):
            if 'CVS' in Dirs:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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 InsertSectionItems has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def InsertSectionItems(Model, SectionItemList, ArchList, \
                           ThirdList, RecordSet):
        #
        # Insert each item data of a section
        #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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 GetGuidsProtocolsPpisOfDec has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo=-1):
        List = GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)
        if len(List) != 2:
            RaiseParserError(Item, Type, ContainerFile, '<CName>=<GuidValue>', \
                             LineNo)
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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

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

    def GetPcdOfInf(Item, Type, File, LineNo):
        Format = '<TokenSpaceGuidCName>.<PcdCName>[|<Value>]'
        TokenGuid, TokenName, Value, InfType = '', '', '', ''
    
        if Type == DataType.TAB_PCDS_FIXED_AT_BUILD:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/Parsing.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

    Function ParseDefine has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def ParseDefine(LineValue, StartLine, Table, FileID, SectionName, \
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 50 mins to fix

      Function InsertSectionItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def InsertSectionItems(Model, SectionItemList, ArchList, \
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 35 mins to fix

        Function GetLibraryClassOfInf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo = -1):
            ItemList = GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2))
            SupMod = DataType.SUP_MODULE_LIST_STRING
        
            if len(ItemList) > 5:
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 25 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 MacroParser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def MacroParser(Line, FileName, SectionType, FileLocalMacros):
            MacroDefPattern = re.compile("^(DEFINE)[ \t]+")
            LineContent = Line[0]
            LineNo = Line[1]
            Match = MacroDefPattern.match(LineContent)
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 25 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

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

        def GetComponents(Lines, KeyValues, CommentCharacter):
            if Lines.find(DataType.TAB_SECTION_END) > -1:
                Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
            (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \
             FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 6 days to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 541..617

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

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

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

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

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

        Refactorings

        Further Reading

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

        def GetPcdOfDec(Item, Type, File, LineNo=-1):
            Format = '<TokenSpaceGuidCName>.<PcdCName>|<Value>|<DatumType>|<Token>'
            TokenGuid, TokenName, Value, DatumType, Token = '', '', '', '', ''
            List = GetSplitValueList(Item)
            if len(List) != 4:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 768..785

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

        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 GetSource(Item, ContainerFile, FileRelativePath, LineNo=-1):
            ItemNew = Item + DataType.TAB_VALUE_SPLIT * 4
            List = GetSplitValueList(ItemNew)
            if len(List) < 5 or len(List) > 9:
                RaiseParserError(Item, 'Sources', ContainerFile, \
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 628..638

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

        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 GetPcd(Item, Type, ContainerFile, LineNo=-1):
            TokenGuid, TokenName, Value, MaximumDatumSize, Token = '', '', '', '', ''
            List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)
        
            if len(List) < 4 or len(List) > 6:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 205..219

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

        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 GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo=-1):
            TokenGuid, TokenName, Value, DatumTyp, MaxDatumSize = '', '', '', '', ''
            List = GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)
            if len(List) < 4 or len(List) > 8:
                RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 154..170

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

        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 len(ItemList) > 5:
                RaiseParserError\
                (Item[0], 'LibraryClasses', ContainerFile, \
                 '<LibraryClassKeyWord>[|<LibraryInstance>]\
                 [|<TokenSpaceGuidCName>.<PcdCName>]')
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 278..286

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

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

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

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

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

        Refactorings

        Further Reading

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

        def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo=-1):
            TokenGuid, TokenName, Value = '', '', ''
            List = GetSplitValueList(Item)
            if len(List) != 2:
                RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 day to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 343..353

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

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

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

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

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

        Refactorings

        Further Reading

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

                if List[0].find(':') > -1:
                    Family = List[0][ : List[0].find(':')].strip()
                    ToolChain = List[0][List[0].find(':') + 1 : ].strip()
                else:
                    ToolChain = List[0].strip()
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 7 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 235..239

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

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

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

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

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

        Refactorings

        Further Reading

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

            if len(List) != 2:
                RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, \
                                 '<LibraryClassKeyWord>|<LibraryInstance>')
            else:
                CheckFileType(List[1], '.Inf', ContainerFile, \
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 6 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 255..261

        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

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

        def GetExec(String):
            InfFilename = ''
            ExecFilename = ''
            if String.find('EXEC') > -1:
                InfFilename = String[ : String.find('EXEC')].strip()
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 6 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 518..527

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

        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 len(List) < 6 or len(List) > 8:
                RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
                                 '<PcdTokenSpaceGuidCName>.<TokenCName>|<String>|\
                                 <VariableGuidCName>|<VariableOffset>[|<DefaultValue>\
                                 [|<MaximumDatumSize>]]', LineNo)
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 5 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 390..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 94.

        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 FileSp in Files:
                    if FileSp.startswith('.'):
                        continue
                    Ext = os.path.splitext(FileSp)[1]
                    if Ext.lower() in ['.dec']:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 4 hrs to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 866..872

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

        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 FileSp in Files:
                    if FileSp.startswith('.'):
                        continue
                    Ext = os.path.splitext(FileSp)[1]
                    if Ext.lower() in ['.inf']:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 4 hrs to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 831..837

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

        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 len(List) < 3 or len(List) > 4:
                RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \
                                 '<PcdTokenSpaceGuidCName>.<TokenCName>|<VpdOffset>\
                                 [|<MaximumDatumSize>]', LineNo)
            else:
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 3 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 411..414

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

        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 FindBlock == False:
                    ListItem = Line
                    #
                    # find '{' at line tail
                    #
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 2 hrs to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 446..453

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

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

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

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

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

        Refactorings

        Further Reading

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

            if len(TokenInfo) != 2:
                RaiseParserError(Item, InfType, File, Format, LineNo)
            else:
                TokenGuid = TokenInfo[0]
                TokenName = TokenInfo[1]
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 hr to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 754..758

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

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

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

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

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

        Refactorings

        Further Reading

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

        def GenMetaDatSectionItem(Key, Value, List):
            if Key not in List:
                List[Key] = [Value]
            else:
                List[Key].append(Value)
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 hr to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 875..879

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

        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 ReIsValidMacroName.match(Name) == None:
                Logger.Error('Parser', 
                             FORMAT_INVALID, 
                             ST.ERR_MACRONAME_INVALID%(Name),
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 hr to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 934..937

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

        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 ReIsValidMacroValue.match(Value) == None:
                Logger.Error('Parser', 
                             FORMAT_INVALID, 
                             ST.ERR_MACROVALUE_INVALID%(Value),
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 1 hr to fix
        BaseTools/Source/Python/UPT/Library/Parsing.py on lines 915..918

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

        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

                    for Index in xrange(0, len(ArchList)):
                        ArchList[Index] = ConvertArchForInstall(ArchList[Index])
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 2 other locations - About 50 mins to fix
        BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 229..230
        BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py on lines 398..399

        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

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

                    if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') > -1:
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/Parsing.py and 1 other location - About 35 mins to fix
        BaseTools/Source/Python/Common/Parsing.py on lines 819..819

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

        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