hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if not Pattern.match(self.__Token):
                            raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
                        KeyStringList.append(self.__Token)
Severity: Major
Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

    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 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 CapInFdList != []:
                                  for CapNameInFd in CapInFdList:
                                      LogStr += "FD %s contains Capsule %s\n" % (RefFdName,CapNameInFd)
                                      if CapNameInFd not in RefCapStack:
                                          RefCapStack.append(CapNameInFd)
      Severity: Major
      Found in BaseTools/Source/Python/GenFds/FdfParser.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/UiSection.py - About 45 mins to fix

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

              def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/DataSection.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 MacorValue != None:
                                          CurLine = CurLine.replace('$(' + MacroName + ')', MacorValue, 1)
                                          if MacorValue.find('$(') != -1:
                                              PreIndex = StartPos
                                          else:
              Severity: Major
              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if not self.__IsToken( "("):
                                            raise Warning("expected '('", self.FileName, self.CurrentLineNumber)
                                        PcdPair = self.__GetNextPcdName()
                Severity: Major
                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

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

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

                        def __GetRegionFvType(self, RegionObj):
                    
                            if not self.__IsKeyword( "FV"):
                                raise Warning("expected Keyword 'FV'", self.FileName, self.CurrentLineNumber)
                    
                    Severity: Minor
                    Found in BaseTools/Source/Python/GenFds/FdfParser.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

                      Avoid deeply nested control flow statements.
                      Open

                                              if elementRegionData.endswith(".fv"):
                                                  continue
                                              if elementRegionData != None and elementRegionData.upper() not in FvList:
                      Severity: Major
                      Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ErrorCode != 0:
                                                    raise Warning("The include file does not exist under below directories: \n%s\n%s\n%s\n"%(os.path.dirname(self.FileName), PlatformDir, GlobalData.gWorkspace), 
                                                                  self.FileName, self.CurrentLineNumber)
                        
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if not Pattern.match(self.__Token):
                                                      raise Warning("expected KeyString \"Target_Tag_Arch\"", self.FileName, self.CurrentLineNumber)
                                                  FfsFileObj.KeyStringList.append(self.__Token)
                          Severity: Major
                          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if not self.__IsToken(","):
                                                        break
                            
                            Severity: Major
                            Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

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

                                  def __GetRegionFileType(self, RegionObj):
                              
                                      if not self.__IsKeyword( "FILE"):
                                          raise Warning("expected Keyword 'FILE'", self.FileName, self.CurrentLineNumber)
                              
                              Severity: Minor
                              Found in BaseTools/Source/Python/GenFds/FdfParser.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 elementRegionData != None and elementRegionData.upper() not in FvList:
                                                          FvList.append(elementRegionData.upper())
                                      return FvList
                              Severity: Major
                              Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if len(FvObj.BlockSizeList) < 1:
                                                            EdkLogger.error("GenFds", GENFDS_ERROR,
                                                                            'FV.%s must point out FVs blocksize and Fv BlockNum' \
                                                                            % FvObj.UiFvName)
                                                        else:
                                Severity: Major
                                Found in BaseTools/Source/Python/GenFds/Fd.py - About 45 mins to fix

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

                                      def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):
                                  Severity: Minor
                                  Found in BaseTools/Source/Python/GenFds/DepexSection.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language