parameters: (args)
docstring: Runs the analyzer against the given compilation database.
docstring_summary: Runs the analyzer against the given compilation database.
docstring_tokens: Runs the analyzer against the given compilation database .
function: def run_analyzer_parallel(args):
      """ Runs the analyzer against the given compilation database. """
  
      def exclude(filename):
          """ Return true when any excluded directory prefix the filename. """
          return any(re.match(r'^' + directory, filename)
                     for directory in args.excludes)
  
      consts = {
          'clang': args.clang,
          'output_dir': args.output,
          'output_format': args.output_format,
          'output_failures': args.output_failures,
          'direct_args': analyzer_params(args),
          'force_debug': args.force_debug,
          'ctu': get_ctu_config_from_args(args)
      }
  
      logging.debug('run analyzer against compilation database')
      with open(args.cdb, 'r') as handle:
          generator = (dict(cmd, **consts)
                       for cmd in json.load(handle) if not exclude(cmd['file']))
          # when verbose output requested execute sequentially
          pool = multiprocessing.Pool(1 if args.verbose > 2 else None)
          for current in pool.imap_unordered(run, generator):
              if current is not None:
                  # display error message from the static analyzer
                  for line in current['error_output']:
                      logging.info(line.rstrip())
          pool.close()
          pool.join()
function_tokens: def run_analyzer_parallel ( args ) : def exclude ( filename ) : """ Return true when any excluded directory prefix the filename. """ return any ( re . match ( r'^' + directory , filename ) for directory in args . excludes ) consts = { 'clang' : args . clang , 'output_dir' : args . output , 'output_format' : args . output_format , 'output_failures' : args . output_failures , 'direct_args' : analyzer_params ( args ) , 'force_debug' : args . force_debug , 'ctu' : get_ctu_config_from_args ( args ) } logging . debug ( 'run analyzer against compilation database' ) with open ( args . cdb , 'r' ) as handle : generator = ( dict ( cmd , * * consts ) for cmd in json . load ( handle ) if not exclude ( cmd [ 'file' ] ) ) # when verbose output requested execute sequentially pool = multiprocessing . Pool ( 1 if args . verbose > 2 else None ) for current in pool . imap_unordered ( run , generator ) : if current is not None : # display error message from the static analyzer for line in current [ 'error_output' ] : logging . info ( line . rstrip ( ) ) pool . close ( ) pool . join ( )