hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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 IfList[-1][2]:
                                IfList[-1][1] = False
                            else:
                                IfList[-1][2] = True
                                self.__WipeOffArea.append((IfList[-1][0], (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))
    Severity: Major
    Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if FvInFdList != []:
                                  for FvNameInFd in FvInFdList:
                                      LogStr += "FD %s contains FV %s\n" % (RefFdName,FvNameInFd)
                                      if FvNameInFd not in RefFvList:
                                          RefFvList.append(FvNameInFd)
      Severity: Major
      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if RefFvName.upper() in self.Profile.FvDict.keys():
                                    FvObj = self.Profile.FvDict[RefFvName.upper()]
                                else:
                                    continue
                                self.__GetReferencedFdFvTuple(FvObj, RefFdList, RefFvList)
        Severity: Major
        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ImageObj.SectionAlignment < 0x400:
                                      self.Alignment = str (ImageObj.SectionAlignment)
                                  else:
                                      self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'
          
          Severity: Major
          Found in BaseTools/Source/Python/GenFds/EfiSection.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if GenFdsGlobalVariable.GetAlignment (Fv.FvAlignment) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
                                        self.Alignment = Fv.FvAlignment
                        else:
            Severity: Major
            Found in BaseTools/Source/Python/GenFds/FvImageSection.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 elementRegionData.endswith(".cap"):
                                            continue
                                        if elementRegionData != None and elementRegionData.upper() not in CapList:
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for RegionData in RegionObj.RegionDataList:
                                              if RegionData.endswith(".fv"):
                                                  continue
                                              elif RegionData.upper() + 'fv' in GenFds.ImageBinDict.keys():
                                                  continue
                  Severity: Major
                  Found in BaseTools/Source/Python/GenFds/Fv.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if os.path.exists(MapFile):
                                                CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
                                                if not os.path.exists(CopyMapFile) or \
                                                    (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
                                                    shutil.copyfile(MapFile, CopyMapFile)
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/EfiSection.py - About 45 mins to fix

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

                          def GenSection(self,OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
                      Severity: Minor
                      Found in BaseTools/Source/Python/GenFds/VerSection.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if not os.path.exists(FileBeforeStrip) or \
                                                    (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
                                                    shutil.copyfile(File, FileBeforeStrip)
                                                StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/EfiSection.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 Pcd.Type == TAB_PCDS_PATCHABLE_IN_MODULE and Pcd.TokenCName in TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST:
                                                        ModuleIsPatch = True
                                                        break
                            
                            Severity: Major
                            Found in BaseTools/Source/Python/build/build.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

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

                                Avoid deeply nested control flow statements.
                                Open

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

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

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

                                  Cognitive Complexity

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

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

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

                                  Further reading

                                  Avoid deeply nested control flow statements.
                                  Open

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

                                    Avoid deeply nested control flow statements.
                                    Open

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

                                      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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language