parameters: (output_dir, html)
docstring: Generate a unique sequence of bugs from given output directory.
  
      Duplicates can be in a project if the same module was compiled multiple
      times with different compiler options. These would be better to show in
      the final report (cover) only once.
docstring_summary: Generate a unique sequence of bugs from given output directory.
docstring_tokens: Generate a unique sequence of bugs from given output directory .
function: def read_bugs(output_dir, html):
      # type: (str, bool) -> Generator[Dict[str, Any], None, None]
      """ Generate a unique sequence of bugs from given output directory.
  
      Duplicates can be in a project if the same module was compiled multiple
      times with different compiler options. These would be better to show in
      the final report (cover) only once. """
  
      def empty(file_name):
          return os.stat(file_name).st_size == 0
  
      duplicate = duplicate_check(
          lambda bug: '{bug_line}.{bug_path_length}:{bug_file}'.format(**bug))
  
      # get the right parser for the job.
      parser = parse_bug_html if html else parse_bug_plist
      # get the input files, which are not empty.
      pattern = os.path.join(output_dir, '*.html' if html else '*.plist')
      bug_files = (file for file in glob.iglob(pattern) if not empty(file))
  
      for bug_file in bug_files:
          for bug in parser(bug_file):
              if not duplicate(bug):
                  yield bug
function_tokens: def read_bugs ( output_dir , html ) : # type: (str, bool) -> Generator[Dict[str, Any], None, None] def empty ( file_name ) : return os . stat ( file_name ) . st_size == 0 duplicate = duplicate_check ( lambda bug : '{bug_line}.{bug_path_length}:{bug_file}' . format ( * * bug ) ) # get the right parser for the job. parser = parse_bug_html if html else parse_bug_plist # get the input files, which are not empty. pattern = os . path . join ( output_dir , '*.html' if html else '*.plist' ) bug_files = ( file for file in glob . iglob ( pattern ) if not empty ( file ) ) for bug_file in bug_files : for bug in parser ( bug_file ) : if not duplicate ( bug ) : yield bug