hackedteam/vector-edk

View on GitHub
BaseTools/Source/Python/build/build.py

Summary

Maintainability
F
3 wks
Test Coverage

File build.py has 1192 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# build a platform or a module
#
#  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
#
Severity: Major
Found in BaseTools/Source/Python/build/build.py - About 3 days to fix

    Function _MultiThreadBuildPlatform has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
    Open

        def _MultiThreadBuildPlatform(self):
            for BuildTarget in self.BuildTargetList:
                GlobalData.gGlobalDefines['TARGET'] = BuildTarget
                for ToolChain in self.ToolChainList:
                    GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.py - About 2 days 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 _CollectModuleMapBuffer has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):
            sys.stdout.write ("Generate Load Module At Fix Address Map")
            sys.stdout.flush()
            PatchEfiImageList = []
            PeiModuleList  = {}
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 Main has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
    Open

    def Main():
        StartTime = time.time()
    
        # Initialize log system
        EdkLogger.Initialize()
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 _RebaseModule has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False):
            if ModeIsSmm:
                AddrIsOffset = False
            InfFileNameList = ModuleList.keys()
            #InfFileNameList.sort()
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 _BuildModule has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        def _BuildModule(self):
            for BuildTarget in self.BuildTargetList:
                GlobalData.gGlobalDefines['TARGET'] = BuildTarget
                for ToolChain in self.ToolChainList:
                    GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 _BuildPlatform has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

        def _BuildPlatform(self):
            for BuildTarget in self.BuildTargetList:
                GlobalData.gGlobalDefines['TARGET'] = BuildTarget
                for ToolChain in self.ToolChainList:
                    GlobalData.gGlobalDefines['TOOLCHAIN'] = ToolChain
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 LoadConfiguration has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def LoadConfiguration(self):
            #
            # Check target.txt and tools_def.txt and Init them
            #
            BuildConfigurationFile = os.path.normpath(os.path.join(self.WorkspaceDir, gBuildConfiguration))
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 CreateGuidedSectionToolsFile has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        def CreateGuidedSectionToolsFile(self):
            for BuildTarget in self.BuildTargetList:
                for ToolChain in self.ToolChainList:
                    Wa = WorkspaceAutoGen(
                            self.WorkspaceDir,
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 _CollectFvMapBuffer has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CollectFvMapBuffer (self, MapBuffer, Wa, ModuleList):
            if self.Fdf:
                # First get the XIP base address for FV map file.
                GuidPattern = re.compile("[-a-fA-F0-9]+")
                GuidName = re.compile("\(GUID=[-a-fA-F0-9]+")
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 CheckEnvVariable has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    def CheckEnvVariable():
        # check WORKSPACE
        if "WORKSPACE" not in os.environ:
            EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
                            ExtraData="WORKSPACE")
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 LaunchCommand has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def LaunchCommand(Command, WorkingDir):
        # if working directory doesn't exist, Popen() will raise an exception
        if not os.path.isdir(WorkingDir):
            EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=WorkingDir)
    
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 Scheduler has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def Scheduler(MaxThreadNumber, ExitFlag):
            BuildTask._SchedulerStopped.clear()
            try:
                # use BoundedSemaphore to control the maximum running threads
                BuildTask._Thread = BoundedSemaphore(MaxThreadNumber)
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 _Build has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def _Build(self, Target, AutoGenObject, CreateDepsCodeFile=True, CreateDepsMakeFile=True):
            if AutoGenObject == None:
                return False
    
            # skip file generation for cleanxxx targets, run and fds target
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.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 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, Target, WorkspaceDir, BuildOptions):
            self.WorkspaceDir   = WorkspaceDir
            self.Target         = Target
            self.PlatformFile   = BuildOptions.PlatformFile
            self.ModuleFile     = BuildOptions.ModuleFile
    Severity: Minor
    Found in BaseTools/Source/Python/build/build.py - About 1 hr to fix

      Function _CollectModuleMapBuffer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):
              sys.stdout.write ("Generate Load Module At Fix Address Map")
              sys.stdout.flush()
              PatchEfiImageList = []
              PeiModuleList  = {}
      Severity: Minor
      Found in BaseTools/Source/Python/build/build.py - About 1 hr to fix

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

        def MyOptionParser():
            Parser = OptionParser(description=__copyright__,version=__version__,prog="build.exe",usage="%prog [options] [all|fds|genc|genmake|clean|cleanall|cleanlib|modules|libraries|run]")
            Parser.add_option("-a", "--arch", action="append", type="choice", choices=['IA32','X64','IPF','EBC','ARM', 'AARCH64'], dest="TargetArch",
                help="ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EBC, which overrides target.txt's TARGET_ARCH definition. To specify more archs, please repeat this option.")
            Parser.add_option("-p", "--platform", action="callback", type="string", dest="PlatformFile", callback=SingleCheckCallback,
        Severity: Minor
        Found in BaseTools/Source/Python/build/build.py - About 1 hr to fix

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

          def ParseDefines(DefineList=[]):
              DefineDict = {}
              if DefineList != None:
                  for Define in DefineList:
                      DefineTokenList = Define.split("=", 1)
          Severity: Minor
          Found in BaseTools/Source/Python/build/build.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 CheckEnvVariable has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def CheckEnvVariable():
              # check WORKSPACE
              if "WORKSPACE" not in os.environ:
                  EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
                                  ExtraData="WORKSPACE")
          Severity: Minor
          Found in BaseTools/Source/Python/build/build.py - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                                    if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
                                        ModuleIsPatch = True
                                        break
            
            Severity: Major
            Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
                                          EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platform with IA32 or ARM arch modules")
                                  #
                                  # Get Module List
                                  #
              Severity: Major
              Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if self.Fdf:
                                            #
                                            # create FDS again for the updated EFI image
                                            #
                                            self._Build("fds", Wa)
                Severity: Major
                Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                  Function IsToolInPath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def IsToolInPath(tool):
                      if os.environ.has_key('PATHEXT'):
                          extns = os.environ['PATHEXT'].split(os.path.pathsep)
                      else:
                          extns = ('',)
                  Severity: Minor
                  Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Avoid deeply nested control flow statements.
                  Open

                                          if GuidString.upper() in ModuleList:
                                              Line = Line.replace(GuidString, ModuleList[GuidString.upper()].Name)
                                      MapBuffer.write('%s' % (Line))
                  Severity: Major
                  Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
                                                EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules")
                                        #
                                        # Get Module List
                                        #
                    Severity: Major
                    Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for Ma in Pa.ModuleAutoGenList:
                                                  if Ma == None:
                                                      continue
                                                  if not Ma.IsLibrary:
                                                      ModuleList[Ma.Guid.upper()] = Ma
                      Severity: Major
                      Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
                                                    EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules")
                                            #
                                            # Get Module List
                                            #
                        Severity: Major
                        Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if self.Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
                                                      # for target which must generate AutoGen code and makefile
                                                      if not self.SkipAutoGen or self.Target == 'genc':
                                                          Ma.CreateCodeFile(True)
                                                      if self.Target == "genc":
                          Severity: Major
                          Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not BuildTask.IsOnGoing():
                                                        BuildTask.StartScheduler(self.ThreadNumber, ExitFlag)
                            
                                                # in case there's an interruption. we need a full version of makefile for platform
                                                Pa.CreateMakeFile(False)
                            Severity: Major
                            Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if TemporaryTablePattern.match(Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table):
                                                          TmpTableDict[Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Table] = Wa.BuildDatabase._CACHE_[Key]._RawData._Table.Cur
                                              #
                                              #
                                              # All modules have been put in build tasks queue. Tell task scheduler
                              Severity: Major
                              Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if GuidString.upper() in ModuleList:
                                                            MapBuffer.write('(IMAGE=%s)\n' % (os.path.join(ModuleList[GuidString.upper()].DebugDir, ModuleList[GuidString.upper()].Name + '.efi')))
                                
                                Severity: Major
                                Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if Module.ModuleType == 'DXE_SMM_DRIVER':
                                                              PiSpecVersion = '0x00000000'
                                                              if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:
                                                                  PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']
                                                              # for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver.
                                  Severity: Major
                                  Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if BuildTask.HasError():
                                                                # we need a full version of makefile for platform
                                                                ExitFlag.set()
                                                                BuildTask.WaitForComplete()
                                                                Pa.CreateMakeFile(False)
                                    Severity: Major
                                    Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if Ma == None:
                                                                  continue
                                                              # Not to auto-gen for targets 'clean', 'cleanlib', 'cleanall', 'run', 'fds'
                                                              if self.Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                for Ma in Pa.ModuleAutoGenList:
                                                                    if Ma == None:
                                                                        continue
                                                                    if not Ma.IsLibrary:
                                                                        ModuleList[Ma.Guid.upper()] = Ma
                                        Severity: Major
                                        Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if IsIpfPlatform and ImageInfo.Image.Size % 0x2000 != 0:
                                                                      ImageInfo.Image.Size = (ImageInfo.Image.Size / 0x2000 + 1) * 0x2000
                                                                  RtSize += ImageInfo.Image.Size
                                          Severity: Major
                                          Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    for Ma in Pa.ModuleAutoGenList:
                                                                        if Ma == None:
                                                                            continue
                                                                        if not Ma.IsLibrary:
                                                                            ModuleList[Ma.Guid.upper()] = Ma
                                            Severity: Major
                                            Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

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

                                                  def __init__(self, BaseName, Guid, Arch, OutputDir, DebugDir, ImageClass):
                                              Severity: Minor
                                              Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if attrib.upper().endswith('_GUID'):
                                                                            split = attrib.split('_')
                                                                            thisPrefix = '_'.join(split[0:3]) + '_'
                                                                            if thisPrefix == prefix:
                                                                                guid = self.ToolDef.ToolsDefTxtDictionary[attrib]
                                                Severity: Major
                                                Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if StrList[3] == 'f' or StrList[3] =='F':
                                                                              Name = StrList[1]
                                                                              RelativeAddress = int (StrList[2], 16) - OrigImageBaseAddress
                                                                              FunctionList.append ((Name, RelativeAddress))
                                                                              if ModuleInfo.Arch == 'IPF' and Name.endswith('_ModuleEntryPoint'):
                                                  Severity: Major
                                                  Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

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

                                                        def __init__(self, Obj, BuildCommand, Target, Dependency, WorkingDir="."):
                                                    Severity: Minor
                                                    Found in BaseTools/Source/Python/build/build.py - About 35 mins to fix

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

                                                          def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False):
                                                      Severity: Minor
                                                      Found in BaseTools/Source/Python/build/build.py - About 35 mins to fix

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

                                                            def RestoreBuildData(self):
                                                                FilePath = os.path.join(self.WorkspaceDir, gBuildCacheDir, "gFileTimeStampCache")
                                                                if Utils.gFileTimeStampCache == {} and os.path.isfile(FilePath):
                                                                    Utils.gFileTimeStampCache = Utils.DataRestore(FilePath)
                                                                    if Utils.gFileTimeStampCache == None:
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py - About 35 mins to fix

                                                        Cognitive Complexity

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

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

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

                                                        Further reading

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

                                                        def ReadMessage(From, To, ExitFlag):
                                                            while True:
                                                                # read one line a time
                                                                Line = From.readline()
                                                                # empty string means "end"
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py - About 35 mins to fix

                                                        Cognitive Complexity

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

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

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

                                                        Further reading

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

                                                            def GetFullPathOfTool (self, tool):
                                                                if os.path.exists(tool):
                                                                    return os.path.realpath(tool)
                                                                else:
                                                                    # We need to search for the tool using the
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py - About 35 mins to fix

                                                        Cognitive Complexity

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

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

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

                                                        Further reading

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

                                                            def Launch(self):
                                                                if not self.ModuleFile:
                                                                    if not self.SpawnMode or self.Target not in ["", "all"]:
                                                                        self.SpawnMode = False
                                                                        self._BuildPlatform()
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.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

                                                                if Option.FdfFile != None:
                                                                    if os.path.isabs (Option.FdfFile):
                                                                        if os.path.normcase (os.path.normpath(Option.FdfFile)).find (Workspace) == 0:
                                                                            Option.FdfFile = NormFile(os.path.normpath(Option.FdfFile), Workspace)
                                                                    Option.FdfFile = PathClass(Option.FdfFile, Workspace)
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 day to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1799..1806

                                                        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

                                                                if Option.ModuleFile:
                                                                    if os.path.isabs (Option.ModuleFile):
                                                                        if os.path.normcase (os.path.normpath(Option.ModuleFile)).find (Workspace) == 0:
                                                                            Option.ModuleFile = NormFile(os.path.normpath(Option.ModuleFile), Workspace)
                                                                    Option.ModuleFile = PathClass(Option.ModuleFile, Workspace)
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 day to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1814..1821

                                                        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

                                                            if not os.path.exists(EdkSourceDir):
                                                                if EdkSourceDir == EcpSourceDir:
                                                                    EdkLogger.verbose("EDK_SOURCE = %s doesn't exist. Edk modules could not be built." % EdkSourceDir)
                                                                else:
                                                                    EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE does not exist",
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 4 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 142..149

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                            if not os.path.exists(EfiSourceDir):
                                                                if EfiSourceDir == EcpSourceDir:
                                                                    EdkLogger.verbose("EFI_SOURCE = %s doesn't exist. Edk modules could not be built." % EfiSourceDir)
                                                                else:
                                                                    EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE does not exist",
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 4 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 133..140

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                            for Arch in Wa.ArchList:
                                                                                #
                                                                                # Check whether the set fix address is above 4G for 32bit image.
                                                                                #
                                                                                if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 3 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1343..1348

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 62.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                            for Arch in Wa.ArchList:
                                                                                #
                                                                                # Check whether the set fix address is above 4G for 32bit image.
                                                                                #
                                                                                if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 3 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1482..1487

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 62.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                        def SingleCheckCallback(option, opt_str, value, parser):
                                                            if option not in gParamCheck:
                                                                setattr(parser.values, option.dest, value)
                                                                gParamCheck.append(option)
                                                            else:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 2 hrs to fix
                                                        BaseTools/Source/Python/GenFds/GenFds.py on lines 286..291
                                                        BaseTools/Source/Python/TargetTool/TargetTool.py on lines 184..189

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

                                                        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 Option != None and Option.debug != None:
                                                                    EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1853..1854

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

                                                        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 Option != None and Option.debug != None:
                                                                    EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(), sys.platform) + traceback.format_exc())
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1838..1839

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

                                                        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 Utils.gFileTimeStampCache == {} and os.path.isfile(FilePath):
                                                                    Utils.gFileTimeStampCache = Utils.DataRestore(FilePath)
                                                                    if Utils.gFileTimeStampCache == None:
                                                                        Utils.gFileTimeStampCache = {}
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1625..1628

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

                                                        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 Utils.gDependencyDatabase == {} and os.path.isfile(FilePath):
                                                                    Utils.gDependencyDatabase = Utils.DataRestore(FilePath)
                                                                    if Utils.gDependencyDatabase == None:
                                                                        Utils.gDependencyDatabase = {}
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1619..1622

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

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                            for Pa in Wa.AutoGenObjectList:
                                                                                for Ma in Pa.ModuleAutoGenList:
                                                                                    if Ma == None:
                                                                                        continue
                                                                                    if not Ma.IsLibrary:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1353..1358
                                                        BaseTools/Source/Python/build/build.py on lines 1492..1497

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

                                                                            for Pa in Wa.AutoGenObjectList:
                                                                                for Ma in Pa.ModuleAutoGenList:
                                                                                    if Ma == None:
                                                                                        continue
                                                                                    if not Ma.IsLibrary:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1260..1265
                                                        BaseTools/Source/Python/build/build.py on lines 1492..1497

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

                                                                            for Pa in Wa.AutoGenObjectList:
                                                                                for Ma in Pa.ModuleAutoGenList:
                                                                                    if Ma == None:
                                                                                        continue
                                                                                    if not Ma.IsLibrary:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1260..1265
                                                        BaseTools/Source/Python/build/build.py on lines 1353..1358

                                                        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

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

                                                                if Proc.stderr:
                                                                    StdErrThread = Thread(target=ReadMessage, args=(Proc.stderr, EdkLogger.quiet, EndOfProcedure))
                                                                    StdErrThread.setName("STDERR-Redirector")
                                                                    StdErrThread.setDaemon(False)
                                                                    StdErrThread.start()
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 256..260

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 53.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                if Proc.stdout:
                                                                    StdOutThread = Thread(target=ReadMessage, args=(Proc.stdout, EdkLogger.info, EndOfProcedure))
                                                                    StdOutThread.setName("STDOUT-Redirector")
                                                                    StdOutThread.setDaemon(False)
                                                                    StdOutThread.start()
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 2 hrs to fix
                                                        BaseTools/Source/Python/build/build.py on lines 262..266

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 53.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                        if __name__ == '__main__':
                                                            r = Main()
                                                            ## 0-127 is a safe return range, and 1 is a standard default error
                                                            if r < 0 or r > 127: r = 1
                                                            sys.exit(r)
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 4 other locations - About 2 hrs to fix
                                                        BaseTools/Source/Python/BPDG/BPDG.py on lines 153..157
                                                        BaseTools/Source/Python/GenFds/GenFds.py on lines 533..537
                                                        BaseTools/Source/Python/Trim/Trim.py on lines 604..608
                                                        BaseTools/Source/Python/UPT/UPT.py on lines 232..239

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 52.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        Wa = WorkspaceAutoGen(
                                                                                self.WorkspaceDir,
                                                                                self.PlatformFile,
                                                                                BuildTarget,
                                                                                ToolChain,
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1224..1239

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 49.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        Wa = WorkspaceAutoGen(
                                                                                self.WorkspaceDir,
                                                                                self.PlatformFile,
                                                                                BuildTarget,
                                                                                ToolChain,
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1387..1402

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

                                                            if EdkSourceDir.upper().find(WorkspaceDir.upper()) != 0:
                                                                EdkLogger.error("build", PARAMETER_INVALID, "EDK_SOURCE is not under WORKSPACE",
                                                                                ExtraData="WORKSPACE = %s\n    EDK_SOURCE = %s" % (WorkspaceDir, EdkSourceDir))
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 153..155
                                                        BaseTools/Source/Python/build/build.py on lines 159..161

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

                                                            if EfiSourceDir.upper().find(WorkspaceDir.upper()) != 0:
                                                                EdkLogger.error("build", PARAMETER_INVALID, "EFI_SOURCE is not under WORKSPACE",
                                                                                ExtraData="WORKSPACE = %s\n    EFI_SOURCE = %s" % (WorkspaceDir, EfiSourceDir))
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 156..158
                                                        BaseTools/Source/Python/build/build.py on lines 159..161

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

                                                            if EcpSourceDir.upper().find(WorkspaceDir.upper()) != 0:
                                                                EdkLogger.error("build", PARAMETER_INVALID, "ECP_SOURCE is not under WORKSPACE",
                                                                                ExtraData="WORKSPACE = %s\n    ECP_SOURCE = %s" % (WorkspaceDir, EcpSourceDir))
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 2 other locations - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 153..155
                                                        BaseTools/Source/Python/build/build.py on lines 156..158

                                                        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

                                                                        if not ModuleIsPatch:
                                                                            for Pcd in Module.LibraryPcdList:
                                                                                if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
                                                                                    ModuleIsPatch = True
                                                                                    break
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1121..1124

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 39.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                        for Pcd in Module.ModulePcdList:
                                                                            if Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
                                                                                ModuleIsPatch = True
                                                                                break
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 1 hr to fix
                                                        BaseTools/Source/Python/build/build.py on lines 1125..1129

                                                        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

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

                                                            if "ECP_SOURCE" not in os.environ:
                                                                os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 50 mins to fix
                                                        BaseTools/Source/Python/Ecc/Ecc.py on lines 71..72

                                                        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

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

                                                                if not BuildCommand:
                                                                    EdkLogger.error("build", OPTION_MISSING,
                                                                                    "No build command found for this module. "
                                                                                    "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %
                                                                                        (Obj.BuildTarget, Obj.ToolChain, Obj.Arch),
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 45 mins to fix
                                                        BaseTools/Source/Python/build/build.py on lines 897..902

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 35.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                                if BuildCommand == None or len(BuildCommand) == 0:
                                                                    EdkLogger.error("build", OPTION_MISSING,
                                                                                    "No build command found for this module. "
                                                                                    "Please check your setting of %s_%s_%s_MAKE_PATH in Conf/tools_def.txt file." %
                                                                                        (AutoGenObject.BuildTarget, AutoGenObject.ToolChain, AutoGenObject.Arch),
                                                        Severity: Minor
                                                        Found in BaseTools/Source/Python/build/build.py and 1 other location - About 45 mins to fix
                                                        BaseTools/Source/Python/build/build.py on lines 313..318

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 35.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                            if "EFI_SOURCE" not in os.environ:
                                                                os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 3 other locations - About 35 mins to fix
                                                        BaseTools/Source/Python/Ecc/Ecc.py on lines 73..74
                                                        BaseTools/Source/Python/Ecc/Ecc.py on lines 75..76
                                                        BaseTools/Source/Python/build/build.py on lines 113..114

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 33.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

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

                                                            if "EDK_SOURCE" not in os.environ:
                                                                os.environ["EDK_SOURCE"] = os.environ["ECP_SOURCE"]
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/build/build.py and 3 other locations - About 35 mins to fix
                                                        BaseTools/Source/Python/Ecc/Ecc.py on lines 73..74
                                                        BaseTools/Source/Python/Ecc/Ecc.py on lines 75..76
                                                        BaseTools/Source/Python/build/build.py on lines 111..112

                                                        Duplicated Code

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

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

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

                                                        Tuning

                                                        This issue has a mass of 33.

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

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

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

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

                                                        Refactorings

                                                        Further Reading

                                                        There are no issues that match your filters.

                                                        Category
                                                        Status