Merge: doc: fixed some typos and other misc. corrections
[nit.git] / src / metrics / refinement_metrics.nit
index 549f661..7ba18e8 100644 (file)
 module refinement_metrics
 
 import model
-private import metrics_base
+import metrics_base
+
+redef class ToolContext
+       var refinement_metrics_phase: Phase = new RefinementMetricsPhase(self, null)
+end
+
+private class RefinementMetricsPhase
+       super Phase
+       redef fun process_mainmodule(mainmodule, given_mmodules)
+       do
+               if not toolcontext.opt_refinement.value and not toolcontext.opt_all.value then return
+               compute_refinement_metrics(toolcontext.modelbuilder.model)
+       end
+end
 
 # Print refinement usage metrics
 fun compute_refinement_metrics(model: Model)