hackedteam/vector-edk

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

Summary

Maintainability
F
2 wks
Test Coverage

Function GenerateReport has a Cognitive Complexity of 147 (exceeds 5 allowed). Consider refactoring.
Open

    def GenerateReport(self, File, ModulePcdSet):
        if ModulePcdSet == None:
            #
            # For platform global PCD section
            #
Severity: Minor
Found in BaseTools/Source/Python/build/BuildReport.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

File BuildReport.py has 897 lines of code (exceeds 250 allowed). Consider refactoring.
Open

## @file
# Routines for generating build report.
#
# This module contains the functionality to generate build report after
# build all target completes successfully.
Severity: Major
Found in BaseTools/Source/Python/build/BuildReport.py - About 2 days to fix

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

        def __init__(self, Wa):
            self._MapFileName = os.path.join(Wa.BuildDir, Wa.Name + ".map")
            self._MapFileParsed = False
            self._EotToolInvoked = False
            self._FvDir = Wa.FvDir
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.py - About 1 day to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __init__(self, FdRegion, Wa):
            self.Type = FdRegion.RegionType
            self.BaseAddress = FdRegion.Offset
            self.Size = FdRegion.Size
            self.FvList = []
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 __init__ has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, Wa):
            self.AllPcds = {}
            self.MaxLen = 0
            if Wa.FdfProfile:
                self.FdfPcdSet = Wa.FdfProfile.PcdDict
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 GenerateReport has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenerateReport(self, File):
            FileWrite(File, gSubSectionStart)
            FileWrite(File, TAB_BRG_LIBRARY)
            if len(self.LibraryList) > 0:
                FileWrite(File, gSubSectionSep)
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 GenerateReport has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenerateReport(self, File, GlobalPcdReport, GlobalPredictionReport, GlobalDepexParser, ReportType):
            FileWrite(File, gSectionStart)
    
            FwReportFileName = os.path.join(self._BuildDir, "DEBUG", self.ModuleName + ".txt")
            if os.path.isfile(FwReportFileName):
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __init__(self, M):
            self.Depex = ""
            self._DepexFileName = os.path.join(M.BuildDir, "OUTPUT", M.Module.BaseName + ".depex") 
            ModuleType = M.ModuleType
            if not ModuleType:
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 FindIncludeFiles has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def FindIncludeFiles(Source, IncludePathList, IncludeFiles):
        FileContents = open(Source).read()
        #
        # Find header files with pattern #include "XXX.h" or #include <XXX.h>
        #
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __init__(self, Wa, MaList, ReportType):
            self._WorkspaceDir = Wa.WorkspaceDir
            self.PlatformName = Wa.Name
            self.PlatformDscPath = Wa.Platform
            self.Architectures = " ".join(Wa.ArchList)
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.py - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def __init__(self, M, ReportType):
            self.ModuleName = M.Module.BaseName
            self.ModuleInfPath = M.MetaFile.File
            self.FileGuid = M.Guid
            self.Size = 0
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 _GenerateFixedAddressReport has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenerateFixedAddressReport(self, File, Guid, NotifyList):
            self._ParseMapFile()
            FixedAddressList = self.FixedMapDict.get(Guid)
            if not FixedAddressList:
                return
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 _DiscoverNestedFvList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def _DiscoverNestedFvList(self, FvName, Wa):
            for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:
                for Section in Ffs.SectionList:
                    try:
                        for FvSection in Section.SectionList:
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 _InvokeEotTool has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def _InvokeEotTool(self):
            if self._EotToolInvoked:
                return
    
            self._EotToolInvoked = True
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, Wa):
            self._GuidDb = {}
            for Pa in Wa.AutoGenObjectList:
                for Package in Pa.PackageList:        
                    for Protocol in Package.Protocols:
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 GenerateReport has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenerateReport(self, File, BuildDuration, ReportType):
            FileWrite(File, "Platform Summary")
            FileWrite(File, "Platform Name:        %s" % self.PlatformName)
            FileWrite(File, "Platform DSC Path:    %s" % self.PlatformDscPath)
            FileWrite(File, "Architectures:        %s" % self.Architectures)
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 _GenerateReport has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def _GenerateReport(self, File, Title, Type, BaseAddress, Size=0, FvName=None):
            FileWrite(File, gSubSectionStart)
            FileWrite(File, Title)
            FileWrite(File, "Type:               %s" % Type)
            FileWrite(File, "Base Address:       0x%X" % BaseAddress)
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, ReportFile, ReportType):
            self.ReportFile = ReportFile
            if ReportFile:
                self.ReportList = []
                self.ReportType = []
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 FileLinesSplit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def FileLinesSplit(Content=None, MaxLength=None):
        ContentList = Content.split(TAB_LINE_BREAK)
        NewContent = ''
        NewContentList = []
        for Line in ContentList:
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, M):
            BuildOptions = {}
            #
            # Add build flags according to source file extension so that
            # irrelevant ones can be filtered out.
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 GenerateReport has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def GenerateReport(self, File, GlobalDepexParser):
            if not self.Depex:
                FileWrite(File, gSubSectionStart)
                FileWrite(File, TAB_DEPEX)
                FileWrite(File, gSubSectionEnd)
    Severity: Minor
    Found in BaseTools/Source/Python/build/BuildReport.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 (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in ModulePcdSet:
                                continue
                            InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]
    Severity: Major
    Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

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

          def _GenerateReport(self, File, Title, Type, BaseAddress, Size=0, FvName=None):
      Severity: Minor
      Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if DecDefaultValue == None:
                                    DecMatch = True
                                else:
                                    DecDefaultValueNumber = int(DecDefaultValue.strip(), 0)
                                    DecMatch = (DecDefaultValueNumber == PcdValueNumber)
        Severity: Major
        Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ModulePcdSet == None:
                                      FileWrite(File, "")
                                  FileWrite(File, Key)
          Severity: Major
          Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if InfDefault == "":
                                        InfDefault = None
                                if First:
            Severity: Major
            Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if DecDefaultValue == None:
                                          DecMatch = True
                                      else:
                                          DecMatch = (DecDefaultValue.strip() == PcdValue.strip())
              
              Severity: Major
              Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if DscDefaultValue == None:
                                            DscMatch = True
                                        else:
                                            DscMatch = (DscDefaultValue.strip() == PcdValue.strip())
                
                Severity: Major
                Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if InfDefaultValue == None:
                                              InfMatch = True
                                          else:
                                              InfMatch = (InfDefaultValue.strip() == PcdValue.strip())
                  
                  Severity: Major
                  Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for SkuInfo in Pcd.SkuInfoList.values():
                                                if TypeName in ('DYNHII', 'DEXHII'):
                                                    FileWrite(File, '%*s: %s: %s' % (self.MaxLen + 4, SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset))        
                                                else:
                                                    FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
                    Severity: Major
                    Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if EntryPoint == "_ModuleEntryPoint":
                                                  CCFlags = Module.BuildOption.get("CC", {}).get("FLAGS", "")
                                                  Match = gGlueLibEntryPoint.search(CCFlags)
                                                  if Match:
                                                      EntryPoint = Match.group(1)
                      Severity: Major
                      Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if DscMatch:
                                                    if (Pcd.TokenCName, Key) in self.FdfPcdSet:
                                                        FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                                                    else:
                                                        FileWrite(File, ' *P %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                        Severity: Major
                        Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if DscDefaultValue == None:
                                                      DscMatch = True
                                                  else:
                                                      DscDefaultValueNumber = int(DscDefaultValue.strip(), 0)
                                                      DscMatch = (DscDefaultValueNumber == PcdValueNumber)
                          Severity: Major
                          Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:
                                                        for Section in Ffs.SectionList:
                                                            try:
                                                                for FvSection in Section.SectionList:
                                                                    if FvSection.FvName in self._FvList:
                            Severity: Major
                            Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      for ModulePath in ModuleOverride:
                                                          ModuleDefault = ModuleOverride[ModulePath]
                                                          if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):
                                                              ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)
                                                              Match = (ModulePcdDefaultValueNumber == PcdValueNumber)
                              Severity: Major
                              Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if InfDefaultValue == None:
                                                            InfMatch = True
                                                        else:
                                                            InfDefaultValueNumber = int(InfDefaultValue.strip(), 0)
                                                            InfMatch = (InfDefaultValueNumber == PcdValueNumber)
                                Severity: Major
                                Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if FvName in self._FvList:
                                                              continue
                                                          self._FvList.append(FvName)
                                  Severity: Major
                                  Found in BaseTools/Source/Python/build/BuildReport.py - About 45 mins to fix

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

                                        def GenerateReport(self, File, GlobalPcdReport, GlobalPredictionReport, GlobalDepexParser, ReportType):
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/build/BuildReport.py - About 35 mins to fix

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

                                          def GenerateReport(self, BuildDuration):
                                              if self.ReportFile:
                                                  try:
                                                      File = StringIO('')
                                                      for (Wa, MaList) in self.ReportList:
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/build/BuildReport.py - About 35 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                          def _ParseMapFile(self):
                                              if self._MapFileParsed:
                                                  return
                                              self._MapFileParsed = True
                                              if os.path.isfile(self._MapFileName):
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/build/BuildReport.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

                                              for Dir in [os.path.dirname(Source)] + IncludePathList:
                                                  FullFileName = os.path.normpath(os.path.join(Dir, FileName))
                                                  if os.path.exists(FullFileName):
                                                      IncludeFiles[FullFileName.lower().replace("\\", "/")] = FullFileName
                                                      break
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 1 other location - About 2 hrs to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 176..180

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

                                      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 Dir in IncludePathList:
                                                  FullFileName = os.path.normpath(os.path.join(Dir, FileName))
                                                  if os.path.exists(FullFileName):
                                                      IncludeFiles[FullFileName.lower().replace("\\", "/")] = FullFileName
                                                      break
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 1 other location - About 2 hrs to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 154..158

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 58.

                                      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 not DscMatch and DscDefaultValue != None:
                                                              FileWrite(File, '    %*s = %s' % (self.MaxLen + 19, 'DSC DEFAULT', DscDefaultValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 834..835
                                      BaseTools/Source/Python/build/BuildReport.py on lines 837..838

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 49.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                          if not InfMatch and InfDefaultValue != None:
                                                              FileWrite(File, '    %*s = %s' % (self.MaxLen + 19, 'INF DEFAULT', InfDefaultValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 831..832
                                      BaseTools/Source/Python/build/BuildReport.py on lines 837..838

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 49.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                          if not DecMatch and DecDefaultValue != None:
                                                              FileWrite(File, '    %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 831..832
                                      BaseTools/Source/Python/build/BuildReport.py on lines 834..835

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 49.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                          if DecMatch and InfMatch:
                                                              FileWrite(File, '    %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 3 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 817..818
                                      BaseTools/Source/Python/build/BuildReport.py on lines 817..820
                                      BaseTools/Source/Python/build/BuildReport.py on lines 816..822

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

                                                              if DscMatch:
                                                                  if (Pcd.TokenCName, Key) in self.FdfPcdSet:
                                                                      FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                                                                  else:
                                                                      FileWrite(File, ' *P %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 3 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 813..814
                                      BaseTools/Source/Python/build/BuildReport.py on lines 817..818
                                      BaseTools/Source/Python/build/BuildReport.py on lines 817..820

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

                                                                  if (Pcd.TokenCName, Key) in self.FdfPcdSet:
                                                                      FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 3 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 813..814
                                      BaseTools/Source/Python/build/BuildReport.py on lines 817..820
                                      BaseTools/Source/Python/build/BuildReport.py on lines 816..822

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

                                                      for Guid in Package.Guids:
                                                          GuidValue = GuidStructureStringToGuidString(Package.Guids[Guid])
                                                          self._GuidDb[GuidValue.upper()] = Guid
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 235..237
                                      BaseTools/Source/Python/build/BuildReport.py on lines 238..240

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

                                                      for Ppi in Package.Ppis:
                                                          GuidValue = GuidStructureStringToGuidString(Package.Ppis[Ppi])
                                                          self._GuidDb[GuidValue.upper()] = Ppi
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 235..237
                                      BaseTools/Source/Python/build/BuildReport.py on lines 241..243

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

                                                      for Protocol in Package.Protocols:
                                                          GuidValue = GuidStructureStringToGuidString(Package.Protocols[Protocol])
                                                          self._GuidDb[GuidValue.upper()] = Protocol
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 238..240
                                      BaseTools/Source/Python/build/BuildReport.py on lines 241..243

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

                                                              if InfDefaultValue == None:
                                                                  InfMatch = True
                                                              else:
                                                                  InfDefaultValueNumber = int(InfDefaultValue.strip(), 0)
                                                                  InfMatch = (InfDefaultValueNumber == PcdValueNumber)
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 777..781
                                      BaseTools/Source/Python/build/BuildReport.py on lines 789..793

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 41.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                              if DscDefaultValue == None:
                                                                  DscMatch = True
                                                              else:
                                                                  DscDefaultValueNumber = int(DscDefaultValue.strip(), 0)
                                                                  DscMatch = (DscDefaultValueNumber == PcdValueNumber)
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 777..781
                                      BaseTools/Source/Python/build/BuildReport.py on lines 783..787

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 41.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                              if DecDefaultValue == None:
                                                                  DecMatch = True
                                                              else:
                                                                  DecDefaultValueNumber = int(DecDefaultValue.strip(), 0)
                                                                  DecMatch = (DecDefaultValueNumber == PcdValueNumber)
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 1 hr to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 783..787
                                      BaseTools/Source/Python/build/BuildReport.py on lines 789..793

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 41.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                              if DscDefaultValue == None:
                                                                  DscMatch = True
                                                              else:
                                                                  DscMatch = (DscDefaultValue.strip() == PcdValue.strip())
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 45 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 795..798
                                      BaseTools/Source/Python/build/BuildReport.py on lines 800..803

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

                                                              if InfDefaultValue == None:
                                                                  InfMatch = True
                                                              else:
                                                                  InfMatch = (InfDefaultValue.strip() == PcdValue.strip())
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 45 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 795..798
                                      BaseTools/Source/Python/build/BuildReport.py on lines 805..808

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

                                                              if DecDefaultValue == None:
                                                                  DecMatch = True
                                                              else:
                                                                  DecMatch = (DecDefaultValue.strip() == PcdValue.strip())
                                      Severity: Major
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 45 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 800..803
                                      BaseTools/Source/Python/build/BuildReport.py on lines 805..808

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

                                                      for Guid in Module.ProtocolList:
                                                          self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.ProtocolList[Guid])
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 35 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 912..913
                                      BaseTools/Source/Python/build/BuildReport.py on lines 916..917

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 33.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                      for Guid in Module.PpiList:
                                                          self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.PpiList[Guid])
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 35 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 914..915
                                      BaseTools/Source/Python/build/BuildReport.py on lines 916..917

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 33.

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

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

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

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

                                      Refactorings

                                      Further Reading

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

                                                      for Guid in Module.GuidList:
                                                          self._GuidMap[Guid] = GuidStructureStringToGuidString(Module.GuidList[Guid])
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/build/BuildReport.py and 2 other locations - About 35 mins to fix
                                      BaseTools/Source/Python/build/BuildReport.py on lines 912..913
                                      BaseTools/Source/Python/build/BuildReport.py on lines 914..915

                                      Duplicated Code

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

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

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

                                      Tuning

                                      This issue has a mass of 33.

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

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

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

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

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status