hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Avoid deeply nested control flow statements.
Open

                        if Item.strip() not in DT.MODULE_LIST:
                            Logger.Error('Parser',
                                         FORMAT_INVALID,
                                         ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID % (Item),
                                         File=FileName,
Severity: Major
Found in BaseTools/Source/Python/UPT/Parser/InfSectionParser.py - About 45 mins to fix

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

        def __init__(self, Guid, Name, Value, DatumType,
    Severity: Minor
    Found in BaseTools/Source/Python/UPT/Object/Parser/DecObject.py - About 45 mins to fix

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

          def GetPcdsByType(self, PcdType):
              PcdType = PcdType.upper()
              Retlst = []
              for TypeInDict, Arch in self.ValueDict:
                  if TypeInDict != PcdType:
      Severity: Minor
      Found in BaseTools/Source/Python/UPT/Object/Parser/DecObject.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 GetLiabraryInstances has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

            def __GenComplexFileFfs__(self, Rule, InputFile, Alignments):
        
                if Rule.NameGuid != None and Rule.NameGuid.startswith('PCD('):
                    PcdValue = GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)
                    if len(PcdValue) == 0:
        Severity: Minor
        Found in BaseTools/Source/Python/GenFds/FfsInfStatement.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 PlatformModule and LibName in PlatformModule.LibraryClasses:
                                    LibraryPath = PlatformModule.LibraryClasses[LibName]
                                else:
                                    LibraryPath = PlatformDataBase.LibraryClasses[LibName, ModuleType]
                                if not LibraryPath:
        Severity: Major
        Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if Module == None:
                                      EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "Module is not found in active platform",
                                                      ExtraData=Token, File=self.MetaFile, Line=Record[-1])
                                  DepexList.append(Module.Guid)
          Severity: Major
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if timeOfToolModified < fd.st_mtime:
                                        timeOfToolModified = fd.st_mtime
                    if timeOfToolModified > os.stat(DbPath).st_mtime:
            Severity: Major
            Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

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

                  def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):
              Severity: Minor
              Found in BaseTools/Source/Python/Workspace/MetaDataTable.py - About 45 mins to fix

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

                    def _GetLibraryClass(self):
                        if self._LibraryClasses == None:
                            #
                            # tdict is a special kind of dict, used for selecting correct
                            # library class declaration 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 ToolList[0] in self._TOOL_CODE_:
                                            Tool = self._TOOL_CODE_[ToolList[0]]
                                        else:
                                            Tool = ToolList[0]
                                        ToolChain = "*_*_*_%s_FLAGS" % Tool
                Severity: Major
                Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if PcdObj.DatumType != 'VOID*':
                                              EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not VOID* datum type." % PcdPattern)
                                              
                  Severity: Major
                  Found in BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if self._BuildOptions == None:
                                                self._BuildOptions = sdict()
                    
                    Severity: Major
                    Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if File.Ext.lower() == '.h':
                                                  EdkLogger.warn('build', 'Include file not found', ExtraData=ErrorInfo,
                                                                 File=self.MetaFile, Line=LineNo)
                                                  continue
                                              else:
                      Severity: Major
                      Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if self.FvAddress % FvAlignValue != 0:
                                                    EdkLogger.error("GenFds", GENFDS_ERROR,
                                                                    "FV (%s) is NOT %s Aligned!" % (FvObj.UiFvName, FvObj.FvAlignment))
                                                FvBuffer = StringIO.StringIO('')
                        Severity: Major
                        Found in BaseTools/Source/Python/GenFds/Region.py - About 45 mins to fix

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

                              def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
                          Severity: Minor
                          Found in BaseTools/Source/Python/GenFds/CompressSection.py - About 45 mins to fix

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

                                def __ProcessDefine(self):
                                    if not self._Enabled:
                                        return
                            
                                    Type, Name, Value = self._ValueList
                            Severity: Minor
                            Found in BaseTools/Source/Python/Workspace/MetaFileParser.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 IsHex:
                                                        RetValue.append((eachName, Element[2]))
                                                        IsHex = False
                                                #
                                                # GCC map file
                            Severity: Major
                            Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 45 mins to fix

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

                                  def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
                              Severity: Minor
                              Found in BaseTools/Source/Python/GenFds/GuidSection.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if NameValue[0].strip() == 'EFI_FV_SPACE_SIZE':
                                                            FreeFound = True
                                                            Free = NameValue[1].strip()
                                                
                                Severity: Major
                                Found in BaseTools/Source/Python/GenFds/GenFds.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language