hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if (Item.ToolChainFamily, Item.ToolChain) not in Pb.BuildOptions:
                            Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)] = Item.Option
                        else:
                            OptionString = Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)]
                            Pb.BuildOptions[(Item.ToolChainFamily, Item.ToolChain)] = OptionString + " " + Item.Option
Severity: Major
Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if Arch in Item.SupArchList:
                                for ModuleType in Item.SupModuleList:
                                    EdkLogger.debug(EdkLogger.DEBUG_3, "\tLibraryClass %s has specific defined module types" % Name)
                                    if ModuleType in SupModuleList:
                                        SupModuleList.remove(ModuleType)
    Severity: Major
    Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

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

      def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
      Severity: Minor
      Found in BaseTools/Source/Python/Common/Dictionary.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if Pb.LibraryClass != []:
                                    #
                                    # For Library
                                    #
                                    for Libs in Pb.LibraryClass:
        Severity: Major
        Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for Node in ConsumedByList[Item]:
                                      if Node not in Constructor:
                                          #
                                          # remove edge e from the graph
                                          #
          Severity: Major
          Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

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

                def __init__(self, Filename=None, IsToDatabase=False, IsToModule=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
            Severity: Minor
            Found in BaseTools/Source/Python/Common/InfClassObject.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if CurrentSection != ItemList[0]:
                                          EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                                  if CurrentSection.upper() not in self.KeyList:
              Severity: Major
              Found in BaseTools/Source/Python/Common/InfClassObject.py - About 45 mins to fix

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

                    def GenUserExtensions(self):
                        UEObj = self.DecParser.GetUserExtensionSectionObject()
                        UEList = UEObj.GetAllUserExtensions()
                        for Item in UEList:
                            if not Item.UserString:
                Severity: Minor
                Found in BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.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 ModuleType in SupModuleList:
                                            Pb.LibraryClasses[(Item.Name, ModuleType)] = Item.FilePath
                
                                #
                                # Libraries
                Severity: Major
                Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if ModuleTypeInList in DT.VALID_DEPEX_MODULE_TYPE_LIST:
                                              ModuleTypeList.append(ModuleTypeInList)
                                  if not ModuleTypeList:
                  Severity: Major
                  Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ItemArch not in Library.Module.Header:
                                                continue
                                            Pb.Libraries[Library.Module.Header[ItemArch].Name] = Item.FilePath
                    Severity: Major
                    Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              for Pcd in Module.PcdBuildDefinitions:
                                                  if (Name, Guid) == (Pcd.CName, Pcd.TokenSpaceGuidCName):
                                                      if Pcd.DefaultValue != '':
                                                          Value = Pcd.DefaultValue
                                                      if Pcd.MaxDatumSize != '':
                      Severity: Major
                      Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:
                                                    EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)
                                                ArchList.append(ItemList[1].upper())
                        Severity: Major
                        Found in BaseTools/Source/Python/Common/DecClassObject.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if Value != None: break
                                      else:
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/Misc.py - About 45 mins to fix

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

                            def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, ThirdList, RecordSet):
                            Severity: Minor
                            Found in BaseTools/Source/Python/Common/Parsing.py - About 45 mins to fix

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

                                  def _EqExpr(self):
                                      Val = self._RelExpr()
                                      while self._IsOperator(["==", "!=", "EQ", "NE", "IN", "in", "!", "NOT", "not"]):
                                          Op = self._Token
                                          if Op in ["!", "NOT", "not"]:
                              Severity: Minor
                              Found in BaseTools/Source/Python/Common/Expression.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

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

                                  def ConvertTextFileToDictionary(self, FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
                              Severity: Minor
                              Found in BaseTools/Source/Python/Common/EdkIIWorkspace.py - About 45 mins to fix

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

                                def ConvertTextFileToDictionary(FileName, Dictionary, CommentCharacter, KeySplitCharacter, ValueSplitFlag, ValueSplitCharacter):
                                Severity: Minor
                                Found in BaseTools/Source/Python/Common/EdkIIWorkspace.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if LibraryClassDict.has_key('COMMON'):
                                                          LibraryClassDict['COMMON'].append(Statement)
                                                      else:
                                                          LibraryClassDict['COMMON'] = ['## @LIB_INSTANCES']
                                                          LibraryClassDict['COMMON'].append(Statement)
                                  Severity: Major
                                  Found in BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py - About 45 mins to fix

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

                                        def GetModInPackage(self, Guid, Version, Name, Path, PkgGuid='', PkgVersion=''):
                                    Severity: Minor
                                    Found in BaseTools/Source/Python/UPT/Core/IpiDb.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language