-# Print inheritance usage metrics
-fun compute_inheritance_metrics(toolcontext: ToolContext, model: Model)
-do
- # global summary metrics
- var nmd: Int = 0 # (NMD) Number of Modules
- var nc: Int = 0 # (NC) Number of Classes
- var ni: Int = 0 # (NI) Number of Interfaces
- var nac : Int = 0 # (NAC) Number of Abstract Classes
- var ngc : Int = 0 # (NGC) Number of Generic Classes
- var ngi : Int = 0 # (NGI) Number of Generic Interfaces
- # (SL) Std-Lib summary metrics
- var nmdsl: Int = 0 # (NMDSL) Number of Modules in Std-Lib
- var ncsl: Int = 0 # (NCSL) Number of Classes in Std-Lib
- var nisl: Int = 0 # (NISL) Number of Interfaces in Std-Lib
- var nacsl : Int = 0 # (NACSL) Number of Abstract Classes in Std-Lib
- var ngcsl : Int = 0 # (NGCSL) Number of Generic Classes in Std-Lib
- var ngisl : Int = 0 # (NGISL) Number of Generic Interfaces in Std-Lib
- # (UD) User-Defined summary metrics
- var nmdud: Int = 0 # (NMDUD) Number of Modules User Defined
- var ncud: Int = 0 # (NCUD) Number of Classes User Defined
- var niud: Int = 0 # (NIUD) Number of Interfaces User Defined
- var nacud : Int = 0 # (NACUD) Number of Abstract Classes User Defined
- var ngcud : Int = 0 # (NGCUD) Number of Generic Classes User Defined
- var ngiud : Int = 0 # (NGIUD) Number of Generic Interfaces User Defined
-
- # global summary inheritance metrics
- var dit = "" # (DIT) Global Depth in Inheritance Tree
- var dui = "" # (DUI) Proportion of types that either implement an interface or extend another type other than Object
- var ccdui = "" # (CCDUI) Proportion of classes that extend some other class.
- var cidui = "" # (CIDUI) Proportion of classes that implement some other interface.
- var iidui = "" # (IIDUI) Proportion of interfaces that extend some other interface.
- var inhf = "" # (IF) Proportion of types Inherited From, that is, those types that are either extended or implemented
- var ccif = "" # (CCIF) Proportion of classes extended by some other class.
- var icif = "" # (ICIF) Proportion of interfaces implemented by some other class.
- var iiif = "" # (IIIF) Proportion of interfaces extended by some other interface.
-
- # (SL -> *) Std-Lib summary inheritance metrics
- var sldui = "" # (SLDUI) Proportion of std-lib types that either implement an interface or extend another std-lib type other than Object
- var slccdui = "" # (SLCCDUI) Proportion of std-lib classes that extend some other std-lib class.
- var slcidui = "" # (SLCIDUI) Proportion of std-lib classes that implement some other std-lib interface.
- var sliidui = "" # (SLIIDUI) Proportion of std-lib interfaces that extend some other std-lib interface.
- var slinhf = "" # (SLIF) Proportion of SL types Inherited From, that is, those types that are either extended or implemented
- var slccif = "" # (SLCCIF) Proportion of SL classes extended by some other class.
- var slicif = "" # (SLICIF) Proportion of SL interfaces implemented by some other class.
- var sliiif = "" # (SLIIIF) Proportion of SL interfaces extended by some other interface.
-
- # (SL -> SL) Std-Lib summary inheritance metrics
- var slinhfsl = "" # (SLIFSL) Proportion of SL types Inherited From, that is, those types that are either extended or implemented by a SL type
- var slccifsl = "" # (SLCCIFSL) Proportion of SL classes extended by some other SL class.
- var slicifsl = "" # (SLICIFSL) Proportion of SL interfaces implemented by some other SL class.
- var sliiifsl = "" # (SLIIIFSL) Proportion of SL interfaces extended by some other SL interface.
-
- # (SL -> UD) Std-Lib summary inheritance metrics
- var slinhfud = "" # (SLIFUD) Proportion of SL types Inherited From, that is, those types that are either extended or implemented by a UD type
- var slccifud = "" # (SLCCIFUD) Proportion of SL classes extended by some other UD class.
- var slicifud = "" # (SLICIFUD) Proportion of SL interfaces implemented by some other UD class.
- var sliiifud = "" # (SLIIIFUD) Proportion of SL interfaces extended by some other UD interface.
-
- # (UD -> *) User-defined summary inheritance metrics
- var uddui = "" # (UDDUI) Proportion user-defined of types that either implement an interface or extend another type
- var udccdui = "" # (UDCCDUI) Proportion of user-defined classes that extend some other class.
- var udcidui = "" # (UDCIDUI) Proportion of user-defined classes that implement some other interface.
- var udiidui = "" # (UDIIDUI) Proportion of user-defined interfaces that extend some other interface.
- var udinhf = "" # (UDIF) Proportion of UD types Inherited From, that is, those types that are either extended or implemented
- var udccif = "" # (UDCCIF) Proportion of UD classes extended by some other class.
- var udicif = "" # (UDICIF) Proportion of UD interfaces implemented by some other class.
- var udiiif = "" # (UDIIIF) Proportion of UD interfaces extended by some other interface.
-
- # (UD -> SL) User-defined summary inheritance metrics
- var udduisl = "" # (UDDUISL) Proportion user-defined of types that either implement an interface or extend another type SL
- var udccduisl = "" # (UDCCDUISL) Proportion of user-defined classes that extend some other SL class.
- var udciduisl = "" # (UDCIDUISL) Proportion of user-defined classes that implement some other SL interface.
- var udiiduisl = "" # (UDIIDUISL) Proportion of user-defined interfaces that extend some other SL interface.
-
- # (UD -> UD) User-defined summary inheritance metrics
- var ditud = ""
- var udduiud = "" # (UDDUIUD) Proportion user-defined of types that either implement an interface or extend another type user-defined
- var udccduiud = "" # (UDCCDUIUD) Proportion of user-defined classes that extend some other user-defined class.
- var udciduiud = "" # (UDCIDUIUD) Proportion of user-defined classes that implement some other user-defined interface.
- var udiiduiud = "" # (UDIIDUIUD) Proportion of user-defined interfaces that extend some other user-defined interface.
- var udinhfud = "" # (UDIFUD) Proportion of UD types Inherited From, that is, those types that are either extended or implemented by another UD type
- var udccifud = "" # (UDCCIFUD) Proportion of UD classes extended by some other UD class.
- var udicifud = "" # (UDICIFUD) Proportion of UD interfaces implemented by some other UD class.
- var udiiifud = "" # (UDIIIFUD) Proportion of UD interfaces extended by some other UD interface.
-
- # compute modules scalar metrics
- for mmodule in model.mmodules do
- mmodule.compute_module_inheritance_metrics(model)