private class DetectVarianceConstraintsPhase
super Phase
init
do
toolcontext.option_context.add_option(toolcontext.opt_detect_variance_constraints)
end
redef fun process_mainmodule(mainmodule, given_mmodules)
do
if not toolcontext.opt_detect_variance_constraints.value and not toolcontext.opt_all.value then return
print "--- Detection of variance constraints on formal parameter types ---"
var k = new DetectVarianceConstraints
k.collect(mainmodule)
print "-- Generic classes --"
k.cpt_class.print_elements(10)
print " total classes: {k.cpt_class.sum}"
print " total formal parameters: {k.pts.length}"
k.propagate
print "-- Including `private` properties --"
k.print_stats
k = new DetectVarianceConstraints
k.exclude_private = true
k.collect(mainmodule)
k.propagate
print "-- Excluding `private` properties --"
k.print_stats
end
end
src/metrics/detect_variance_constraints.nit:41,1--77,3