public class MethodAnalyzeMetrics
super Visitor
var ameth_prop_def: AMethPropdef
var line_number = new Counter[nullable Int]
var total_self_call = 0
var class_call = new Counter[MClassType]
redef fun visit(n) do
n.visit_all(self)
if n isa AExpr then
if not n isa ABlockExpr then
if n.first_location != null then
line_number.inc(n.first_location.line_start)
end
end
end
if n isa ASendExpr then
var callsite = n.callsite
if callsite != null then
var class_site_recv = callsite.recv
if class_site_recv isa MClassType then class_call.inc(class_site_recv)
if callsite.recv_is_self then self.total_self_call += 1
end
end
end
end
src/metrics/method_analyze_metrics.nit:48,1--73,3