hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

File pprint.py has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#  Author:      Fred L. Drake, Jr.
#               fdrake@acm.org
#
#  This is a simple little module I wrote to make life easier.  I didn't
#  see anything quite like it in the library, though I may have overlooked
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/pprint.py - About 3 hrs to fix

    File pprint.py has 291 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #  Author:      Fred L. Drake, Jr.
    #               fdrake@acm.org
    #
    #  This is a simple little module I wrote to make life easier.  I didn't
    #  see anything quite like it in the library, though I may have overlooked
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/pprint.py - About 3 hrs to fix

      File cp720.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Python Character Mapping Codec cp720 generated on Windows:
      Vista 6.0.6002 SP2 Multiprocessor Free with the command:
        python Tools/unicode/genwincodec.py 720
      """#"
      
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Lib/encodings/cp720.py - About 2 hrs to fix

        File cp720.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Python Character Mapping Codec cp720 generated on Windows:
        Vista 6.0.6002 SP2 Multiprocessor Free with the command:
          python Tools/unicode/genwincodec.py 720
        """#"
        
        Severity: Minor
        Found in vector-uefi/fd/efi/StdLib/lib/python.27/encodings/cp720.py - About 2 hrs to fix

          Function ValidFile3 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def ValidFile3(AllFiles, File, Workspace='', EfiSource='', EdkSource='', Dir='.', OverrideDir=''):
              # Replace the Edk macros
              if OverrideDir != '' and OverrideDir != None:
                  if OverrideDir.find('$(EFI_SOURCE)') > -1:
                      OverrideDir = OverrideDir.replace('$(EFI_SOURCE)', EfiSource)
          Severity: Minor
          Found in BaseTools/Source/Python/Common/Misc.py - About 2 hrs 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 FindLibraryClassInstanceOfModule has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def FindLibraryClassInstanceOfModule(self, Lib, Arch, ModuleType, ModuleName):
                  #
                  # First find if exist in <LibraryClass> of <Components> from dsc file
                  #
                  for Dsc in self.DscDatabase.keys():
          Severity: Minor
          Found in BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py - About 2 hrs 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 FromXml has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def FromXml(self, Item, Key):
                  if self.FileNames:
                      pass
                  BinaryFile = BinaryFileObject()
                  FilenameList = []
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py - About 2 hrs 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 GetWorkspacePackage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def GetWorkspacePackage():
              DecFileList = []
              WorkspaceDir = os.environ["WORKSPACE"]
              for Root, Dirs, Files in os.walk(WorkspaceDir):
                  if 'CVS' in Dirs:
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Library/Parsing.py - About 2 hrs 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 GetLibInstanceInfo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def GetLibInstanceInfo(String, WorkSpace, LineNo):
          
              FileGuidString = ""
              VerString = ""
          
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Library/Misc.py - About 2 hrs 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 GetPackageListInfo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def GetPackageListInfo(FileNameString, WorkSpace, LineNo): 
              PackageInfoList = []
              DefineSectionMacros = {}
              PackageSectionMacros = {}
              
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py - About 2 hrs 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 _CheckReDefine has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def _CheckReDefine(self, Key, Scope = None):
                  if not Scope:
                      Scope = self._RawData.CurrentScope
                      return
                  
          Severity: Minor
          Found in BaseTools/Source/Python/UPT/Parser/DecParser.py - About 2 hrs 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 _GetSourceFiles has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def _GetSourceFiles(self):
                  if self._Sources == None:
                      self._Sources = []
                      RecordList = self._RawData[MODEL_EFI_SOURCE_FILE, self._Arch, self._Platform]
                      Macros = self._Macros
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/WorkspaceDatabase.py - About 2 hrs 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 GenFfs has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def GenFfs (self, FvName, Dict = {}):
                  DXE_GUID = "FC510EE7-FFDC-11D4-BD41-0080C73C8881"
                  PEI_GUID = "1B45CC0A-156A-428A-AF62-49864DA0E6E6"
                  Buffer = StringIO.StringIO('')
                  AprioriFileGuid = DXE_GUID
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/AprioriSection.py - About 2 hrs 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 GetCurrentArch has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def GetCurrentArch(self) :
          
                  TargetArchList = GenFdsGlobalVariable.ArchList
          
                  PlatformArchList = self.__GetPlatformArchList__()
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/FfsInfStatement.py - About 2 hrs 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 _SectionHeaderParser has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def _SectionHeaderParser(self):
                  self._Scope = []
                  self._SectionName = ''
                  self._SectionType = []
                  ArchList = set()
          Severity: Minor
          Found in BaseTools/Source/Python/Workspace/MetaFileParser.py - About 2 hrs 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 __GetTokenStatements has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def __GetTokenStatements(self, Obj):
                  if self.__IsKeyword( "BaseAddress"):
                      if not self.__IsToken( "="):
                          raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
              
          Severity: Minor
          Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 hrs 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 GenerateReport has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def GenerateReport(self, File, GlobalPcdReport, GlobalPredictionReport, GlobalDepexParser, ReportType):
                  FileWrite(File, gSectionStart)
          
                  FwReportFileName = os.path.join(self._BuildDir, "DEBUG", self.ModuleName + ".txt")
                  if os.path.isfile(FwReportFileName):
          Severity: Minor
          Found in BaseTools/Source/Python/build/BuildReport.py - About 2 hrs 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 GetLangDef has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def GetLangDef(self, File, Line):
                  Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
                  if len(Lang) != 3:
                      try:
                          FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read()
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/UniClassObject.py - About 2 hrs 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 GetFileList has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def GetFileList(SourceFileList, IncludeList, SkipList):
              if IncludeList == None:
                  EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Include path for unicode file is not defined")
          
              FileList = []
          Severity: Minor
          Found in BaseTools/Source/Python/AutoGen/StrGather.py - About 2 hrs 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 MetaDataFileCheckLibraryNoUse has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              def MetaDataFileCheckLibraryNoUse(self):
                  if EccGlobalData.gConfig.MetaDataFileCheckLibraryNoUse == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
                      EdkLogger.quiet("Checking for library instance not used ...")
                      SqlCommand = """select ID, Value1 from Inf as A where A.Model = %s and A.Value1 not in (select B.Value1 from Dsc as B where Model = %s)""" % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)
                      RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand)
          Severity: Minor
          Found in BaseTools/Source/Python/Ecc/Check.py - About 2 hrs 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

          Severity
          Category
          Status
          Source
          Language