hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                    if PcdInDec.TokenCName == PcdItemObj.CName and \
                       PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                        PcdItemObj.SetToken(PcdInDec.TokenValue)
                        PcdItemObj.SetDatumType(PcdInDec.DatumType)
                        PcdItemObj.SetSupportArchList([Arch])
Severity: Major
Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if not FeatureFlagRtv[0]:
                                Logger.Error("InfParser",
                                             ToolError.FORMAT_INVALID,
                                             ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
                                             File=UiCurrentLine.GetFileName(),
    Severity: Major
    Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if GuidInDec.GuidCName == PcdItemObj.TokenSpaceGuidCName:
                              PcdItemObj.SetTokenSpaceGuidValue(GuidInDec.GuidString)
      
          #
          # Validate Value.
      Severity: Major
      Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if LibraryPath == None or LibraryPath == "":
                                return []
        
        Severity: Major
        Found in BaseTools/Source/Python/Workspace/WorkspaceCommon.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

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

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

            def _GetModuleLibraryInstances(Module, Platform, BuildDatabase, Arch, Target, Toolchain):
            Severity: Minor
            Found in BaseTools/Source/Python/Workspace/WorkspaceCommon.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

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

                Avoid deeply nested control flow statements.
                Open

                                        if not (ValidFile(FullFileName) or ValidFile(UiContent[1])):
                                            Logger.Error("InfParser",
                                                         ToolError.FORMAT_INVALID,
                                                         ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (UiContent[1]),
                                                         File=UiCurrentLine.GetFileName(),
                Severity: Major
                Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if self.Binaries.has_key((InfBianryUiItemObj)):
                                              BinariesList = self.Binaries[InfBianryUiItemObj]
                                              BinariesList.append((InfBianryUiItemObj, UiComment))
                                              self.Binaries[InfBianryUiItemObj] = BinariesList
                                          else:
                  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, FilePath, 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

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

                        Avoid deeply nested control flow statements.
                        Open

                                                if Other[:-1] == SubValue[:-1]:
                                                    self._LoggerError(ST.ERR_DECPARSE_REDEFINE % (Key, Value[1]))
                                                    return
                                            continue
                        Severity: Major
                        Found in BaseTools/Source/Python/UPT/Parser/DecParser.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              if BlockFlag == -1:
                                                  BlockFlag = 1
                                              elif BlockFlag == 1:
                                                  BlockFlag = 2
                                          else:
                          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 len(ArchList) >= 1:
                                                        SpecialObject.SetSupArchList(ArchList)
                                                else:
                            Severity: Major
                            Found in BaseTools/Source/Python/UPT/Parser/InfSectionParser.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if UiContent[0] != 'UI':
                                                          Logger.Error("InfParser",
                                                                       ToolError.FORMAT_INVALID,
                                                                       ST.ERR_INF_PARSER_BINARY_VER_TYPE % ('UI'),
                                                                       File=UiCurrentLine.GetFileName(),
                              Severity: Major
                              Found in BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if Node in Constructor:
                                                        continue
                                                    # remove edge e from the graph if Node has no constructor
                                                    ConsumedByList[Item].remove(Node)
                                Severity: Major
                                Found in BaseTools/Source/Python/Workspace/WorkspaceCommon.py - About 45 mins to fix

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

                                      def _GetProtocol(self):
                                          if self._Protocols == None:
                                              #
                                              # tdict is a special kind of dict, used for selecting correct
                                              # protocol 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 PcdInDec.TokenCName == PcdItemObj.CName and \
                                                         PcdInDec.TokenSpaceGuidCName == PcdItemObj.TokenSpaceGuidCName:
                                                          PcdItemObj.SetToken(PcdInDec.TokenValue)
                                                          PcdItemObj.SetDatumType(PcdInDec.DatumType)
                                                          PcdItemObj.SetSupportArchList([Arch]) 
                                  Severity: Major
                                  Found in BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if UiContent[3].strip() == '':
                                                                Logger.Error("InfParser",
                                                                             ToolError.FORMAT_INVALID,
                                                                             ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
                                                                             File=UiCurrentLine.GetFileName(),
                                    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, FilePath, RawData, BuildDataBase, Arch='COMMON', Target=None, Toolchain=None):
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language