hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        for Key in Module.LibraryClasses:
                            Lib = Module.LibraryClasses[Key]
                            if Lib not in Platform.LibraryInstances:
                                Platform.LibraryInstances.append(Lib)
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

      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

        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

                                  for Dec in self.Build[Arch].PackageDatabase:
                                      Pcds = self.Build[Arch].PackageDatabase[Dec].Pcds
                                      if (Name, Guid, PcdType) in Pcds:
                                          Pcd = Pcds[(Name, Guid, PcdType)]
                                          Type = PcdType
          Severity: Major
          Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

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

                def GenIncludes(self, ContainerFile):
                    EdkLogger.debug(2, "Generate %s ..." % TAB_INCLUDES)
                    Includes = {}
                    #
                    # Get all Includes
            Severity: Minor
            Found in BaseTools/Source/Python/Common/DecClassObject.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 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

                                    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 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

                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

                                          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 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/DecClassObject.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/InfClassObject.py - About 45 mins to fix

                        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

                                                  for BuildOption in Module.ModuleSaBuildOption.BuildOptionList:
                                                      #
                                                      # Add to BuildOptions
                                                      #
                                                      BuildOptions[(BuildOption.ToolChainFamily, BuildOption.ToolChain)] = BuildOption.Option
                          Severity: Major
                          Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 45 mins to fix

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

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

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

                              def ConvertDictionaryToTextFile(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

                                                        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 ToXml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def ToXml(self, Dict, Key):
                                          if self.UserExtensionBinary:
                                              pass
                                          BinariesNodeList = []
                                          for Item in Dict:
                                  Severity: Minor
                                  Found in BaseTools/Source/Python/UPT/Xml/CommonXml.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 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language