From f4ecc6ad24c940fca33d34dfcafe7124e495b30d Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 21 Apr 2015 16:27:32 -0400 Subject: [PATCH] metrics/mendel: sort results in console display Signed-off-by: Alexandre Terrasa --- src/metrics/mendel_metrics.nit | 32 ++++++++++++++++++-------------- tests/sav/nitmetrics_args1.res | 2 -- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/metrics/mendel_metrics.nit b/src/metrics/mendel_metrics.nit index 1ee1db2..3988824 100644 --- a/src/metrics/mendel_metrics.nit +++ b/src/metrics/mendel_metrics.nit @@ -81,24 +81,28 @@ private class MendelMetricsPhase metrics.collect(mclasses) if csv then metrics.to_csv.save("{out}/mendel.csv") - print toolcontext.format_h4("\tlarge mclasses (threshold: {cnblp.threshold})") - for mclass in cnblp.above_threshold do - print toolcontext.format_p("\t {mclass.name}: {cnblp.values[mclass]}") + var threshold = cnblp.threshold + print toolcontext.format_h4("\tlarge mclasses (threshold: {threshold})") + for mclass in cnblp.sort do + var val = cnblp.values[mclass] + if val.to_f < threshold then break + print toolcontext.format_p("\t {mclass.name}: {val}") end - print toolcontext.format_h4("\tbudding mclasses (threshold: {cnvi.threshold})") - for mclass in cnvi.above_threshold do - print toolcontext.format_p("\t {mclass.name}: {cnvi.values[mclass]}") + threshold = cnvi.threshold + print toolcontext.format_h4("\tbudding mclasses (threshold: {threshold})") + for mclass in cnvi.sort do + var val = cnvi.values[mclass] + if val.to_f < threshold then break + print toolcontext.format_p("\t {mclass.name}: {val}") end - print toolcontext.format_h4("\tblooming mclasses (threshold: {cnvs.threshold})") - for mclass in cnvs.above_threshold do - print toolcontext.format_p("\t {mclass.name}: {cnvs.values[mclass]}") - end - - print toolcontext.format_h4("\tblooming mclasses (threshold: {cnvs.threshold})") - for mclass in cnvs.above_threshold do - print toolcontext.format_p("\t {mclass.name}: {cnvs.values[mclass]}") + threshold = cnvs.threshold + print toolcontext.format_h4("\tblooming mclasses (threshold: {threshold})") + for mclass in cnvs.sort do + var val = cnvs.values[mclass] + if val.to_f < threshold then break + print toolcontext.format_p("\t {mclass.name}: {val}") end if csv then diff --git a/tests/sav/nitmetrics_args1.res b/tests/sav/nitmetrics_args1.res index 9bd4a19..73ce784 100644 --- a/tests/sav/nitmetrics_args1.res +++ b/tests/sav/nitmetrics_args1.res @@ -701,8 +701,6 @@ Statistics of type usage: Sys: 4.0 blooming mclasses (threshold: 12.0) Sys: 16.0 - blooming mclasses (threshold: 12.0) - Sys: 16.0 --- Detection of the usage of covariance static type conformance --- -- Total -- - Kinds of the subtype - -- 1.7.9.5