nitc :: NullableSends :: _buggy_sends
nitc :: NullableSends :: _nclassdef
nitc :: NullableSends :: _nullable_sends
nitc :: NullableSends :: _total_sends
nitc :: NullableSends :: buggy_sends
nitc :: NullableSends :: buggy_sends=
nitc :: NullableSends :: defaultinit
nitc :: NullableSends :: nclassdef
nitc :: NullableSends :: nclassdef=
nitc :: NullableSends :: nullable_sends
nitc :: NullableSends :: nullable_sends=
nitc :: NullableSends :: total_sends
nitc :: NullableSends :: total_sends=
nitc $ NullableSends :: SELF
Type of this instance, automatically specialized in every classnitc :: NullableSends :: _buggy_sends
nitc :: NullableSends :: _nclassdef
nitc :: NullableSends :: _nullable_sends
nitc :: NullableSends :: _total_sends
nitc :: NullableSends :: buggy_sends
nitc :: NullableSends :: buggy_sends=
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: Visitor :: current_node=
The current visited nodenitc :: NullableSends :: defaultinit
core :: Object :: defaultinit
nitc :: Visitor :: defaultinit
nitc :: Visitor :: enter_visit
Ask the visitor to visit a given node.core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.nitc :: NullableSends :: nclassdef
nitc :: NullableSends :: nclassdef=
nitc :: NullableSends :: nullable_sends
nitc :: NullableSends :: nullable_sends=
core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: NullableSends :: total_sends
nitc :: NullableSends :: total_sends=
private class NullableSends
super Visitor
var nclassdef: AClassdef
var total_sends: Int = 0
var nullable_sends: Int = 0
var nullable_eq_sends: Int = 0
var buggy_sends: Int = 0
redef fun visit(n)
do
n.visit_all(self)
if n isa ASendExpr then
self.total_sends += 1
var t = n.n_expr.mtype
if t == null then
self.buggy_sends += 1
return
end
t = t.anchor_to(self.nclassdef.mclassdef.mmodule, self.nclassdef.mclassdef.bound_mtype)
if t isa MNullableType then
var p = n.callsite.mproperty
if p.is_null_safe then
self.nullable_eq_sends += 1
else
self.nullable_sends += 1
end
else if t isa MClassType then
# Nothing
else
n.debug("Problem: strange receiver type found: {t} ({t.class_name})")
end
end
end
end
src/metrics/nullables_metrics.nit:109,1--143,3