Count interface that have another parents than Object
nitc :: MDUII :: defaultinit
nitc :: MModuleMetric :: _filter
Filter to apply on model if anynitc :: MModuleMetric :: _mainmodule
Mainmodule used for linearizationnitc :: MModuleMetric :: _model
Model view used to collect and filter entitiesnitc :: FloatMetric :: _values_cache
FloatMetric
uses a Map to store values in intern.
nitc :: Metric :: above_threshold
The set of element above the thresholdserialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: MModuleMetric :: defaultinit
nitc :: MDUII :: defaultinit
nitc :: FloatMetric :: defaultinit
core :: Object :: defaultinit
nitc :: Metric :: defaultinit
nitc :: MModuleMetric :: filter=
Filter to apply on model if anyserialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
nitc :: Metric :: has_element
Does the element have a value for this metric?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.
nitc :: MModuleMetric :: mainmodule=
Mainmodule used for linearizationnitc :: MModuleMetric :: model=
Model view used to collect and filter entitiesserialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
nitc :: Metric :: to_console
Pretty print the metric results in consoleserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
nitc :: FloatMetric :: values_cache
FloatMetric
uses a Map to store values in intern.
nitc :: FloatMetric :: values_cache=
FloatMetric
uses a Map to store values in intern.
Serializer::serialize
# Module metric: proportion of Interface Defined Using Inheritance
#
# Count interface that have another parents than Object
class MDUII
super MModuleMetric
super FloatMetric
redef fun name do return "mduii"
redef fun desc do return "proportion of interface_kind defined using inheritance"
redef fun collect(mmodules) do
for mmodule in mmodules do
var count = 0
var nb = 0
for mclass in mmodule.intro_mclasses do
if mclass.kind == interface_kind then
if mclass.in_hierarchy(mainmodule).greaters.length > 2 then count += 1
end
nb += 1
end
if mmodule.intro_mclasses.is_empty then
values[mmodule] = 0.0
else
values[mmodule] = count.to_f / nb.to_f
end
end
end
end
src/metrics/inheritance_metrics.nit:158,1--184,3