hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if Input.upper() != 'Y':
                            continue
                RemovePath(Path)
Severity: Major
Found in BaseTools/Source/Python/UPT/RmPkg.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if not Line.startswith(DT.TAB_COMMENT_SPLIT):
                                Logger.Warn("Parser", 
                                             ST.WARN_SPECIAL_SECTION_LOCATION_WRONG, 
                                             File=self.FullPath, Line=LineNum)
                                SpecialSectionStart = False
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Parser/InfParser.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if Package and ((ToFile, Md5Sum) not in Package.FileList):
                              Package.FileList.append((ToFile, Md5Sum))
                          elif Package:
                              continue
                          elif (ToFile, Md5Sum) not in Module.FileList:
      Severity: Major
      Found in BaseTools/Source/Python/UPT/InstallPkg.py - About 45 mins to fix

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

            def GetToken(self, StopChar='.,|\t ', SkipPair='"'):
                self.__SkipWhitespace()
                PreIndex = self._Index
                InQuote = False
                LastChar = ''
        Severity: Minor
        Found in BaseTools/Source/Python/UPT/Parser/DecParserMisc.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 Count % 2 != 0:
                                QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro, 
                                                                                MacroDefinitions[Macro])
                            elif Count == len(QuotedStringList) and Count%2 == 0:
                                QuotedStringList[Count-1] = QuotedStringList[Count-1].replace("$(%s)" % Macro,
        Severity: Major
        Found in BaseTools/Source/Python/UPT/Library/String.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if MatchObject:
                                      CheckLocation = False
                                  elif Line:
                                      Logger.Warn("Parser", 
                                                   ST.WARN_SPECIAL_SECTION_LOCATION_WRONG, 
          Severity: Major
          Found in BaseTools/Source/Python/UPT/Parser/InfParser.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if IsValidPath(UiContent[1], GlobalData.gINF_MODULE_DIR):
                                        IsValidFileFlag = True
                                    else:
                                        Logger.Error("InfParser",
                                                     ToolError.FORMAT_INVALID,
            Severity: Major
            Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for ProtocolItemObjArch in __SupArchList:
                                          if ItemArch == ProtocolItemObjArch:
                                              #
                                              # ST.ERR_INF_PARSER_ITEM_DUPLICATE
                                              #
              Severity: Major
              Found in BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if BlockFlag == 1 or BlockFlag == 2:
                                        BlockFlag = 3
                                    elif BlockFlag == -1:
                                        BlockFlag = 4
                                                                                              
                Severity: Major
                Found in BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if Num == 0:
                                                  Line = "%-30s = \n" % Key
                                              else:
                                                  ret = GetConfigureKeyValue(self, Key)
                                                  if ret != None:
                  Severity: Major
                  Found in BaseTools/Source/Python/TargetTool/TargetTool.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if CommentItemUsage == CommentItemGuidType == DT.ITEM_UNDEFINED:
                                            BlockFlag = 4
                                        else:
                                            BlockFlag = 3
                                    if BlockFlag == -1:
                    Severity: Major
                    Found in BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py - About 45 mins to fix

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

                          def SetSpecialComments(self, SepcialSectionList = None, Type = ''):
                              if Type == DT.TYPE_HOB_SECTION or \
                                 Type == DT.TYPE_EVENT_SECTION or \
                                 Type == DT.TYPE_BOOTMODE_SECTION:
                                  for Item in SepcialSectionList:
                      Severity: Minor
                      Found in BaseTools/Source/Python/UPT/Object/Parser/InfMisc.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 IsValidFileFlag:
                                                  UiContent[0] = ConvPathFromAbsToRel(UiContent[0], GlobalData.gINF_MODULE_DIR)
                                                  InfBianryUiItemObj.SetFileName(UiContent[1])
                                          if len(UiContent) >= 3:
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

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

                            def __init__(self, File, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
                        Severity: Minor
                        Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if IsValidLibName(LibItem[0].strip()):
                                                      if LibItem[0].strip() != 'NULL':
                                                          LibItemObj.SetLibName(LibItem[0])
                                                      else:
                                                          Logger.Error("InfParser",
                          Severity: Major
                          Found in BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py - About 45 mins to fix

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

                                def SetSources(self, SourceList, Arch = None):
                                    __SupArchList = []
                                    for ArchItem in Arch:
                                        #
                                        # Validate Arch
                            Severity: Minor
                            Found in BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.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 ConsumedByList[Item] == []:
                                                    # insert Item into Q
                                                    Q.insert(0, Item)
                                                    break
                                            if Q != []:
                            Severity: Major
                            Found in BaseTools/Source/Python/Workspace/WorkspaceCommon.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if Key not in existKeys:
                                                              existKeys.append(Key)
                                                          else:
                                                              print "Warning: Found duplicate key item in original configuration files!"
                                                              
                              Severity: Major
                              Found in BaseTools/Source/Python/TargetTool/TargetTool.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          for PpiItemObjArch in __SupArchList:
                                                              if ItemArch == PpiItemObjArch:
                                                                  #
                                                                  # ST.ERR_INF_PARSER_ITEM_DUPLICATE
                                                                  #
                                  Severity: Major
                                  Found in BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language