# Extract metrics about README files
private class ReadmeMetricsPhase
super Phase
redef fun process_mainmodule(mainmodule, given_mmodules) do
if not toolcontext.opt_readme.value and not toolcontext.opt_all.value then return
print toolcontext.format_h1("\n# ReadMe metrics")
var model = toolcontext.modelbuilder.model
var metrics = new ReadmeMetrics
metrics.collect_metrics(model.mpackages)
metrics.to_console(toolcontext)
var csv = toolcontext.opt_csv.value
if csv then metrics.to_csv.write_to_file("{toolcontext.opt_dir.value or else "metrics"}/readme.csv")
end
end
src/metrics/readme_metrics.nit:30,1--47,3