hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

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

    Avoid deeply nested control flow statements.
    Open

                            if not LibraryPath:
                                LibraryPath = Module.LibraryClasses[LibName]
                            if not LibraryPath:
    Severity: Major
    Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (PcdCName, TokenSpaceGuid, T) in Package.Pcds:
                                  PcdType = T
                                  break
                      else:
      Severity: Major
      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
                                    UsedFound = True
                                    Used = NameValue[1].strip()
                                if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
        Severity: Major
        Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if LibraryClass.startswith("NULL") and PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]:
                                      self.InfModule.LibraryClasses[LibraryClass] = PlatformDataBase.LibraryClasses[LibraryClass, ModuleType]
          
          Severity: Major
          Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if FvBuffer.len > Size:
                                        FvBuffer.close()
                                        EdkLogger.error("GenFds", GENFDS_ERROR,
                                                        "Size of FV (%s) is larger than Region Size 0x%X specified." % (RegionData, Size))
                                    #
            Severity: Major
            Found in BaseTools/Source/Python/GenFds/Region.py - About 45 mins to fix

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

                  def _GetInfVersion(self):
                      if self._AutoGenVersion == None:
                          RecordList = self._RawData[MODEL_META_DATA_HEADER, self._Arch, self._Platform]
                          for Record in RecordList:
                              if Record[1] == TAB_INF_DEFINES_INF_VERSION:
              Severity: Minor
              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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

                                      for ElementRegionData in ElementRegion.RegionDataList:
                                          if ElementRegionData != None and ElementRegionData.upper() == FvObj.UiFvName:
                                              if FvObj.BlockSizeList != []:
                                                  return FvObj.BlockSizeList[0][0]
                                              else:
              Severity: Major
              Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ReIsValidPcdTokenValue.match(Pcd.TokenValue) == None:
                                            EdkLogger.error(
                                                    'build',
                                                    FORMAT_INVALID,
                                                    "The format of TokenValue [%s] of PCD [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdCName, str(Package)),
                Severity: Major
                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if LibName in LibraryInstance:
                                              continue
                                          if PlatformModule and LibName in PlatformModule.LibraryClasses:
                  Severity: Major
                  Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if NameValue[0].strip() == 'EFI_FV_TOTAL_SIZE':
                                                TotalFound = True
                                                Total = NameValue[1].strip()
                                            if NameValue[0].strip() == 'EFI_FV_TAKEN_SIZE':
                    Severity: Major
                    Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix

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

                          def _GetPpi(self):
                              if self._Ppis == None:
                                  #
                                  # tdict is a special kind of dict, used for selecting correct
                                  # PPI defition for given ARCH
                      Severity: Minor
                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 (ToolChainFamily, ToolChain) not in self._BuildOptions:
                                                  self._BuildOptions[ToolChainFamily, ToolChain] = Value
                                              else:
                                                  OptionString = self._BuildOptions[ToolChainFamily, ToolChain]
                                                  self._BuildOptions[ToolChainFamily, ToolChain] = OptionString + " " + Value
                      Severity: Major
                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ToolPathTmp != ToolPath:
                                                    EdkLogger.error("GenFds", GENFDS_ERROR, "Don't know which tool to use, %s or %s ?" % (ToolPathTmp, ToolPath))
                                                    
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/GuidSection.py - About 45 mins to fix

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

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

                            Avoid deeply nested control flow statements.
                            Open

                                                    if Value == None:
                                                        Value = PpiValue(Token, self.Packages)
                                                        if Value == None:
                                                            Value = GuidValue(Token, self.Packages)
                                                    if Value == None:
                            Severity: Major
                            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                                  def _GetGuid(self):
                                      if self._Guids == None:
                                          #
                                          # tdict is a special kind of dict, used for selecting correct
                                          # GUID defition for given ARCH
                              Severity: Minor
                              Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.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 NextLine[0] == TAB_SECTION_START and NextLine[-1] == TAB_SECTION_END:
                                                          self._CurrentLine = NmakeLine + Line[0:-1]
                                                          NmakeLine = ''
                                                      else:
                                                          NmakeLine = NmakeLine + ' ' + Line[0:-1]
                              Severity: Major
                              Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if LibraryClass.startswith("NULL"):
                                                            self.InfModule.LibraryClasses[LibraryClass] = PlatformModule.LibraryClasses[LibraryClass]
                                
                                Severity: Major
                                Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if not LibraryPath:
                                                              continue
                                                          LibraryModule = GenFdsGlobalVariable.WorkSpace.BuildObject[LibraryPath, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
                                  Severity: Major
                                  Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language