module metrics
import metrics_base
+import refinement_metrics
import static_types_metrics
import nullables_metrics
import self_metrics
-import model_stats
import generate_hierarchies
import rta_metrics
import model_hyperdoc
redef class ToolContext
+ # --refinement
+ var opt_refinement = new OptionBool("Compute metrics about refinement usage", "--refinement")
# --self
var opt_self = new OptionBool("Compute metrics about the usage of explicit and implicit self", "--self")
# --nullables
redef init
do
super
+ self.option_context.add_option(opt_refinement)
self.option_context.add_option(opt_self)
self.option_context.add_option(opt_nullables)
self.option_context.add_option(opt_static_types)
# See the License for the specific language governing permissions and
# limitations under the License.
-# General statistics on a model
-module model_stats
+# Collect metrics about refinement usage
+module refinement_metrics
import model
private import metrics_base
-# Print general statistics on a model
-fun compute_statistics(model: Model)
+# Print refinement usage metrics
+fun compute_refinement_metrics(model: Model)
do
- print "--- Statistics of the model ---"
+ print "--- Metrics of refinement usage ---"
var nbmod = model.mmodules.length
print "Number of modules: {nbmod}"
# Now, we just have to play with the model!
print "*** STATS ***"
-print ""
-compute_statistics(model)
+# Refinement usage metrics
+if toolcontext.opt_refinement.value then
+ print ""
+ compute_refinement_metrics(model)
+end
# Self usage metrics
if toolcontext.opt_self.value then