Property definitions

nitc $ MDUII :: defaultinit
# 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