hackedteam/vector-edk

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

Summary

Maintainability
F
2 mos
Test Coverage

File AutoGen.py has 2180 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Generate AutoGen.h, AutoGen.c and *.depex files
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
Severity: Major
Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 6 days to fix

    Function CollectPlatformDynamicPcds has a Cognitive Complexity of 210 (exceeds 5 allowed). Consider refactoring.
    Open

        def CollectPlatformDynamicPcds(self):
            # for gathering error information
            NoDatumTypePcdList = set()
    
            self._GuidValue = {}
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 4 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 CreateAsBuiltInf has a Cognitive Complexity of 177 (exceeds 5 allowed). Consider refactoring.
    Open

        def CreateAsBuiltInf(self):
            if self.IsAsBuiltInfCreated:
                return
                
            # Skip the following code for EDK I inf
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 3 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 _ExpandBuildOption has a Cognitive Complexity of 169 (exceeds 5 allowed). Consider refactoring.
    Open

        def _ExpandBuildOption(self, Options, ModuleStyle=None):
            BuildOptions = {}
            FamilyMatch  = False
            FamilyIsNull = True
                    
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 3 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 _CheckDuplicateInFV has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
    Open

        def _CheckDuplicateInFV(self, Fdf):
            for Fv in Fdf.Profile.FvDict:
                _GuidDict = {}
                for FfsFile in Fdf.Profile.FvDict[Fv].FfsList:
                    if FfsFile.InfFileName and FfsFile.NameGuid == None:
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.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 ApplyLibraryInstance has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
    Open

        def ApplyLibraryInstance(self, Module):
            ModuleType = Module.ModuleType
    
            # for overridding library instances with module specific setting
            PlatformModule = self.Platform.Modules[str(Module)]
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetToolDefinition has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GetToolDefinition(self):
            if self._ToolDefinitions == None:
                ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDictionary
                if TAB_TOD_DEFINES_COMMAND_TYPE not in self.Workspace.ToolDef.ToolsDefTxtDatabase:
                    EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No tools found in configuration",
    Severity: Minor
    Found in BaseTools/Source/Python/AutoGen/AutoGen.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

    ModuleAutoGen has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ModuleAutoGen(AutoGen):
        ## The real constructor of ModuleAutoGen
        #
        #  This method is not supposed to be called by users of ModuleAutoGen. It's
        #  only used by factory method __new__() to do real initialization work for an
    Severity: Major
    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 7 hrs to fix

      Function _Init has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

          def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,
                    BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None, 
                    Progress=None, BuildModule=None):
              if Fds is None:
                  Fds = []
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _CheckAllPcdsTokenValueConflict has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

          def _CheckAllPcdsTokenValueConflict(self):
              for Pa in self.AutoGenObjectList:
                  for Package in Pa.PackageList:
                      PcdList = Package.Pcds.values()
                      PcdList.sort(lambda x, y: cmp(x.TokenValue, y.TokenValue)) 
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _GetPcdTokenNumbers has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          def _GetPcdTokenNumbers(self):
              if self._PcdTokenNumber == None:
                  self._PcdTokenNumber = sdict()
                  TokenNumber = 1
                  #
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _OverridePcd has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
      Open

          def _OverridePcd(self, ToPcd, FromPcd, Module=""):
              #
              # in case there's PCDs coming from FDF file, which have no type given.
              # at this point, ToPcd.Type has the type found from dependent
              # package
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      PlatformAutoGen has 39 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class PlatformAutoGen(AutoGen):
          #
          # Used to store all PCDs for both PEI and DXE phase, in order to generate 
          # correct PCD database
          # 
      Severity: Minor
      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 5 hrs to fix

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

            def _ApplyBuildRule(self, File, FileType):
                if self._BuildTargets == None:
                    self._IntroBuildTargetList = set()
                    self._FinalBuildTargetList = set()
                    self._BuildTargets = {}
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            def _GetDepexTokenList(self):
                if self._DepexList == None:
                    self._DepexList = {}
                    if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
                        return self._DepexList
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function _GetBuildOptionIncPathList has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetBuildOptionIncPathList(self):
                if self._BuildOptionIncPathList == None:
                    #
                    # Regular expression for finding Include Directories, the difference between MSFT and INTEL/GCC/RVCT
                    # is the former use /I , the Latter used -I to specify include directories
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 CollectFixedAtBuildPcds has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            def CollectFixedAtBuildPcds(self):
                for LibAuto in self.LibraryAutoGenList:
                    FixedAtBuildPcds = {}  
                    ShareFixedAtBuildPcdsSameValue = {} 
                    for Module in LibAuto._ReferenceModules:                
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 ApplyBuildOption has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def ApplyBuildOption(self, Module):
                # Get the different options for the different style module
                if Module.AutoGenVersion < 0x00010005:
                    PlatformOptions = self.EdkBuildOption
                else:
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetBuildRules has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetBuildRules(self):
                if self._BuildRules == None:
                    BuildRules = {}
                    BuildRuleDatabase = self.PlatformInfo.BuildRule
                    for Type in BuildRuleDatabase.FileTypeList:
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _CheckPcdDefineAndType has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _CheckPcdDefineAndType(self):
                PcdTypeList = [
                    "FixedAtBuild", "PatchableInModule", "FeatureFlag",
                    "Dynamic", #"DynamicHii", "DynamicVpd",
                    "DynamicEx", # "DynamicExHii", "DynamicExVpd"
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetDepexExpressionTokenList has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetDepexExpressionTokenList(self):
                if self._DepexExpressionList == None:
                    self._DepexExpressionList = {}
                    if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in self.FileTypes:
                        return self._DepexExpressionList
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetIncludePathList has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _GetIncludePathList(self):
                if self._IncludePathList == None:
                    self._IncludePathList = []
                    if self.AutoGenVersion < 0x00010005:
                        for Inc in self.Module.Includes:
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 CreateCodeFile has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

            def CreateCodeFile(self, CreateLibraryCodeFile=True):
                if self.IsCodeFileCreated:
                    return
        
                # Need to generate PcdDatabase even PcdDriver is binarymodule
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 ResolveLibraryReference has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            def ResolveLibraryReference(self, Module):
                EdkLogger.verbose("")
                EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(Module), self.Arch))
                LibraryConsumerList = [Module]
        
        Severity: Minor
        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _Init has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _Init(self, Workspace, ModuleFile, Target, Toolchain, Arch, PlatformFile):
                EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" % (ModuleFile, Arch))
                GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (ModuleFile, Arch, Toolchain, Target)
        
                self.Workspace = Workspace
        Severity: Major
        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 2 hrs to fix

          Function ApplyPcdSetting has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def ApplyPcdSetting(self, Module, Pcds):
                  # for each PCD in module
                  for Name,Guid in Pcds:
                      PcdInModule = Pcds[Name,Guid]
                      # find out the PCD setting in platform
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetLibraryPcdList has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetLibraryPcdList(self):
                  if self._LibraryPcdList == None:
                      Pcds = sdict()
                      if not self.IsLibrary:
                          # get PCDs from dependent libraries
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/AutoGen.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 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,
          Severity: Major
          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 2 hrs to fix

            Function _GetCustomMakefile has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                def _GetCustomMakefile(self):
                    if self._CustomMakefile == None:
                        self._CustomMakefile = {}
                        for Type in self.Module.CustomMakefile:
                            if Type in gMakeTypeMap:
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 1 hr to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function _Init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def _Init(self, Workspace, PlatformFile, Target, Toolchain, Arch):
                    EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen platform [%s] [%s]" % (PlatformFile, Arch))
                    GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (PlatformFile, Arch, Toolchain, Target)
            
                    self.MetaFile = PlatformFile
            Severity: Minor
            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 1 hr to fix

              Function _Init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,
                            BuildConfig, ToolDefinition, FlashDefinitionFile='', Fds=None, Fvs=None, Caps=None, SkuId='', UniFlag=None, 
                            Progress=None, BuildModule=None):
                      if Fds is None:
                          Fds = []
              Severity: Minor
              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 1 hr to fix

                Function _GetSourceFileList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _GetSourceFileList(self):
                        if self._SourceFileList == None:
                            self._SourceFileList = []
                            for F in self.Module.Sources:
                                # match tool chain
                Severity: Minor
                Found in BaseTools/Source/Python/AutoGen/AutoGen.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 CreateAsBuiltInf has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def CreateAsBuiltInf(self):
                        if self.IsAsBuiltInfCreated:
                            return
                            
                        # Skip the following code for EDK I inf
                Severity: Minor
                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 1 hr to fix

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

                      def _GetAutoGenFileList(self):
                          UniStringAutoGenC = True
                          UniStringBinBuffer = StringIO()
                          if self.BuildType == 'UEFI_HII':
                              UniStringAutoGenC = False
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetAutoGenObjectList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _GetAutoGenObjectList(self):
                          self._ModuleAutoGenList = []
                          self._LibraryAutoGenList = []
                          for ModuleFile in self.Platform.Modules:
                              Ma = ModuleAutoGen(
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetBuildRule has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _GetBuildRule(self):
                          if self._BuildRule == None:
                              BuildRuleFile = None
                              if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.TargetTxtDictionary:
                                  BuildRuleFile = self.Workspace.TargetTxt.TargetTxtDictionary[TAB_TAT_DEFINES_BUILD_RULE_CONF]
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetFixedAtBuildPcds has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _GetFixedAtBuildPcds(self):
                          if self._FixedAtBuildPcds:
                              return self._FixedAtBuildPcds
                          for Pcd in self.ModulePcdList:
                              if self.IsLibrary:
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetBuildCommand has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _GetBuildCommand(self):
                          if self._BuildCommand == None:
                              self._BuildCommand = []
                              if "MAKE" in self.ToolDefinition and "PATH" in self.ToolDefinition["MAKE"]:
                                  self._BuildCommand += SplitOption(self.ToolDefinition["MAKE"]["PATH"])
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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 _GetLibraryAutoGenList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _GetLibraryAutoGenList(self):
                          if self._LibraryAutoGenList == None:
                              self._LibraryAutoGenList = []
                              for Library in self.DependentLibraryList:
                                  La = ModuleAutoGen(
                  Severity: Minor
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.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

                  Consider simplifying this complex logical expression.
                  Open

                              if ToPcd.Pending and FromPcd.Type not in [None, '']:
                                  ToPcd.Type = FromPcd.Type
                              elif (ToPcd.Type not in [None, '']) and (FromPcd.Type not in [None, ''])\
                                  and (ToPcd.Type != FromPcd.Type) and (ToPcd.Type in FromPcd.Type):
                                  if ToPcd.Type.strip() == "DynamicEx":
                  Severity: Major
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 1 hr to fix

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

                        def CreateMakeFile(self, CreateLibraryMakeFile=True):
                            if self.IsMakeFileCreated:
                                return
                    
                            if not self.IsLibrary and CreateLibraryMakeFile:
                    Severity: Minor
                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        def __new__(Class, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
                            # check if the object has been created
                            Key = (Target, Toolchain)
                            if Key not in Class._CACHE_ or Arch not in Class._CACHE_[Key] \
                               or MetaFile not in Class._CACHE_[Key][Arch]:
                    Severity: Minor
                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                        def __new__(Class, Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs):
                    Severity: Major
                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 50 mins to fix

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

                          def _Init(self, Workspace, ModuleFile, Target, Toolchain, Arch, PlatformFile):
                      Severity: Minor
                      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

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

                            def _GetLibraryList(self):
                                if self._DependentLibraryList == None:
                                    # only merge library classes and PCD for non-library module
                                    if self.IsLibrary:
                                        self._DependentLibraryList = []
                        Severity: Minor
                        Found in BaseTools/Source/Python/AutoGen/AutoGen.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 InfFoundFlag:
                                                    break
                                                for Module in Pa.ModuleAutoGenList:
                        Severity: Major
                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if FfsFile.InfFileName.find('$') == -1:
                                                      InfPath = NormPath(FfsFile.InfFileName)
                                                      if not os.path.exists(InfPath):
                                                          EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))
                                                          
                          Severity: Major
                          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if FixedAtBuildPcds[key] != Pcd.DefaultValue:
                                                        ShareFixedAtBuildPcdsSameValue[key] = False      
                                        for Pcd in LibAuto.FixedAtBuildPcds:
                            Severity: Major
                            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if Node in Constructor:
                                                          continue
                                                      # remove edge e from the graph if Node has no constructor
                                                      ConsumedByList[Item].remove(Node)
                              Severity: Major
                              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ToolChain1 == ToolChain2 or ToolChain1 == "*" or ToolChain2 == "*":
                                                            if Arch1 == Arch2 or Arch1 == "*" or Arch2 == "*":
                                                                if CommandType1 == CommandType2 or CommandType1 == "*" or CommandType2 == "*":
                                                                    if Attr1 == Attr2 or Attr1 == "*" or Attr2 == "*":
                                                                        if self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):
                                Severity: Major
                                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          for Pa in self.AutoGenObjectList:
                                                              if not PcdFoundFlag:
                                                                  for PcdItem in Pa.AllPcdList:
                                                                      if (PcdItem.TokenSpaceGuidCName + "." + PcdItem.TokenCName) == _PcdName:
                                                                          #
                                  Severity: Major
                                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            for VpdPcd in VpdFile._VpdArray.keys():
                                                                # This PCD has been referenced by module
                                                                if (VpdPcd.TokenSpaceGuidCName == DscPcdEntry.TokenSpaceGuidCName) and \
                                                                   (VpdPcd.TokenCName == DscPcdEntry.TokenCName):
                                                                        FoundFlag = True
                                    Severity: Major
                                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if Arch == self.Arch or Arch == "*":
                                                                  if Options[Key].startswith("="):
                                                                      if OverrideList.get(Key[1]) != None:                                                
                                                                          OverrideList.pop(Key[1])
                                                                      OverrideList[Key[1]] = Options[Key]
                                      Severity: Major
                                      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                for Index in range(0, len(PcdValue)):
                                                                    if Unicode:
                                                                        CharVal = ord(PcdValue[Index])
                                                                        NewValue = NewValue + '0x%02x' % (CharVal & 0x00FF) + ', ' \
                                                                                + '0x%02x' % (CharVal >> 8) + ', '
                                        Severity: Major
                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  while (SameTokenValuePcdListCount < len(SameTokenValuePcdList) - 1):
                                                                      TemListItem     = SameTokenValuePcdList[SameTokenValuePcdListCount]
                                                                      TemListItemNext = SameTokenValuePcdList[SameTokenValuePcdListCount + 1] 
                                                                                                                                                
                                                                      if (TemListItem.TokenSpaceGuidCName == TemListItemNext.TokenSpaceGuidCName) and (TemListItem.TokenCName != TemListItemNext.TokenCName):
                                          Severity: Major
                                          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
                                                                        BuildOptions[Tool][Attr] = Options[Key]
                                                                    else:
                                                                        # append options for the same tool
                                                                        BuildOptions[Tool][Attr] += " " + Options[Key]
                                            Severity: Major
                                            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if PcdValue[0] == 'L':
                                                                          Unicode = True
                                                                      PcdValue = PcdValue.lstrip('L')
                                              Severity: Major
                                              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if (Pcd[0], Pcd[1], Type) in Package.Pcds:
                                                                            EdkLogger.error(
                                                                                'build',
                                                                                FORMAT_INVALID,
                                                                                "Type [%s] of PCD [%s.%s] in DSC file doesn't match the type [%s] defined in DEC file." \
                                                Severity: Major
                                                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          if Comment.find(Usage) != -1:
                                                                              UsageIndex = Index
                                                                              break
                                                                  if UsageIndex != -1:
                                                  Severity: Major
                                                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            for Pcd in self._DynamicPcdList:
                                                                                # just pick the a value to determine whether is unicode string type
                                                                                i = 0
                                                                                for (SkuName,Sku) in Pcd.SkuInfoList.items():                        
                                                                                    if Sku.VpdOffset == "*":
                                                    Severity: Major
                                                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                              if Tool == "MAKE":
                                                                                  if Attr == "FLAGS":
                                                                                      MakeFlags = Value
                                                                              else:
                                                                                  ToolsDef += "%s_%s = %s\n" % (Tool, Attr, Value)
                                                      Severity: Major
                                                      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                if LibraryName.upper() == Key.upper():
                                                                                    Library = self.Platform.LibraryClasses[Key, ':dummy:']
                                                                                    break
                                                                            if Library == None:
                                                        Severity: Major
                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                  if self.BuildOption[Tool][Attr].startswith('='):
                                                                                      Value = self.BuildOption[Tool][Attr][1:]
                                                                                  else:
                                                                                      Value += " " + self.BuildOption[Tool][Attr]
                                                          
                                                          Severity: Major
                                                          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                    if DepexExpressionList != '':
                                                                                        DepexExpressionList += ' AND '
                                                                                    DepexExpressionList += '('
                                                            Severity: Major
                                                            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      for Module in Pa.ModuleAutoGenList:
                                                                                          if path.normpath(Module.MetaFile.File) == path.normpath(FfsFile.InfFileName):
                                                                                              InfFoundFlag = True
                                                                                              if not Module.Guid.upper() in _GuidDict.keys():
                                                                                                  _GuidDict[Module.Guid.upper()] = FfsFile
                                                              Severity: Major
                                                              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        for ValueSameCount in range(RemainPcdListLength):
                                                                                            if PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount].TokenValue == Item.TokenValue:
                                                                                                SameTokenValuePcdList.append(PcdList[len(PcdList) - RemainPcdListLength + ValueSameCount])
                                                                                            else:
                                                                                                break;
                                                                Severity: Major
                                                                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          if DepexList != []:
                                                                                              DepexList.append('AND')
                                                                                          DepexList.append('(')
                                                                  Severity: Major
                                                                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            if self.ModuleType != self.BuildType:
                                                                                                RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.ToolChainFamily]
                                                                                    if not RuleObject:
                                                                    Severity: Major
                                                                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              if Key in self.Module.Pcds or Key in Pcds:
                                                                                                  continue
                                                                                              Pcds[Key] = copy.copy(Library.Pcds[Key])
                                                                      Severity: Major
                                                                      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if ArraySize < (len(PcdValue) + 1):
                                                                                                    EdkLogger.error("build", AUTOGEN_ERROR,
                                                                                                                    "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)
                                                                                                                    )
                                                                                                if ArraySize > len(PcdValue) + 1:
                                                                        Severity: Major
                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  if Tool == "MAKE":
                                                                                                      MakePath = Value
                                                                                                  else:
                                                                                                      ToolsDef += "%s = %s\n" % (Tool, Value)
                                                                                              elif Attr != "DLL":
                                                                          Severity: Major
                                                                          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if DepexList[-1] == 'END':  # no need of a END at this time
                                                                                                        DepexList.pop()
                                                                                                    DepexList.append(')')
                                                                            Severity: Major
                                                                            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                      if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
                                                                                                          NeedProcessVpdMapFile = True
                                                                                                          if self.Platform.VpdToolGuid == None or self.Platform.VpdToolGuid == '':
                                                                                                              EdkLogger.error("Build", FILE_NOT_FOUND, \
                                                                                                                              "Fail to find third-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")
                                                                              Severity: Major
                                                                              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                        if Tool not in BuildOptions:
                                                                                                            BuildOptions[Tool] = {}
                                                                                                        if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
                                                                                Severity: Major
                                                                                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                          if not FoundFlag :
                                                                                                              # just pick the a value to determine whether is unicode string type
                                                                                                              for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items():
                                                                                                                  Sku.VpdOffset = Sku.VpdOffset.strip() 
                                                                                                                  
                                                                                  Severity: Major
                                                                                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                            if (Path not in self.IncludePathList) and (CommonPath([Path, self.MetaFile.Dir]) != self.MetaFile.Dir):
                                                                                                                ErrMsg = "The include directory for the EDK II module in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool, FlagOption) 
                                                                                                                EdkLogger.error("build", 
                                                                                                                                PARAMETER_INVALID,
                                                                                                                                ExtraData = ErrMsg, 
                                                                                    Severity: Major
                                                                                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                              if Tool not in BuildOptions:
                                                                                                                  BuildOptions[Tool] = {}
                                                                                                              if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
                                                                                      Severity: Major
                                                                                      Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if ConsumedByList[Item] == []:
                                                                                                                    # insert Item into Q
                                                                                                                    Q.insert(0, Item)
                                                                                                                    break
                                                                                                            if Q != []:
                                                                                        Severity: Major
                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                                  if ArraySize > len(PcdValue) + 1:
                                                                                                                      NewValue = NewValue + Padding * (ArraySize - len(PcdValue) - 1)
                                                                                                                  PcdValue = NewValue + Padding.strip().rstrip(',') + '}'
                                                                                          Severity: Major
                                                                                          Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                    if ToolDef.has_key("GUID") and ToolDef["GUID"] == self.Platform.VpdToolGuid:
                                                                                                                        if not ToolDef.has_key("PATH"):
                                                                                                                            EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "PATH attribute was not provided for BPDG guid tool %s in tools_def.txt" % self.Platform.VpdToolGuid)
                                                                                                                        BPDGToolName = ToolDef["PATH"]
                                                                                                                        break
                                                                                            Severity: Major
                                                                                            Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                      if LibraryPath == None or LibraryPath == "":
                                                                                                                          EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,
                                                                                                                                          "Instance of library class [%s] is not found" % LibraryClassName,
                                                                                                                                          File=self.MetaFile,
                                                                                                                                          ExtraData="in [%s] [%s]\n\tconsumed by module [%s]" % (str(M), self.Arch, str(Module)))
                                                                                              Severity: Major
                                                                                              Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if Attr != "FLAGS" or Attr not in BuildOptions[Tool]:
                                                                                                                            BuildOptions[Tool][Attr] = Options[Key]
                                                                                                                        else:
                                                                                                                            # append options for the same tool
                                                                                                                            BuildOptions[Tool][Attr] += " " + Options[Key]
                                                                                                Severity: Major
                                                                                                Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                          if Unicode:
                                                                                                                              Padding = Padding * 2
                                                                                                                              ArraySize = ArraySize / 2
                                                                                                                          if ArraySize < (len(PcdValue) + 1):
                                                                                                  Severity: Major
                                                                                                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 45 mins to fix

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

                                                                                                        def _Init(self, Workspace, PlatformFile, Target, Toolchain, Arch):
                                                                                                    Severity: Minor
                                                                                                    Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 35 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

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

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

                                                                                                            def CreateMakeFile(self, CreateModuleMakeFile=False):
                                                                                                                if CreateModuleMakeFile:
                                                                                                                    for ModuleFile in self.Platform.Modules:
                                                                                                                        Ma = ModuleAutoGen(self.Workspace, ModuleFile, self.BuildTarget,
                                                                                                                                           self.ToolChain, self.Arch, self.MetaFile)
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 25 mins to fix

                                                                                                        Cognitive Complexity

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

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

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

                                                                                                        Further reading

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

                                                                                                            def _GetBinaryFiles(self):
                                                                                                                if self._BinaryFileList == None:
                                                                                                                    self._BinaryFileList = []
                                                                                                                    for F in self.Module.Binaries:
                                                                                                                        if F.Target not in ['COMMON', '*'] and F.Target != self.BuildTarget:
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 25 mins to fix

                                                                                                        Cognitive Complexity

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

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

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

                                                                                                        Further reading

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

                                                                                                            def _GetDerivedPackageList(self):
                                                                                                                PackageList = []
                                                                                                                for M in [self.Module] + self.DependentLibraryList:
                                                                                                                    for Package in M.Packages:
                                                                                                                        if Package in PackageList:
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.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

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

                                                                                                                while True:
                                                                                                                    EdgeRemoved = True
                                                                                                                    while Q == [] and EdgeRemoved:
                                                                                                                        EdgeRemoved = False
                                                                                                                        # for each node Item with a Constructor
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 2 days to fix
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 157..197

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

                                                                                                        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 Target == "*" or Target == self.BuildTarget:
                                                                                                                        if Tag == "*" or Tag == self.ToolChain:
                                                                                                                            if Arch == "*" or Arch == self.Arch:
                                                                                                                                if Tool not in BuildOptions:
                                                                                                                                    BuildOptions[Tool] = {}
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 day to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1880..1889

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

                                                                                                        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 Target == "*" or Target == self.BuildTarget:
                                                                                                                        if Tag == "*" or Tag == self.ToolChain:
                                                                                                                            if Arch == "*" or Arch == self.Arch:
                                                                                                                                if Tool not in BuildOptions:
                                                                                                                                    BuildOptions[Tool] = {}
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 day to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1848..1857

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetToolChainFamily(self):
                                                                                                                if self._ToolChainFamily == None:
                                                                                                                    ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase
                                                                                                                    if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \
                                                                                                                       or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 day to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1262..1273

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 128.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetBuildRuleFamily(self):
                                                                                                                if self._BuildRuleFamily == None:
                                                                                                                    ToolDefinition = self.Workspace.ToolDef.ToolsDefTxtDatabase
                                                                                                                    if TAB_TOD_DEFINES_BUILDRULEFAMILY not in ToolDefinition \
                                                                                                                       or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY] \
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 day to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1249..1260

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 128.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                            if not FfsFile.NameGuid.upper() in _GuidDict.keys():
                                                                                                                                _GuidDict[FfsFile.NameGuid.upper()] = FfsFile
                                                                                                                            else:
                                                                                                                                #
                                                                                                                                # Two raw file GUID conflict.
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 6 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 407..417

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

                                                                                                        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 InfObj.Guid.upper() in _GuidDict.keys():
                                                                                                                                        _GuidDict[InfObj.Guid.upper()] = FfsFile
                                                                                                                                    else:
                                                                                                                                        EdkLogger.error("build", 
                                                                                                                                                        FORMAT_INVALID,
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 6 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 471..484

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    for Pcd in self.DynamicPcdList:
                                                                                                                        if Pcd.Phase == "PEI":
                                                                                                                            if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:
                                                                                                                                EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
                                                                                                                                self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 3 other locations - About 5 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1367..1372
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1374..1379
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1381..1386

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    for Pcd in self.DynamicPcdList:
                                                                                                                        if Pcd.Phase == "PEI":
                                                                                                                            if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:
                                                                                                                                EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
                                                                                                                                self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 3 other locations - About 5 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1360..1365
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1374..1379
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1381..1386

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    for Pcd in self.DynamicPcdList:
                                                                                                                        if Pcd.Phase == "DXE":
                                                                                                                            if Pcd.Type in ["DynamicEx", "DynamicExDefault", "DynamicExVpd", "DynamicExHii"]:
                                                                                                                                EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
                                                                                                                                self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 3 other locations - About 5 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1360..1365
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1367..1372
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1374..1379

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    for Pcd in self.DynamicPcdList:
                                                                                                                        if Pcd.Phase == "DXE":
                                                                                                                            if Pcd.Type in ["Dynamic", "DynamicDefault", "DynamicVpd", "DynamicHii"]:
                                                                                                                                EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))
                                                                                                                                self._PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] = TokenNumber
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 3 other locations - About 5 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1360..1365
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1367..1372
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1381..1386

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetGuidList(self):
                                                                                                                if self._GuidList == None:
                                                                                                                    self._GuidList = self.Module.Guids
                                                                                                                    for Library in self.DependentLibraryList:
                                                                                                                        self._GuidList.update(Library.Guids)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 4 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2705..2712
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2718..2725

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 85.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetPpiList(self):
                                                                                                                if self._PpiList == None:
                                                                                                                    self._PpiList = self.Module.Ppis
                                                                                                                    for Library in self.DependentLibraryList:
                                                                                                                        self._PpiList.update(Library.Ppis)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 4 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2685..2692
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2705..2712

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 85.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetProtocolList(self):
                                                                                                                if self._ProtocolList == None:
                                                                                                                    self._ProtocolList = self.Module.Protocols
                                                                                                                    for Library in self.DependentLibraryList:
                                                                                                                        self._ProtocolList.update(Library.Protocols)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 4 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2685..2692
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2718..2725

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 85.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if ModuleStyle != None and len (Key) > 2:
                                                                                                                        # Check Module style is EDK or EDKII.
                                                                                                                        # Only append build option for the matched style module.
                                                                                                                        if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:
                                                                                                                            continue
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 4 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1863..1868

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

                                                                                                        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 ModuleStyle != None and len (Key) > 2:
                                                                                                                        # Check Module style is EDK or EDKII.
                                                                                                                        # Only append build option for the matched style module.
                                                                                                                        if ModuleStyle == EDK_NAME and Key[2] != EDK_NAME:
                                                                                                                            continue
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 4 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1829..1834

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

                                                                                                        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 DscPcdEntry.DatumType == 'VOID*' and PcdValue.startswith("L"):
                                                                                                                                        UnicodePcdArray.append(DscPcdEntry)
                                                                                                                                    elif len(Sku.VariableName) > 0:
                                                                                                                                        HiiPcdArray.append(DscPcdEntry)
                                                                                                                                    else:
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 3 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 954..961

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

                                                                                                        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 Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):
                                                                                                                            # if found PCD which datum value is unicode string the insert to left size of UnicodeIndex
                                                                                                                            UnicodePcdArray.append(Pcd)
                                                                                                                        elif len(Sku.VariableName) > 0:
                                                                                                                            # if found HII type PCD then insert to right of UnicodeIndex
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 3 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1035..1040

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

                                                                                                        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 (Name, Guid) not in DecPcds:
                                                                                                                            EdkLogger.error(
                                                                                                                                'build',
                                                                                                                                PARSER_ERROR,
                                                                                                                                "PCD (%s.%s) used in FDF is not declared in DEC files." % (Guid, Name),
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 3 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 323..329

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 65.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                            elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:
                                                                                                                                EdkLogger.error(
                                                                                                                                        'build',
                                                                                                                                        PARSER_ERROR,
                                                                                                                                        "Using Dynamic or DynamicEx type of PCD [%s.%s] in FDF file is not allowed." % (Guid, Name),
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 3 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 308..314

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 65.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if Makefile.Generate():
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for module %s [%s]" %
                                                                                                                                    (self.Name, self.Arch))
                                                                                                                else:
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for module %s [%s]" %
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 2 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 666..671
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 848..853

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 59.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if Makefile.Generate():
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for platform [%s] [%s]\n" %
                                                                                                                                    (self.MetaFile, self.Arch))
                                                                                                                else:
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for platform [%s] [%s]\n" %
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 2 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 666..671
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 3027..3032

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 59.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if Makefile.Generate():
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Generated makefile for platform [%s] %s\n" %
                                                                                                                                    (self.MetaFile, self.ArchList))
                                                                                                                else:
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of makefile for platform [%s] %s\n" %
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 2 hrs to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 848..853
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 3027..3032

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 59.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                            elif LibraryModule.LibraryClass == None \
                                                                                                                                 or len(LibraryModule.LibraryClass) == 0 \
                                                                                                                                 or (ModuleType != 'USER_DEFINED'
                                                                                                                                     and ModuleType not in LibraryModule.LibraryClass[0].SupModList):
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 2 hrs to fix
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 114..117

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 54.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                for LibraryClassName in LibraryInstance:
                                                                                                                    M = LibraryInstance[LibraryClassName]
                                                                                                                    LibraryList.append(M)
                                                                                                                    if ConsumedByList[M] == []:
                                                                                                                        Q.append(M)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 2 hrs to fix
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 148..152

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetDebugDir(self):
                                                                                                                if self._DebugDir == None:
                                                                                                                    self._DebugDir = path.join(self.BuildDir, "DEBUG")
                                                                                                                    CreateDirectory(self._DebugDir)
                                                                                                                return self._DebugDir
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2199..2203

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 48.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetOutputDir(self):
                                                                                                                if self._OutputDir == None:
                                                                                                                    self._OutputDir = path.join(self.BuildDir, "OUTPUT")
                                                                                                                    CreateDirectory(self._OutputDir)
                                                                                                                return self._OutputDir
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2206..2210

                                                                                                        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

                                                                                                                                SameTokenValuePcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName))) 
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 639..639

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 47.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                        PcdList.sort(lambda x, y: cmp("%s.%s"%(x.TokenSpaceGuidCName, x.TokenCName), "%s.%s"%(y.TokenSpaceGuidCName, y.TokenCName)))
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 620..620

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 47.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if self._BuildTargets == None:
                                                                                                                    self._IntroBuildTargetList = set()
                                                                                                                    self._FinalBuildTargetList = set()
                                                                                                                    self._BuildTargets = {}
                                                                                                                    self._FileTypes = {}
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2558..2562

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 44.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if self._BuildTargets == None:
                                                                                                                    self._IntroBuildTargetList = set()
                                                                                                                    self._FinalBuildTargetList = set()
                                                                                                                    self._BuildTargets = {}
                                                                                                                    self._FileTypes = {}
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2489..2493

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 44.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                            if not RuleObject:
                                                                                                                                # build type is always module type, but ...
                                                                                                                                if self.ModuleType != self.BuildType:
                                                                                                                                    RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.ToolChainFamily]
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2468..2471

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 44.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                        if not RuleObject:
                                                                                                                            # build type is always module type, but ...
                                                                                                                            if self.ModuleType != self.BuildType:
                                                                                                                                RuleObject = BuildRuleDatabase[Type, self.ModuleType, self.Arch, self.BuildRuleFamily]
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2475..2478

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 44.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if self.ModuleType in ['PEIM']:
                                                                                                                      AsBuiltInfDict['binary_item'] += ['PEI_DEPEX|' + self.Name + '.depex']
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2877..2878

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if self.ModuleType in ['DXE_SMM_DRIVER']:
                                                                                                                      AsBuiltInfDict['binary_item'] += ['SMM_DEPEX|' + self.Name + '.depex']
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2873..2874

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                        if M != Module:
                                                                                                                            if M in ConsumedByList[LibraryModule]:
                                                                                                                                continue
                                                                                                                            ConsumedByList[LibraryModule].append(M)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 990..993
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 135..138

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetEdkIIBuildOptions(self):
                                                                                                                if self._EdkIIBuildOption == None:
                                                                                                                    self._EdkIIBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDKII_NAME)
                                                                                                                return self._EdkIIBuildOption
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1282..1285

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 41.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            def _GetEdkBuildOptions(self):
                                                                                                                if self._EdkBuildOption == None:
                                                                                                                    self._EdkBuildOption = self._ExpandBuildOption(self.Platform.BuildOptions, EDK_NAME)
                                                                                                                return self._EdkBuildOption
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1288..1291

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 41.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if str(AutoGenH) != "":
                                                                                                                        AutoFile = PathClass(gAutoGenHeaderFileName, self.DebugDir)
                                                                                                                        self._AutoGenFileList[AutoFile] = str(AutoGenH)
                                                                                                                        self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2608..2611

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 40.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if str(AutoGenC) != "" and TAB_C_CODE_FILE in self.FileTypes:
                                                                                                                        AutoFile = PathClass(gAutoGenCodeFileName, self.DebugDir)
                                                                                                                        self._AutoGenFileList[AutoFile] = str(AutoGenC)
                                                                                                                        self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2612..2615

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 40.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                for LibraryClass in PlatformModule.LibraryClasses:
                                                                                                                    if LibraryClass.startswith("NULL"):
                                                                                                                        Module.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 1 hr to fix
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 86..88

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 39.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if self.FdTargetList:
                                                                                                                        EdkLogger.info("No flash definition file found. FD [%s] will be ignored." % " ".join(self.FdTargetList))
                                                                                                                        self.FdTargetList = []
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 50 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 286..288
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 289..291

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

                                                                                                                    if self.FvTargetList:
                                                                                                                        EdkLogger.info("No flash definition file found. FV [%s] will be ignored." % " ".join(self.FvTargetList))
                                                                                                                        self.FvTargetList = []
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 50 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 283..285
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 289..291

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

                                                                                                                    if self.CapTargetList:
                                                                                                                        EdkLogger.info("No flash definition file found. Capsule [%s] will be ignored." % " ".join(self.CapTargetList))
                                                                                                                        self.CapTargetList = []
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 50 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 283..285
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 286..288

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 36.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if ConsumedByList[Item] != [] and Item in Constructor and len(Constructor) > 1:
                                                                                                        Severity: Major
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 1088..1088
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 203..203

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 35.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2867..2867

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 35.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    File = Item.Target.Path.replace('\\','/').strip('/').replace(OutputDir,'').strip('/')
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2858..2858

                                                                                                        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 not os.path.exists(InfPath):
                                                                                                                                        EdkLogger.error('build', GENFDS_ERROR, "Non-existant Module %s !" % (FfsFile.InfFileName))
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/GenFds/FfsInfStatement.py on lines 154..155

                                                                                                        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 'PI_SPECIFICATION_VERSION' in self.Specification:
                                                                                                                  AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2850..2851

                                                                                                        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 'UEFI_SPECIFICATION_VERSION' in self.Specification:
                                                                                                                  AsBuiltInfDict['module_uefi_specification_version'] += [self.Specification['UEFI_SPECIFICATION_VERSION']]
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 2852..2853

                                                                                                        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 self.CalculatePriorityValue(NowKey) > self.CalculatePriorityValue(NextKey):
                                                                                                                                                    if Options.get((self.BuildRuleFamily, NextKey)) != None:  
                                                                                                                                                        Options.pop((self.BuildRuleFamily, NextKey))
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 45 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 1820..1825

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 35.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                            DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 40 mins to fix
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 49..50

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 34.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                        if LibraryModule.ConstructorList != [] and LibraryModule not in Constructor:
                                                                                                                            Constructor.append(LibraryModule)
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 2 other locations - About 30 mins to fix
                                                                                                        BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py on lines 985..986
                                                                                                        BaseTools/Source/Python/Workspace/WorkspaceCommon.py on lines 129..130

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 32.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if File.IsBinary and File == Source and self._BinaryFileList != None and File in self._BinaryFileList:
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 30 mins to fix
                                                                                                        BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py on lines 221..221

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 32.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if IgoredAutoGenList == []:
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Generated [%s] files for module %s [%s]" %
                                                                                                                                    (" ".join(AutoGenList), self.Name, self.Arch))
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 30 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 3090..3092

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 32.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                elif AutoGenList == []:
                                                                                                                    EdkLogger.debug(EdkLogger.DEBUG_9, "Skipped the generation of [%s] files for module %s [%s]" %
                                                                                                                                    (" ".join(IgoredAutoGenList), self.Name, self.Arch))
                                                                                                        Severity: Minor
                                                                                                        Found in BaseTools/Source/Python/AutoGen/AutoGen.py and 1 other location - About 30 mins to fix
                                                                                                        BaseTools/Source/Python/AutoGen/AutoGen.py on lines 3087..3089

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 32.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

                                                                                                        There are no issues that match your filters.

                                                                                                        Category
                                                                                                        Status