hackedteam/vector-edk

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

Summary

Maintainability
F
1 mo
Test Coverage

File Misc.py has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/Common/Misc.py - About 3 days to fix

    Function AnalyzeDscPcd has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

    def AnalyzeDscPcd(Setting, PcdType, DataType=''):
        Setting = Setting.strip()
        # There might be escaped quote in a string: \", \\\"
        Data = Setting.replace('\\\\', '//').replace('\\\"', '\\\'')
        # There might be '|' in string and in ( ... | ... ), replace it with '-'
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function _GetSingleValue has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetSingleValue(self, FirstKey, RestKeys):
            Value = None
            #print "%s-%s" % (FirstKey, self._Level_) ,
            if self._Level_ > 1:
                if FirstKey == self._Wildcard:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 Instantiate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

            def Instantiate(self, PlaceHolderValues):
                RepeatTime = -1
                RepeatPlaceHolders = {}
                NonRepeatPlaceHolders = {}
    
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 _GetAllValues has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetAllValues(self, FirstKey, RestKeys):
            Value = []
            if self._Level_ > 1:
                if FirstKey == self._Wildcard:
                    for Key in self.data:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 CheckPcdDatum has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckPcdDatum(Type, Value):
        if Type == "VOID*":
            ValueRe  = re.compile(r'\s*L?\".*\"\s*$')
            if not (((Value.startswith('L"') or Value.startswith('"')) and Value.endswith('"'))
                    or (Value.startswith('{') and Value.endswith('}'))
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 ValidFile3 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def ValidFile3(AllFiles, File, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
        # Replace the Edk macros
        if OverrideDir != '' and OverrideDir != None:
            if OverrideDir.find('$(EFI_SOURCE)') > -1:
                OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 SaveFileOnChange has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def SaveFileOnChange(File, Content, IsBinaryFile=True):
        if not IsBinaryFile:
            Content = Content.replace("\n", os.linesep)
    
        if os.path.exists(File):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 __getitem__ has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        def __getitem__(self, Path):
            Path = Path[len(os.path.commonprefix([Path, self._Root])):]
            if not Path:
                return self._Root
            if Path and Path[0] == os.path.sep:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 ValidFile2 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def ValidFile2(AllFiles, File, Ext=None, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
        NewFile = File
        if Ext != None:
            Dummy, FileExt = os.path.splitext(File)
            if FileExt.lower() != Ext.lower():
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 RealPath2 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def RealPath2(File, Dir='', OverrideDir=''):
        if OverrideDir:
            NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
            if NewFile:
                if OverrideDir[-1] == os.path.sep:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 __init__ has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
                     Arch='COMMON', ToolChainFamily='', Target='', TagName='', ToolCode=''):
            self.Arch = Arch
            self.File = str(File)
            if os.path.isabs(self.File):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 Validate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def Validate(self, Type='', CaseSensitive=True):
            if GlobalData.gCaseInsensitive:
                CaseSensitive = False
            if Type and Type.lower() != self.Type:
                return FILE_TYPE_MISMATCH, '%s (expect %s but got %s)' % (self.File, Type, self.Type)
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 GetFiles has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetFiles(Root, SkipList=None, FullPath = True):
        OriPath = Root
        FileList = []
        for Root, Dirs, Files in os.walk(Root):
            if SkipList:
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 SplitOption has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def SplitOption(OptionString):
        OptionList = []
        LastChar = " "
        OptionStart = 0
        QuotationMark = ""
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 _Parse has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def _Parse(self, Template):
            SectionStart = 0
            SearchFrom = 0
            MatchEnd = 0
            PlaceHolderList = []
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 __setitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def __setitem__(self, key, value):
            KeyType = type(key)
            RestKeys = None
            if KeyType == self._ListType or KeyType == self._TupleType:
                FirstKey = key[0]
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 __getitem__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def __getitem__(self, key):
            KeyType = type(key)
            RestKeys = None
            if KeyType == self._ListType or KeyType == self._TupleType:
                FirstKey = key[0]
    Severity: Minor
    Found in BaseTools/Source/Python/Common/Misc.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
    Severity: Major
    Found in BaseTools/Source/Python/Common/Misc.py - About 1 hr to fix

      Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def __init__(self, PeFile):
              self.FileName   = PeFile
              self.IsValid    = False
              self.Size       = 0
              self.EntryPoint = 0
      Severity: Minor
      Found in BaseTools/Source/Python/Common/Misc.py - About 1 hr to fix

        Function __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self,SkuIdentifier='', SkuIds={}):
                
                self.AvailableSkuIds = sdict()
                self.SkuIdSet = []
                
        Severity: Minor
        Found in BaseTools/Source/Python/Common/Misc.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 ValidFile2 has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def ValidFile2(AllFiles, File, Ext=None, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
        Severity: Major
        Found in BaseTools/Source/Python/Common/Misc.py - About 1 hr to fix

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

          def RemoveDirectory(Directory, Recursively=False):
              if Directory == None or Directory.strip() == "" or not os.path.exists(Directory):
                  return
              if Recursively:
                  CurrentDirectory = os.getcwd()
          Severity: Minor
          Found in BaseTools/Source/Python/Common/Misc.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 ValidFile3 has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def ValidFile3(AllFiles, File, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
          Severity: Major
          Found in BaseTools/Source/Python/Common/Misc.py - About 50 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if Value != None: break
                        else:
            Severity: Major
            Found in BaseTools/Source/Python/Common/Misc.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if Value != None: break
                          else:
              Severity: Major
              Found in BaseTools/Source/Python/Common/Misc.py - About 45 mins to fix

                Avoid too many return statements within this function.
                Open

                            return os.path.join(self._Root, Path)
                Severity: Major
                Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return None
                  Severity: Major
                  Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return NewFile, ''
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return None, None
                      Severity: Major
                      Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])
                        Severity: Major
                        Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return [], False, 0
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return False, "Invalid type [%s]; must be one of VOID*, BOOLEAN, UINT8, UINT16, UINT32, UINT64." % (Type)
                            Severity: Major
                            Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return False, File
                              Severity: Major
                              Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return True, ""
                                Severity: Major
                                Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                  return None
                                  Severity: Major
                                  Found in BaseTools/Source/Python/Common/Misc.py - About 30 mins to fix

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

                                        def update(self, dict=None, **kwargs):
                                            if dict != None:
                                                for k, v in dict.items():
                                                    self[k] = v
                                            if len(kwargs):
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                            def __init__(self, TemplateSection, PlaceHolderList):
                                                self._Template = TemplateSection
                                                self._PlaceHolderList = []
                                    
                                                # Split the section into sub-sections according to the position of placeholders
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.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 GetRelPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def GetRelPath(Path1, Path2):
                                        FileName = os.path.basename(Path2)
                                        L1 = os.path.normpath(Path1).split(os.path.normpath('/'))
                                        L2 = os.path.normpath(Path2).split(os.path.normpath('/'))
                                        for Index in range(0, len(L1)):
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.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 ProcessVariableArgument has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def ProcessVariableArgument(Option, OptionString, Value, Parser):
                                        assert Value is None
                                        Value = []
                                        RawArgs = Parser.rargs
                                        while RawArgs:
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.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

                                    class sdict(IterableUserDict):
                                        ## Constructor
                                        def __init__(self):
                                            IterableUserDict.__init__(self)
                                            self._key_list = []
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 wk to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 290..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 701.

                                    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 __init__(self, File='', Root='', AlterRoot='', Type='', IsBinary=False,
                                                     Arch='COMMON', ToolChainFamily='', Target='', TagName='', ToolCode=''):
                                            self.Arch = Arch
                                            self.File = str(File)
                                            if os.path.isabs(self.File):
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 4 days to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 441..496

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

                                    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 GuidStringToGuidStructureString(Guid):
                                        GuidList = Guid.split('-')
                                        Result = '{'
                                        for Index in range(0,3,1):
                                            Result = Result + '0x' + GuidList[Index] + ', '
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 day to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 55..64

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        return "%08x_%04x_%04x_%02x%02x_%02x%02x%02x%02x%02x%02x" % (
                                                int(guidValueList[0], 16),
                                                int(guidValueList[1], 16),
                                                int(guidValueList[2], 16),
                                                int(guidValueList[3], 16),
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 day to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 134..146
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 96..108

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        try:
                                            return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (
                                                    int(guidValueList[0], 16),
                                                    int(guidValueList[1], 16),
                                                    int(guidValueList[2], 16),
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 day to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 162..173
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 96..108

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

                                    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 AnalyzePcdData(Setting):   
                                        ValueList = ['', '', '']    
                                        
                                        ValueRe  = re.compile(r'^\s*L?\".*\|.*\"')
                                        PtrValue = ValueRe.findall(Setting)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 day to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1360..1378

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

                                    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 AnalyzeVpdPcdData(Setting):   
                                        ValueList = ['', '', '']    
                                        
                                        ValueRe  = re.compile(r'\s*L?\".*\|.*\"\s*$')
                                        PtrValue = ValueRe.findall(Setting)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 day to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1314..1332

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

                                    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 CommonPath(PathList):
                                        P1 = min(PathList).split(os.path.sep)
                                        P2 = max(PathList).split(os.path.sep)
                                        for Index in xrange(min(len(P1), len(P2))):
                                            if P1[Index] != P2[Index]:
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 7 hrs to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 430..436

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

                                    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 OverrideDir:
                                            NewFile = GlobalData.gAllFiles[os.path.normpath(os.path.join(OverrideDir, File))]
                                            if NewFile:
                                                if OverrideDir[-1] == os.path.sep:
                                                    return NewFile[len(OverrideDir):], NewFile[0:len(OverrideDir)]
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 7 hrs to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 262..270

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

                                    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 NewFile:
                                            if Dir:
                                                if Dir[-1] == os.path.sep:
                                                    return NewFile[len(Dir):], NewFile[0:len(Dir)]
                                                else:
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 6 hrs to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 273..280

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

                                    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 RealPath(File, Dir='', OverrideDir=''):
                                        NewFile = os.path.normpath(os.path.join(Dir, File))
                                        NewFile = GlobalData.gAllFiles[NewFile]
                                        if not NewFile and OverrideDir:
                                            NewFile = os.path.normpath(os.path.join(OverrideDir, File))
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 5 hrs to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 247..253

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 97.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        if OverrideDir != '' and OverrideDir != None:
                                            if OverrideDir.find('$(EFI_SOURCE)') > -1:
                                                OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
                                            if OverrideDir.find('$(EDK_SOURCE)') > -1:
                                                OverrideDir = OverrideDir.replace('$(EDK_SOURCE)', EdkSource)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 4 hrs to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 514..518

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

                                    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 OverrideDir != '' and OverrideDir != None:
                                            if OverrideDir.find('$(EFI_SOURCE)') > -1:
                                                OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
                                            if OverrideDir.find('$(EDK_SOURCE)') > -1:
                                                OverrideDir = OverrideDir.replace('$(EDK_SOURCE)', EdkSource)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 4 hrs to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 476..480

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

                                    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 __eq__(self, Other):
                                            if type(Other) == type(self):
                                                return self.Path == Other.Path
                                            else:
                                                return self.Path == str(Other)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 2 hrs to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 509..513

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 54.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                                if self.AlterRoot:
                                                    RealFile = os.path.join(self.AlterRoot, self.File)
                                                elif self.Root:
                                                    RealFile = os.path.join(self.Root, self.File)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 540..543

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 49.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        def SetSingleMode(self):
                                            self._Single_ = True
                                            if self._Level_ > 1:
                                                for Key in self.data:
                                                    self.data[Key].SetSingleMode()
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1129..1133

                                    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

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

                                        def SetGreedyMode(self):
                                            self._Single_ = False
                                            if self._Level_ > 1:
                                                for Key in self.data:
                                                    self.data[Key].SetGreedyMode()
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1135..1139

                                    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 KeyType == self._ListType or KeyType == self._TupleType:
                                                FirstKey = key[0]
                                                if len(key) > 1:
                                                    RestKeys = key[1:]
                                                elif self._Level_ > 1:
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1107..1116

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

                                    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 KeyType == self._ListType or KeyType == self._TupleType:
                                                FirstKey = key[0]
                                                if len(key) > 1:
                                                    RestKeys = key[1:]
                                                else:
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1030..1039

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                            if DataType == 'VOID*':
                                                IsValid = (len(FieldList) <= 3)
                                            else:
                                                IsValid = (len(FieldList) <= 1)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1249..1252
                                    BaseTools/Source/Python/Common/Misc.py on lines 1287..1290

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                            if DataType == 'VOID*':
                                                IsValid = (len(FieldList) <= 3)
                                            else:
                                                IsValid = (len(FieldList) <= 1)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1271..1274
                                    BaseTools/Source/Python/Common/Misc.py on lines 1287..1290

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                            if DataType == 'VOID*':
                                                IsValid = (len(FieldList) <= 3)
                                            else:
                                                IsValid = (len(FieldList) <= 2)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 1249..1252
                                    BaseTools/Source/Python/Common/Misc.py on lines 1271..1274

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

                                    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 CaseSensitive and (RealFile != self.File or (RealRoot != self.Root and RealRoot != self.AlterRoot)):
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 549..551

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

                                    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 Dir == '.':
                                            Dir = os.getcwd()
                                            Dir = Dir[len(Workspace)+1:]
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 522..524

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

                                    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 Dir == '.':
                                            Dir = os.getcwd()
                                            Dir = Dir[len(Workspace)+1:]
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 483..485

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

                                    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 Directory == None or Directory.strip() == "" or not os.path.exists(Directory):
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 1 hr to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 132..133

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

                                    def ProtocolValue(CName, PackageList):
                                        for P in PackageList:
                                            if CName in P.Protocols:
                                                return P.Protocols[CName]
                                        return None
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 582..586
                                    BaseTools/Source/Python/Common/Misc.py on lines 610..614

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

                                    def PpiValue(CName, PackageList):
                                        for P in PackageList:
                                            if CName in P.Ppis:
                                                return P.Ppis[CName]
                                        return None
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 582..586
                                    BaseTools/Source/Python/Common/Misc.py on lines 596..600

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

                                    def GuidValue(CName, PackageList):
                                        for P in PackageList:
                                            if CName in P.Guids:
                                                return P.Guids[CName]
                                        return None
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 1 hr to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 596..600
                                    BaseTools/Source/Python/Common/Misc.py on lines 610..614

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

                                        guidValueString = GuidValue.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 55 mins to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 129..129
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 91..92

                                    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

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

                                        guidValueString = GuidValue.lower().replace("{", "").replace("}", "").replace(" ", "").replace(";", "")
                                    Severity: Major
                                    Found in BaseTools/Source/Python/Common/Misc.py and 2 other locations - About 55 mins to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 95..95
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 91..92

                                    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

                                        def _GetFileKey(self):
                                            if self._Key == None:
                                                self._Key = self.Path.upper()   # + self.ToolChainFamily + self.TagName + self.ToolCode + self.Target
                                            return self._Key
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 50 mins to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 524..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 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 UpperPath in self._UPPER_CACHE_:
                                                return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 40 mins to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 387..390

                                    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

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

                                            if Path in self._CACHE_:
                                                return os.path.join(self._Root, Path)
                                            elif UpperPath in self._UPPER_CACHE_:
                                                return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 40 mins to fix
                                    BaseTools/Source/Python/Common/Misc.py on lines 349..350

                                    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

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

                                                if self.SubDir:
                                                    self.Dir = os.path.join(RealRoot, self.SubDir)
                                                else:
                                                    self.Dir = RealRoot
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/Common/Misc.py and 1 other location - About 30 mins to fix
                                    BaseTools/Source/Python/UPT/Library/Misc.py on lines 558..561

                                    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