cmetrics.clear
cmetrics.collect(new HashSet[MClass].from(mod_mclasses))
cmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then cmetrics.to_csv.save("{out}/{mgroup}_classes.csv")
+ if csv then cmetrics.to_csv.write_to_file("{out}/{mgroup}_classes.csv")
hmetrics.clear
hmetrics.collect(new HashSet[MModule].from(mgroup.mmodules))
hmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then hmetrics.to_csv.save("{out}/{mgroup}_inheritance.csv")
+ if csv then hmetrics.to_csv.write_to_file("{out}/{mgroup}_inheritance.csv")
end
end
if not mclasses.is_empty then
cmetrics.clear
cmetrics.collect(mclasses)
cmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then cmetrics.to_csv.save("{out}/summary_classes.csv")
+ if csv then cmetrics.to_csv.write_to_file("{out}/summary_classes.csv")
hmetrics.clear
hmetrics.collect(mmodules)
hmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then hmetrics.to_csv.save("{out}/summary_inheritance.csv")
+ if csv then hmetrics.to_csv.write_to_file("{out}/summary_inheritance.csv")
end
end
end
mclasses.add_all(mod_mclasses)
metrics.collect(new HashSet[MClass].from(mod_mclasses))
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/{mgroup}.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/{mgroup}.csv")
end
end
if not mclasses.is_empty then
print toolcontext.format_h2("\n ## global metrics")
metrics.collect(mclasses)
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/summary.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/summary.csv")
end
end
end
var metrics = new MetricSet
metrics.register(cnblp, cnvi, cnvs)
metrics.collect(mclasses)
- if csv then metrics.to_csv.save("{out}/mendel.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/mendel.csv")
var threshold = cnblp.threshold
print toolcontext.format_h4("\tlarge mclasses (threshold: {threshold})")
if csv then
var csvh = new CsvDocument
- csvh.format = new CsvFormat('"', ';', "\n")
+ csvh.separator = ';'
csvh.header = ["povr", "ovr", "pext", "ext", "pspe", "spe", "prep", "rep", "eq"]
for mclass in mclasses do
var povr = mclass.is_pure_overrider(model_view).object_id
var eq = mclass.is_equal(model_view).object_id
csvh.add_record(povr, ovr, pext, ext, pspe, spe, prep, rep, eq)
end
- csvh.save("{out}/inheritance_behaviour.csv")
+ csvh.write_to_file("{out}/inheritance_behaviour.csv")
end
end
end
# Export the metric set in CSV format
fun to_csv: CsvDocument do
var csv = new CsvDocument
-
- csv.format = new CsvFormat('"', ';', "\n")
+ csv.separator = ';'
# set csv headers
csv.header.add("entry")
metrics.clear
metrics.collect(new HashSet[MModule].from(mgroup.mmodules))
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/{mgroup}.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/{mgroup}.csv")
end
end
if not mmodules.is_empty then
metrics.clear
metrics.collect(mmodules)
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/summary.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/summary.csv")
end
end
end
mclasses.add_all(mod_mclasses)
metrics.collect(new HashSet[MClass].from(mod_mclasses))
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/{mgroup}.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/{mgroup}.csv")
end
end
if not mclasses.is_empty then
print toolcontext.format_h2("\n ## global metrics")
metrics.collect(mclasses)
metrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then metrics.to_csv.save("{out}/summary.csv")
+ if csv then metrics.to_csv.write_to_file("{out}/summary.csv")
end
compute_nullables_metrics(toolcontext.modelbuilder)
mmetrics.register(new MNLDD(toolcontext.modelbuilder))
mmetrics.collect(new HashSet[MModule].from([mainmodule]))
mmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then mmetrics.to_csv.save("{out}/{mainmodule}.csv")
+ if csv then mmetrics.to_csv.write_to_file("{out}/{mainmodule}.csv")
var mtypes = new HashSet[MType]
var analysis = new RapidTypeAnalysis(toolcontext.modelbuilder, mainmodule)
cmetrics.register(analysis.cnli)
cmetrics.register(analysis.cnlc)
cmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then cmetrics.to_csv.save("{out}/mclasses.csv")
+ if csv then cmetrics.to_csv.write_to_file("{out}/mclasses.csv")
print toolcontext.format_h2("\n ## Total live instances by mtypes")
var tmetrics = new MetricSet
tmetrics.register(analysis.tnli)
tmetrics.register(analysis.tnlc)
tmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then tmetrics.to_csv.save("{out}/mtypes.csv")
+ if csv then tmetrics.to_csv.write_to_file("{out}/mtypes.csv")
print toolcontext.format_h2("\n ## MType complexity")
var gmetrics = new MetricSet
gmetrics.register(new TDGS)
gmetrics.collect(mtypes)
gmetrics.to_console(1, not toolcontext.opt_nocolors.value)
- if csv then gmetrics.to_csv.save("{out}/complexity.csv")
+ if csv then gmetrics.to_csv.write_to_file("{out}/complexity.csv")
callsite_info(analysis)
# dump type and method infos
if csv then
- analysis.live_types_to_csv.save("{out}/rta_types.csv")
+ analysis.live_types_to_csv.write_to_file("{out}/rta_types.csv")
analysis.live_methods_to_tree.write_to_file("{out}/rta_methods.dat")
end
end
var types = typeset.to_a
(new CachedAlphaComparator).sort(types)
var res = new CsvDocument
- res.format = new CsvFormat('"', ';', "\n")
+ res.separator = ';'
res.header = ["Type", "Resolution", "Liveness", "Cast-liveness"]
for t in types do
var reso