hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

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

    def __GetAprioriSection(self, FvObj, MacroDict = {}):
        
        if not self.__IsKeyword( "APRIORI"):
            return False
        
Severity: Minor
Found in BaseTools/Source/Python/Common/FdfParserLite.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 NotFlag:
                            ConditionSatisfied = not ConditionSatisfied
                        BranchDetermined = ConditionSatisfied
Severity: Major
Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

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

        def __GetRegionCapType(self, RegionObj):
    
            if not self.__IsKeyword("CAPSULE"):
                raise Warning("expected Keyword 'CAPSULE' at line", self.FileName, self.CurrentLineNumber)
    
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.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 __GetFvAttributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __GetFvAttributes(self, FvObj):
            
            while self.__GetNextWord():
                name = self.__Token
                if name not in ("ERASE_POLARITY", "MEMORY_MAPPED", \
    Severity: Minor
    Found in BaseTools/Source/Python/Common/FdfParserLite.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 CheckFileType has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line, LineNo= -1):
    Severity: Minor
    Found in BaseTools/Source/Python/Common/String.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if NotFlag:
                                  ConditionSatisfied = not ConditionSatisfied
                              BranchDetermined = ConditionSatisfied
      Severity: Major
      Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    for FvObj in FvInFdList:
                                        LogStr += FvObj
                                        LogStr += ' \n'
                                        if FvObj not in RefFvStack:
                                            RefFvStack.append(FvObj)
        Severity: Major
        Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for LibraryClass in Module.LibraryClasses.LibraryList:
                                      if LibraryClass.Name == Lib:
                                          return LibraryClass.FilePath
                  #
                  #Second find if exist in <LibraryClass> of <LibraryClasses> from dsc file
          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/InfClassObject.py - About 45 mins to fix

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

              def ParseDefineMacro2(Table, RecordSets, GlobalMacro):
                  Macros = {}
                  #
                  # Find all DEFINE macros in section [Header] and its section
                  #
              Severity: Minor
              Found in BaseTools/Source/Python/Common/Parsing.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 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, Filename=None, IsToDatabase=False, IsToPackage=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):
                Severity: Minor
                Found in BaseTools/Source/Python/Common/DecClassObject.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

                    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

                      Avoid deeply nested control flow statements.
                      Open

                                              for CommentItem in CommentList:
                                                  Pcd = CommonObject.PcdObject()
                                                  Pcd.SetCName(PcdItemObj.GetCName())
                                                  Pcd.SetTokenSpaceGuidCName(PcdItemObj.GetTokenSpaceGuidCName())
                                                  Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())
                      Severity: Major
                      Found in BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.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

                          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

                                                      if self._VpdArray[VpdObject][VpdObject.SkuInfoList.keys().index(sku)] == "*":
                                                          if Offset == "*":
                                                              EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG tool." % PcdName)                              
                                                          self._VpdArray[VpdObject][VpdObject.SkuInfoList.keys().index(sku)] = Offset
                                                      Found = True
                              Severity: Major
                              Found in BaseTools/Source/Python/Common/VpdInfoFile.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language