hackedteam/vector-edk

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

Summary

Maintainability
F
2 wks
Test Coverage

Function ReplaceMacro has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

def ReplaceMacro(String, MacroDefinitions = None,  SelfReplacement = False, Line = None, FileName = None, Flag = False):
    LastString = String
    if MacroDefinitions == None:
        MacroDefinitions = {}
    while MacroDefinitions:
Severity: Minor
Found in BaseTools/Source/Python/UPT/Library/String.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

File String.py has 471 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# This file is used to define common string related functions used in parsing 
# process
#
# Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
Severity: Minor
Found in BaseTools/Source/Python/UPT/Library/String.py - About 7 hrs to fix

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

    def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, \
                                     ValueSplitFlag, ValueSplitCharacter):
        Lines = Lines.split('\n')
        Keys = []
        Value = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 __GetTokenList has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    def __GetTokenList(Str):
        InQuote = False
        Token = ''
        TokenOP = ''
        PreChar = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.py - About 4 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 SplitPcdEntry has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    def SplitPcdEntry(String):
        if not String:
            return ['', '',''], False
        
        PcdTokenCName = ''
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 PreCheck has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def PreCheck(FileName, FileContent, SupSectionTag):
        if SupSectionTag:
            pass
        LineNo = 0
        IsFailed = False
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 IsHexDigitUINT32 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def IsHexDigitUINT32(Str):
        try: 
            Value = int(Str, 10)
            if (Value <= 0xFFFFFFFF) and (Value >= 0):
                return True
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 RemoveDupOption has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def RemoveDupOption(OptionString, Which="/I", Against=None):
        OptionList = OptionString.split()
        ValueList = []
        if Against:
            ValueList += Against
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 GetLineNo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetLineNo(FileContent, Line, IsIgnoreComment=True):
        LineList = FileContent.splitlines()
        for Index in range(len(LineList)):
            if LineList[Index].find(Line) > -1:
                #
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 ConvertNOTEQToNE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def ConvertNOTEQToNE(Expr):
        List = __GetTokenList(Expr)
        HasNOT = False
        RetList = []
        for Token in List:
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.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 CheckFileExist has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo=-1):
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

      def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeySplitCharacter, \
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

        def ReplaceMacro(String, MacroDefinitions = None,  SelfReplacement = False, Line = None, FileName = None, Flag = False):
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

          def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo=-1):
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if Count % 2 != 0:
                                    QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro, 
                                                                                    MacroDefinitions[Macro])
                                elif Count == len(QuotedStringList) and Count%2 == 0:
                                    QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro,
            Severity: Major
            Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if Key[0] not in Keys:
                                      Dictionary[Key[0]] = Value
                                      Keys.append(Key[0])
                                  else:
                                      Dictionary[Key[0]].extend(Value)
              Severity: Major
              Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

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

                def RaiseParserError(Line, Section, File, Format='', LineNo=-1):
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/Library/String.py - About 35 mins to fix

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

                  def NormPath(Path, Defines = None):
                      IsRelativePath = False
                      if Defines == None:
                          Defines = {}
                      if Path:
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/Library/String.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 IsHexDigit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def IsHexDigit(Str):
                      try: 
                          int(Str, 10)
                          return True
                      except ValueError:
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/Library/String.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 CleanString2 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyleComment=False):
                      #
                      # remove whitespace
                      #
                      Line = Line.strip()
                  Severity: Minor
                  Found in BaseTools/Source/Python/UPT/Library/String.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

                  Avoid too many return statements within this function.
                  Open

                      return ['', '', ''], False
                  Severity: Major
                  Found in BaseTools/Source/Python/UPT/Library/String.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return ['', '', ''], False
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Library/String.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return [PcdTokenCName, PcdValue, PcdFeatureFlagExp], True
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/Library/String.py - About 30 mins to fix

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

                        def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line, LineNo=-1):
                            CheckFile = ''
                            if CheckFilename != '' and CheckFilename != None:
                                CheckFile = WorkspaceFile(WorkspaceDir, CheckFilename)
                                if not os.path.isfile(CheckFile):
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.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 CheckFileType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo=-1):
                            if CheckFilename != '' and CheckFilename != None:
                                (Root, Ext) = os.path.splitext(CheckFilename)
                                if Ext.upper() != ExtName.upper() and Root:
                                    ContainerFile = open(ContainerFilename, 'r').read()
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.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 GetHelpTextList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def GetHelpTextList(HelpTextClassList):
                            List = []
                            if HelpTextClassList:
                                for HelpText in HelpTextClassList:
                                    if HelpText.String.endswith('\n'):
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.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

                            for Line in FileContent.splitlines():
                                LineNo = LineNo + 1
                                #
                                # Clean current line
                                #
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 2 days to fix
                        BaseTools/Source/Python/Common/String.py on lines 558..590

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

                        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 RemoveDupOption(OptionString, Which="/I", Against=None):
                            OptionList = OptionString.split()
                            ValueList = []
                            if Against:
                                ValueList += Against
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 day to fix
                        BaseTools/Source/Python/Common/String.py on lines 834..851

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

                        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(LineParts) > 1:
                                Comment = LineParts[1].strip()
                                #
                                # Remove prefixed and trailing comment characters
                                #
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 day to fix
                        BaseTools/Source/Python/Ecc/MetaDataParser.py on lines 248..262

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

                        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 SplitModuleType(Key):
                            KeyList = Key.split(DataType.TAB_SPLIT)
                            #
                            # Fill in for arch
                            #
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 day to fix
                        BaseTools/Source/Python/Common/String.py on lines 208..225

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

                        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 StringArrayLength(String):
                            if isinstance(String, unicode):
                                return (len(String) + 1) * 2 + 1
                            elif String.startswith('L"'):
                                return (len(String) - 3 + 1) * 2
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 day to fix
                        BaseTools/Source/Python/Common/String.py on lines 824..832

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

                        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 Key[0] in Dictionary:
                                            if Key[0] not in Keys:
                                                Dictionary[Key[0]] = Value
                                                Keys.append(Key[0])
                                            else:
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 7 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 526..533

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

                        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 GenDefines(String, Arch, Defines):
                            if String.find(DataType.TAB_DEFINE + ' ') > -1:
                                List = String.replace(DataType.TAB_DEFINE + ' ', '').\
                                split(DataType.TAB_EQUAL_SPLIT)
                                if len(List) == 2:
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 7 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 119..128

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

                        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

                        def GetDynamics(Lines, Key, KeyValues, CommentCharacter):
                            #
                            # Get SkuId Name List
                            #
                            SkuIdNameList = SplitModuleType(Key)
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 3 other locations - About 7 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 162..171
                        BaseTools/Source/Python/Common/String.py on lines 184..197
                        BaseTools/Source/Python/UPT/Library/String.py on lines 94..103

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

                        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

                        def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacter):
                            NewKey = SplitModuleType(Key)
                            Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]
                            LineList = Lines.splitlines()
                            for Line in LineList:
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 3 other locations - About 7 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 162..171
                        BaseTools/Source/Python/Common/String.py on lines 184..197
                        BaseTools/Source/Python/UPT/Library/String.py on lines 114..127

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

                        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 GetLineNo(FileContent, Line, IsIgnoreComment=True):
                            LineList = FileContent.splitlines()
                            for Index in range(len(LineList)):
                                if LineList[Index].find(Line) > -1:
                                    #
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 6 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 662..674

                        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

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

                        def GetHelpTextList(HelpTextClassList):
                            List = []
                            if HelpTextClassList:
                                for HelpText in HelpTextClassList:
                                    if HelpText.String.endswith('\n'):
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 5 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 782..790

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

                        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 GetStringOfList(List, Split = ' '):
                            if type(List) != type([]):
                                return List
                            Str = ''
                            for Item in List:
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 3 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 770..777

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

                        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

                                if Line.find(DataType.TAB_INF_DEFINES_DEFINE + ' ') > -1:
                                    if '' in DefineValues:
                                        DefineValues.remove('')
                                    DefineValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_DEFINE, CommentCharacter))
                                    continue
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 3 other locations - About 2 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 499..503
                        BaseTools/Source/Python/Common/String.py on lines 504..508
                        BaseTools/Source/Python/UPT/Library/String.py on lines 420..424

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

                        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

                                if Line.find(DataType.TAB_INF_DEFINES_SPEC + ' ') > -1:
                                    if '' in SpecValues:
                                        SpecValues.remove('')
                                    SpecValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINES_SPEC, CommentCharacter))
                                    continue
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 3 other locations - About 2 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 499..503
                        BaseTools/Source/Python/Common/String.py on lines 504..508
                        BaseTools/Source/Python/UPT/Library/String.py on lines 415..419

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

                        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 MergeArches(Dict, Key, Arch):
                            if Key in Dict.keys():
                                Dict[Key].append(Arch)
                            else:
                                Dict[Key] = Arch.split()
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 2 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 99..103

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

                        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

                            for Line in LineList:
                                Line = CleanString(Line, CommentCharacter)
                                if Line != '' and Line[0] != CommentCharacter:
                                    KeyValues += [Line]
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 2 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 422..425

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 52.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if Path:
                                if Path[0] == '.':
                                    IsRelativePath = True
                                #
                                # Replace with Define
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 2 hrs to fix
                        BaseTools/Source/Python/Common/String.py on lines 294..305

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 52.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                            elif Count == len(QuotedStringList) and Count%2 == 0:
                                                QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro,
                                                                                                MacroDefinitions[Macro])
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 hr to fix
                        BaseTools/Source/Python/UPT/Library/String.py on lines 209..211

                        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

                                            if Count % 2 != 0:
                                                QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro, 
                                                                                                MacroDefinitions[Macro])
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 hr to fix
                        BaseTools/Source/Python/UPT/Library/String.py on lines 212..214

                        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

                                if Line[Index] == '"':
                                    InString = not InString
                                elif Line[Index] == CommentCharacter and not InString:
                                    Line = Line[0: Index]
                                    break
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 hr to fix
                        BaseTools/Source/Python/Common/String.py on lines 340..344

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

                        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 GetSplitValueList(String, SplitTag=DataType.TAB_VALUE_SPLIT, MaxSplit=-1):
                            return map(lambda l: l.strip(), String.split(SplitTag, MaxSplit))
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 1 hr to fix
                        BaseTools/Source/Python/Common/String.py on lines 87..88

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

                            if LineNo == -1:
                                LineNo = GetLineNo(open(os.path.normpath(File), 'r').read(), Line)
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 55 mins to fix
                        BaseTools/Source/Python/Common/String.py on lines 686..687

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                            return String[String.find(Key + ' ') + len(Key + ' ') : ]
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 55 mins to fix
                        BaseTools/Source/Python/Common/String.py on lines 442..442

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

                        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 IsRelativePath and Path[0] != '.':
                                Path = os.path.join('.', Path)
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 45 mins to fix
                        BaseTools/Source/Python/Common/String.py on lines 307..308

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

                        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

                            try: 
                                Value = int(Str, 10)
                                if (Value <= 0xFFFFFFFF) and (Value >= 0):
                                    return True
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 45 mins to fix
                        BaseTools/Source/Python/UPT/Library/String.py on lines 755..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 35.

                        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

                                    try:
                                        Value = int(Str, 16)
                                        if (Value <= 0xFFFFFFFF) and (Value >= 0):
                                            return True
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 45 mins to fix
                        BaseTools/Source/Python/UPT/Library/String.py on lines 749..752

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

                        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(Key) == 1 and Key[0][0] != CommentCharacter:
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 40 mins to fix
                        BaseTools/Source/Python/Common/String.py on lines 516..516

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

                        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 PreChar == '\\' and Char == '\\':
                                    PreChar = ''
                                else:
                                    PreChar = Char
                        Severity: Minor
                        Found in BaseTools/Source/Python/UPT/Library/String.py and 1 other location - About 30 mins to fix
                        BaseTools/Source/Python/UPT/Parser/DecParserMisc.py on lines 342..345

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 32.

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

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

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

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

                        Refactorings

                        Further Reading

                        There are no issues that match your filters.

                        Category
                        Status