The container class of a Nit object-oriented model.

A model knows modules, classes and properties and can retrieve them.

Introduced properties

private var _bottom_type: MBottomType

nitc :: Model :: _bottom_type

The only bottom type
private var _full_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: _full_mtype_specialization_hierarchy

Global overlapped class-type hierarchy.
private var _index: ModelIndex

nitc :: Model :: _index

ModelIndex used to perform searches
private var _intro_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: _intro_mtype_specialization_hierarchy

Class-type hierarchy restricted to the introduction.
private var _mclassdef_hierarchy: POSet[MClassDef]

nitc :: Model :: _mclassdef_hierarchy

Hierarchy of class definition.
private var _mclasses: Array[MClass]

nitc :: Model :: _mclasses

All known classes
private var _mclasses_by_name: MultiHashMap[String, MClass]

nitc :: Model :: _mclasses_by_name

Collections of classes grouped by their short name
private var _mentities_by_full_name: HashMap[String, MEntity]

nitc :: Model :: _mentities_by_full_name

Keep a direct link to mentities by full name to speed up mentity_from_uri
private var _mmodule_importation_hierarchy: POSet[MModule]

nitc :: Model :: _mmodule_importation_hierarchy

Full module importation hierarchy including private or nested links.
private var _mmodules: Array[MModule]

nitc :: Model :: _mmodules

All known modules
private var _mmodules_by_name: MultiHashMap[String, MModule]

nitc :: Model :: _mmodules_by_name

Collections of modules grouped by their short names
private var _mpackage_by_name: MultiHashMap[String, MPackage]

nitc :: Model :: _mpackage_by_name

Collections of package grouped by their names
private var _mpackage_importation_graph: HashDigraph[MPackage]

nitc :: Model :: _mpackage_importation_graph

Full package importation graph
private var _mpackages: Array[MPackage]

nitc :: Model :: _mpackages

packages of the model
private var _mproperties: Array[MProperty]

nitc :: Model :: _mproperties

All known properties
private var _mproperties_by_name: MultiHashMap[String, MProperty]

nitc :: Model :: _mproperties_by_name

Collections of properties grouped by their short name
private var _nitdoc_inline_processor: MarkdownProcessor

nitc :: Model :: _nitdoc_inline_processor

Get a markdown inline processor for Nitdoc comments.
private var _nitdoc_md_processor: MarkdownProcessor

nitc :: Model :: _nitdoc_md_processor

Get a markdown processor for Nitdoc comments.
private var _no_location: Location

nitc :: Model :: _no_location

Place-holder object that means no-location
private var _null_type: MNullType

nitc :: Model :: _null_type

The only null type
fun bottom_type: MBottomType

nitc :: Model :: bottom_type

The only bottom type
protected fun bottom_type=(bottom_type: MBottomType)

nitc :: Model :: bottom_type=

The only bottom type
fun collect_intro_mclasses(filter: nullable ModelFilter): HashSet[MClass]

nitc :: Model :: collect_intro_mclasses

Collect all MClasses introduced in self
fun collect_intro_mproperties(filter: nullable ModelFilter): HashSet[MProperty]

nitc :: Model :: collect_intro_mproperties

Collect all MProperties introduced in self
fun collect_mclassdefs(filter: nullable ModelFilter): HashSet[MClassDef]

nitc :: Model :: collect_mclassdefs

Collect all MClassDefs in self
fun collect_mclasses(filter: nullable ModelFilter): HashSet[MClass]

nitc :: Model :: collect_mclasses

Collect all MClasses in self
fun collect_mentities(filter: nullable ModelFilter): HashSet[MEntity]

nitc :: Model :: collect_mentities

Collect all MEntities in self
fun collect_mgroups(filter: nullable ModelFilter): HashSet[MGroup]

nitc :: Model :: collect_mgroups

Collect all MGroups in self
fun collect_mmodules(filter: nullable ModelFilter): HashSet[MModule]

nitc :: Model :: collect_mmodules

Collect all MModules in self
fun collect_mpackages(filter: nullable ModelFilter): HashSet[MPackage]

nitc :: Model :: collect_mpackages

Collect all MPackages in self
fun collect_mpropdefs(filter: nullable ModelFilter): HashSet[MPropDef]

nitc :: Model :: collect_mpropdefs

Collect all MPropDefs in self
fun collect_mproperties(filter: nullable ModelFilter): HashSet[MProperty]

nitc :: Model :: collect_mproperties

Collect all MProperties in self
fun concerns_tree(mconcerns: Collection[MConcern]): ConcernsTree

nitc :: Model :: concerns_tree

Build an ordered tree with from concerns
fun find(query: String, limit: nullable Int, filter: nullable ModelFilter): Array[MEntity]

nitc :: Model :: find

Search mentities based on a query string
private fun fname_sorter=(fname_sorter: FullNameComparator)

nitc :: Model :: fname_sorter=

private fun full_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: full_mtype_specialization_hierarchy

Global overlapped class-type hierarchy.
private fun full_mtype_specialization_hierarchy=(full_mtype_specialization_hierarchy: POSet[MClassType])

nitc :: Model :: full_mtype_specialization_hierarchy=

Global overlapped class-type hierarchy.
fun get_mclasses_by_name(name: String): nullable Array[MClass]

nitc :: Model :: get_mclasses_by_name

Return all classes named name.
fun get_mmodules_by_name(name: String): nullable Array[MModule]

nitc :: Model :: get_mmodules_by_name

Return all module named name
fun get_mpackages_by_name(name: String): nullable Array[MPackage]

nitc :: Model :: get_mpackages_by_name

Return all package named name
fun get_mproperties_by_name(name: String): nullable Array[MProperty]

nitc :: Model :: get_mproperties_by_name

Return all properties named name.
fun index: ModelIndex

nitc :: Model :: index

ModelIndex used to perform searches
fun index=(index: ModelIndex)

nitc :: Model :: index=

ModelIndex used to perform searches
private fun intro_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: intro_mtype_specialization_hierarchy

Class-type hierarchy restricted to the introduction.
private fun intro_mtype_specialization_hierarchy=(intro_mtype_specialization_hierarchy: POSet[MClassType])

nitc :: Model :: intro_mtype_specialization_hierarchy=

Class-type hierarchy restricted to the introduction.
private fun kind_sorter=(kind_sorter: MEntityComparator)

nitc :: Model :: kind_sorter=

private fun lfname_sorter=(lfname_sorter: FullNameLengthComparator)

nitc :: Model :: lfname_sorter=

private fun lname_sorter=(lname_sorter: NameLengthComparator)

nitc :: Model :: lname_sorter=

fun mclassdef_hierarchy: POSet[MClassDef]

nitc :: Model :: mclassdef_hierarchy

Hierarchy of class definition.
protected fun mclassdef_hierarchy=(mclassdef_hierarchy: POSet[MClassDef])

nitc :: Model :: mclassdef_hierarchy=

Hierarchy of class definition.
fun mclasses: Array[MClass]

nitc :: Model :: mclasses

All known classes
protected fun mclasses=(mclasses: Array[MClass])

nitc :: Model :: mclasses=

All known classes
private fun mclasses_by_name: MultiHashMap[String, MClass]

nitc :: Model :: mclasses_by_name

Collections of classes grouped by their short name
private fun mclasses_by_name=(mclasses_by_name: MultiHashMap[String, MClass])

nitc :: Model :: mclasses_by_name=

Collections of classes grouped by their short name
fun mentities_by_full_name: HashMap[String, MEntity]

nitc :: Model :: mentities_by_full_name

Keep a direct link to mentities by full name to speed up mentity_from_uri
protected fun mentities_by_full_name=(mentities_by_full_name: HashMap[String, MEntity])

nitc :: Model :: mentities_by_full_name=

Keep a direct link to mentities by full name to speed up mentity_from_uri
fun mentities_by_name(name: String, filter: nullable ModelFilter): Array[MEntity]

nitc :: Model :: mentities_by_name

Searches the MEntities that matches full_name.
fun mentity_by_full_name(full_name: String, filter: nullable ModelFilter): nullable MEntity

nitc :: Model :: mentity_by_full_name

Searches the MEntity that matches full_name.
fun mmodule_importation_hierarchy: POSet[MModule]

nitc :: Model :: mmodule_importation_hierarchy

Full module importation hierarchy including private or nested links.
protected fun mmodule_importation_hierarchy=(mmodule_importation_hierarchy: POSet[MModule])

nitc :: Model :: mmodule_importation_hierarchy=

Full module importation hierarchy including private or nested links.
fun mmodules: Array[MModule]

nitc :: Model :: mmodules

All known modules
protected fun mmodules=(mmodules: Array[MModule])

nitc :: Model :: mmodules=

All known modules
private fun mmodules_by_name: MultiHashMap[String, MModule]

nitc :: Model :: mmodules_by_name

Collections of modules grouped by their short names
private fun mmodules_by_name=(mmodules_by_name: MultiHashMap[String, MModule])

nitc :: Model :: mmodules_by_name=

Collections of modules grouped by their short names
private fun mpackage_by_name: MultiHashMap[String, MPackage]

nitc :: Model :: mpackage_by_name

Collections of package grouped by their names
private fun mpackage_by_name=(mpackage_by_name: MultiHashMap[String, MPackage])

nitc :: Model :: mpackage_by_name=

Collections of package grouped by their names
protected fun mpackage_importation_graph=(mpackage_importation_graph: HashDigraph[MPackage])

nitc :: Model :: mpackage_importation_graph=

Full package importation graph
fun mpackages: Array[MPackage]

nitc :: Model :: mpackages

packages of the model
protected fun mpackages=(mpackages: Array[MPackage])

nitc :: Model :: mpackages=

packages of the model
fun mproperties: Array[MProperty]

nitc :: Model :: mproperties

All known properties
protected fun mproperties=(mproperties: Array[MProperty])

nitc :: Model :: mproperties=

All known properties
private fun mproperties_by_name: MultiHashMap[String, MProperty]

nitc :: Model :: mproperties_by_name

Collections of properties grouped by their short name
private fun mproperties_by_name=(mproperties_by_name: MultiHashMap[String, MProperty])

nitc :: Model :: mproperties_by_name=

Collections of properties grouped by their short name
private fun name_sorter=(name_sorter: NameComparator)

nitc :: Model :: name_sorter=

fun nitdoc_inline_processor: MarkdownProcessor

nitc :: Model :: nitdoc_inline_processor

Get a markdown inline processor for Nitdoc comments.
fun nitdoc_inline_processor=(nitdoc_inline_processor: MarkdownProcessor)

nitc :: Model :: nitdoc_inline_processor=

Get a markdown inline processor for Nitdoc comments.
fun nitdoc_md_processor: MarkdownProcessor

nitc :: Model :: nitdoc_md_processor

Get a markdown processor for Nitdoc comments.
fun nitdoc_md_processor=(nitdoc_md_processor: MarkdownProcessor)

nitc :: Model :: nitdoc_md_processor=

Get a markdown processor for Nitdoc comments.
fun no_location: Location

nitc :: Model :: no_location

Place-holder object that means no-location
protected fun no_location=(no_location: Location)

nitc :: Model :: no_location=

Place-holder object that means no-location
fun null_type: MNullType

nitc :: Model :: null_type

The only null type
protected fun null_type=(null_type: MNullType)

nitc :: Model :: null_type=

The only null type
private fun score_sorter=(score_sorter: ScoreComparator)

nitc :: Model :: score_sorter=

fun to_mpackage_tree: MPackageTree

nitc :: Model :: to_mpackage_tree

Generate a MPackageTree based on the packages, groups and modules known in the model
private fun vis_sorter=(vis_sorter: VisibilityComparator)

nitc :: Model :: vis_sorter=

Redefined properties

redef type SELF: Model

nitc $ Model :: SELF

Type of this instance, automatically specialized in every class
redef fun mentities_by_name(name: String, filter: nullable ModelFilter): Array[MEntity]

nitc :: model_index $ Model :: mentities_by_name

Searches the MEntities that matches full_name.
redef fun mentity_by_full_name(full_name: String, filter: nullable ModelFilter): nullable MEntity

nitc :: model_index $ Model :: mentity_by_full_name

Searches the MEntity that matches full_name.
redef fun model: Model

nitc $ Model :: model

A Model Entity has a direct link to its model
redef fun visit_all(v: ModelVisitor)

nitc :: model_visitor $ Model :: visit_all

Visit all the packages of the model.

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type MENTITY: SELF

nitc :: MEntity :: MENTITY

FIXME used to bypass RTA limitation on type resolution
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _bottom_type: MBottomType

nitc :: Model :: _bottom_type

The only bottom type
private var _css_classes: Array[String]

nitc :: MEntity :: _css_classes

CSS classes used to decorate self
private var _deprecation: nullable MDeprecationInfo

nitc :: MEntity :: _deprecation

Is the entity deprecated?
private var _examples: Array[MExample]

nitc :: MEntity :: _examples

Examples found for self
private var _full_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: _full_mtype_specialization_hierarchy

Global overlapped class-type hierarchy.
private var _html_full_name: String

nitc :: MEntity :: _html_full_name

The MEntity full_name escaped for HTML
private var _html_id: String

nitc :: MEntity :: _html_id

The MEntity unique ID in the HTML output
private var _html_name: String

nitc :: MEntity :: _html_name

The MEntity name escaped for HTML
private var _html_url: String

nitc :: MEntity :: _html_url

The MEntity URL in the HTML output
private var _html_url: String

nitc :: MEntity :: _html_url

private var _index: ModelIndex

nitc :: Model :: _index

ModelIndex used to perform searches
private var _intro_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: _intro_mtype_specialization_hierarchy

Class-type hierarchy restricted to the introduction.
private var _is_broken: Bool

nitc :: MEntity :: _is_broken

The indication that the entity did not pass some semantic verifications.
private var _is_fictive: Bool

nitc :: MEntity :: _is_fictive

Is self created for internal purpose?
private var _is_test: Bool

nitc :: MEntity :: _is_test

Is self created for unit testing purpose?
private var _mclassdef_hierarchy: POSet[MClassDef]

nitc :: Model :: _mclassdef_hierarchy

Hierarchy of class definition.
private var _mclasses: Array[MClass]

nitc :: Model :: _mclasses

All known classes
private var _mclasses_by_name: MultiHashMap[String, MClass]

nitc :: Model :: _mclasses_by_name

Collections of classes grouped by their short name
private var _mdoc: nullable MDoc

nitc :: MEntity :: _mdoc

The documentation associated to the entity
private var _mentities_by_full_name: HashMap[String, MEntity]

nitc :: Model :: _mentities_by_full_name

Keep a direct link to mentities by full name to speed up mentity_from_uri
private var _mexample: nullable MExample

nitc :: MEntity :: _mexample

Return this entity as a MExample
private var _mmodule_importation_hierarchy: POSet[MModule]

nitc :: Model :: _mmodule_importation_hierarchy

Full module importation hierarchy including private or nested links.
private var _mmodules: Array[MModule]

nitc :: Model :: _mmodules

All known modules
private var _mmodules_by_name: MultiHashMap[String, MModule]

nitc :: Model :: _mmodules_by_name

Collections of modules grouped by their short names
private var _mpackage_by_name: MultiHashMap[String, MPackage]

nitc :: Model :: _mpackage_by_name

Collections of package grouped by their names
private var _mpackage_importation_graph: HashDigraph[MPackage]

nitc :: Model :: _mpackage_importation_graph

Full package importation graph
private var _mpackages: Array[MPackage]

nitc :: Model :: _mpackages

packages of the model
private var _mproperties: Array[MProperty]

nitc :: Model :: _mproperties

All known properties
private var _mproperties_by_name: MultiHashMap[String, MProperty]

nitc :: Model :: _mproperties_by_name

Collections of properties grouped by their short name
private var _nitdoc_inline_processor: MarkdownProcessor

nitc :: Model :: _nitdoc_inline_processor

Get a markdown inline processor for Nitdoc comments.
private var _nitdoc_md_processor: MarkdownProcessor

nitc :: Model :: _nitdoc_md_processor

Get a markdown processor for Nitdoc comments.
private var _no_location: Location

nitc :: Model :: _no_location

Place-holder object that means no-location
private var _null_type: MNullType

nitc :: Model :: _null_type

The only null type
protected fun accept_json_serializer(v: JsonSerializer)

serialization :: Serializable :: accept_json_serializer

Refinable service to customize the serialization of this class to JSON
protected fun accept_msgpack_attribute_counter(v: AttributeCounter)

serialization :: Serializable :: accept_msgpack_attribute_counter

Hook to customize the behavior of the AttributeCounter
protected fun accept_msgpack_serializer(v: MsgPackSerializer)

serialization :: Serializable :: accept_msgpack_serializer

Hook to customize the serialization of this class to MessagePack
private fun add_doc_to_infobox(res: HInfoBox)

nitc :: MEntity :: add_doc_to_infobox

Append an entry for the doc in the given infobox
protected fun add_to_bundle(bundle: NativeBundle, key: JavaString)

serialization :: Serializable :: add_to_bundle

Called by []= to dynamically choose the appropriate method according
fun api_url: String

nitc :: MEntity :: api_url

URL to self within the JSON api.
fun bottom_type: MBottomType

nitc :: Model :: bottom_type

The only bottom type
protected fun bottom_type=(bottom_type: MBottomType)

nitc :: Model :: bottom_type=

The only bottom type
abstract fun c_name: String

nitc :: MEntity :: c_name

A fully-qualified C-like identifier of this model entity.
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun collect_ancestors(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_ancestors

Collect self ancestors (direct and indirect)
abstract fun collect_children(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_children

Collect self children (direct descendants)
fun collect_descendants(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_descendants

Collect self descendants (direct and direct)
fun collect_intro_mclasses(filter: nullable ModelFilter): HashSet[MClass]

nitc :: Model :: collect_intro_mclasses

Collect all MClasses introduced in self
fun collect_intro_mproperties(filter: nullable ModelFilter): HashSet[MProperty]

nitc :: Model :: collect_intro_mproperties

Collect all MProperties introduced in self
fun collect_linearization(mainmodule: MModule): nullable Array[MEntity]

nitc :: MEntity :: collect_linearization

Collect self linearization anchored on mainmodule
fun collect_mclassdefs(filter: nullable ModelFilter): HashSet[MClassDef]

nitc :: Model :: collect_mclassdefs

Collect all MClassDefs in self
fun collect_mclasses(filter: nullable ModelFilter): HashSet[MClass]

nitc :: Model :: collect_mclasses

Collect all MClasses in self
fun collect_mentities(filter: nullable ModelFilter): HashSet[MEntity]

nitc :: Model :: collect_mentities

Collect all MEntities in self
fun collect_mgroups(filter: nullable ModelFilter): HashSet[MGroup]

nitc :: Model :: collect_mgroups

Collect all MGroups in self
fun collect_mmodules(filter: nullable ModelFilter): HashSet[MModule]

nitc :: Model :: collect_mmodules

Collect all MModules in self
fun collect_modifiers: Array[String]

nitc :: MEntity :: collect_modifiers

Collect modifier keywords like redef, private etc
fun collect_mpackages(filter: nullable ModelFilter): HashSet[MPackage]

nitc :: Model :: collect_mpackages

Collect all MPackages in self
fun collect_mpropdefs(filter: nullable ModelFilter): HashSet[MPropDef]

nitc :: Model :: collect_mpropdefs

Collect all MPropDefs in self
fun collect_mproperties(filter: nullable ModelFilter): HashSet[MProperty]

nitc :: Model :: collect_mproperties

Collect all MProperties in self
abstract fun collect_parents(mainmodule: MModule, filter: nullable ModelFilter): Set[MENTITY]

nitc :: MEntity :: collect_parents

Collect self parents (direct ancestors)
fun color: String

nitc :: MEntity :: color

private fun complete_mdoc: nullable MDoc

nitc :: MEntity :: complete_mdoc

Doc to use in completion
private fun complete_name: String

nitc :: MEntity :: complete_name

Actual name used in completion
fun concerns_tree(mconcerns: Collection[MConcern]): ConcernsTree

nitc :: Model :: concerns_tree

Build an ordered tree with from concerns
protected fun const_color=(const_color: String)

nitc :: MEntity :: const_color=

fun core_serialize_to(serializer: Serializer)

serialization :: Serializable :: core_serialize_to

Actual serialization of self to serializer
abstract fun create_ast_representation(astbuilder: nullable ASTBuilder): ANode

nitc :: MEntity :: create_ast_representation

Build a ANode from self
fun cs_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_comment

Returns the comment of this MEntity formatted for console.
fun cs_declaration(no_color: nullable Bool): String

nitc :: MEntity :: cs_declaration

Returns the complete MEntity declaration (modifiers + name + signature).
fun cs_full_name(no_color: nullable Bool): String

nitc :: MEntity :: cs_full_name

Returns self.full_name formatted for console
fun cs_icon(no_color: nullable Bool): String

nitc :: MEntity :: cs_icon

Text icon to be displayed in front of the entity
fun cs_list_item(no_color: nullable Bool): String

nitc :: MEntity :: cs_list_item

Returns self as a list element that can be displayed in console.
fun cs_location(no_color: nullable Bool): String

nitc :: MEntity :: cs_location

Source code location of this MEntity formatted for console
fun cs_short_comment(no_color: nullable Bool): nullable String

nitc :: MEntity :: cs_short_comment

Returns the comment of this MEntity formatted for console.
fun cs_signature(no_color: nullable Bool): String

nitc :: MEntity :: cs_signature

Returns self signature formatted for console.
fun cs_source_code: String

nitc :: MEntity :: cs_source_code

Source code associated to this MEntity.
fun css_classes: Array[String]

nitc :: MEntity :: css_classes

CSS classes used to decorate self
protected fun css_classes=(css_classes: Array[String])

nitc :: MEntity :: css_classes=

CSS classes used to decorate self
fun deprecation: nullable MDeprecationInfo

nitc :: MEntity :: deprecation

Is the entity deprecated?
fun deprecation=(deprecation: nullable MDeprecationInfo)

nitc :: MEntity :: deprecation=

Is the entity deprecated?
fun examples: Array[MExample]

nitc :: MEntity :: examples

Examples found for self
protected fun examples=(examples: Array[MExample])

nitc :: MEntity :: examples=

Examples found for self
fun find(query: String, limit: nullable Int, filter: nullable ModelFilter): Array[MEntity]

nitc :: Model :: find

Search mentities based on a query string
private fun fname_sorter=(fname_sorter: FullNameComparator)

nitc :: Model :: fname_sorter=

init from_deserializer(deserializer: Deserializer)

serialization :: Serializable :: from_deserializer

Create an instance of this class from the deserializer
private fun full_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: full_mtype_specialization_hierarchy

Global overlapped class-type hierarchy.
private fun full_mtype_specialization_hierarchy=(full_mtype_specialization_hierarchy: POSet[MClassType])

nitc :: Model :: full_mtype_specialization_hierarchy=

Global overlapped class-type hierarchy.
abstract fun full_name: String

nitc :: MEntity :: full_name

A fully-qualified name of this model entity.
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun get_mclasses_by_name(name: String): nullable Array[MClass]

nitc :: Model :: get_mclasses_by_name

Return all classes named name.
fun get_mmodules_by_name(name: String): nullable Array[MModule]

nitc :: Model :: get_mmodules_by_name

Return all module named name
fun get_mpackages_by_name(name: String): nullable Array[MPackage]

nitc :: Model :: get_mpackages_by_name

Return all package named name
fun get_mproperties_by_name(name: String): nullable Array[MProperty]

nitc :: Model :: get_mproperties_by_name

Return all properties named name.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun hierarchy_poset(mainmodule: MModule, filter: nullable ModelFilter): POSet[MENTITY]

nitc :: MEntity :: hierarchy_poset

Build a poset representing self in it's own hierarchy
private fun href(v: NitlightVisitor): nullable String

nitc :: MEntity :: href

fun html_declaration: Template

nitc :: MEntity :: html_declaration

Returns the complete MEntity declaration decorated with HTML
fun html_full_name: String

nitc :: MEntity :: html_full_name

The MEntity full_name escaped for HTML
protected fun html_full_name=(html_full_name: String)

nitc :: MEntity :: html_full_name=

The MEntity full_name escaped for HTML
fun html_icon: BSIcon

nitc :: MEntity :: html_icon

An icon representative of the mentity
fun html_id: String

nitc :: MEntity :: html_id

The MEntity unique ID in the HTML output
protected fun html_id=(html_id: String)

nitc :: MEntity :: html_id=

The MEntity unique ID in the HTML output
fun html_name: String

nitc :: MEntity :: html_name

The MEntity name escaped for HTML
protected fun html_name=(html_name: String)

nitc :: MEntity :: html_name=

The MEntity name escaped for HTML
abstract fun html_namespace: Template

nitc :: MEntity :: html_namespace

Returns full_name decorated with HTML links
fun html_signature(short: nullable Bool): Template

nitc :: MEntity :: html_signature

Returns the MEntity signature decorated with HTML
fun html_url: String

nitc :: MEntity :: html_url

The MEntity URL in the HTML output
protected fun html_url=(html_url: String)

nitc :: MEntity :: html_url=

The MEntity URL in the HTML output
fun index: ModelIndex

nitc :: Model :: index

ModelIndex used to perform searches
fun index=(index: ModelIndex)

nitc :: Model :: index=

ModelIndex used to perform searches
abstract fun infobox(v: HtmlightVisitor): HInfoBox

nitc :: HInfoBoxable :: infobox

An new infobox documenting the entity
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
private fun intro_mtype_specialization_hierarchy: POSet[MClassType]

nitc :: Model :: intro_mtype_specialization_hierarchy

Class-type hierarchy restricted to the introduction.
private fun intro_mtype_specialization_hierarchy=(intro_mtype_specialization_hierarchy: POSet[MClassType])

nitc :: Model :: intro_mtype_specialization_hierarchy=

Class-type hierarchy restricted to the introduction.
fun is_broken: Bool

nitc :: MEntity :: is_broken

The indication that the entity did not pass some semantic verifications.
fun is_broken=(is_broken: Bool)

nitc :: MEntity :: is_broken=

The indication that the entity did not pass some semantic verifications.
fun is_example: Bool

nitc :: MEntity :: is_example

Is self existing for an example purpose?
fun is_fictive: Bool

nitc :: MEntity :: is_fictive

Is self created for internal purpose?
fun is_fictive=(is_fictive: Bool)

nitc :: MEntity :: is_fictive=

Is self created for internal purpose?
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_test: Bool

nitc :: MEntity :: is_test

Is self created for unit testing purpose?
fun is_test=(is_test: Bool)

nitc :: MEntity :: is_test=

Is self created for unit testing purpose?
private fun jname: String

nitc :: MEntity :: jname

A Java compatible name for self
abstract fun json_namespace: JsonNamespace

nitc :: MEntity :: json_namespace

Return self.full_name as an object that can be serialized to json.
private fun kind_sorter=(kind_sorter: MEntityComparator)

nitc :: Model :: kind_sorter=

private fun lfname_sorter=(lfname_sorter: FullNameLengthComparator)

nitc :: Model :: lfname_sorter=

fun linkto(v: HtmlightVisitor): HTMLTag

nitc :: MEntity :: linkto

A HTML version of to_s with hyper-links.
fun linkto_text(v: HtmlightVisitor, text: String): HTMLTag

nitc :: MEntity :: linkto_text

Link to the self with a specific text.
private fun lname_sorter=(lname_sorter: NameLengthComparator)

nitc :: Model :: lname_sorter=

fun location: Location

nitc :: MEntity :: location

The origin of the definition.
private fun make_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: make_node

Make a new NeoNode based on mentity.
fun mclassdef_hierarchy: POSet[MClassDef]

nitc :: Model :: mclassdef_hierarchy

Hierarchy of class definition.
protected fun mclassdef_hierarchy=(mclassdef_hierarchy: POSet[MClassDef])

nitc :: Model :: mclassdef_hierarchy=

Hierarchy of class definition.
fun mclasses: Array[MClass]

nitc :: Model :: mclasses

All known classes
protected fun mclasses=(mclasses: Array[MClass])

nitc :: Model :: mclasses=

All known classes
private fun mclasses_by_name: MultiHashMap[String, MClass]

nitc :: Model :: mclasses_by_name

Collections of classes grouped by their short name
private fun mclasses_by_name=(mclasses_by_name: MultiHashMap[String, MClass])

nitc :: Model :: mclasses_by_name=

Collections of classes grouped by their short name
fun mdoc: nullable MDoc

nitc :: MEntity :: mdoc

The documentation associated to the entity
fun mdoc=(mdoc: nullable MDoc)

nitc :: MEntity :: mdoc=

The documentation associated to the entity
fun mdoc_or_fallback: nullable MDoc

nitc :: MEntity :: mdoc_or_fallback

The documentation associated to the entity or their main nested entity.
fun mentities_by_full_name: HashMap[String, MEntity]

nitc :: Model :: mentities_by_full_name

Keep a direct link to mentities by full name to speed up mentity_from_uri
protected fun mentities_by_full_name=(mentities_by_full_name: HashMap[String, MEntity])

nitc :: Model :: mentities_by_full_name=

Keep a direct link to mentities by full name to speed up mentity_from_uri
fun mentities_by_name(name: String, filter: nullable ModelFilter): Array[MEntity]

nitc :: Model :: mentities_by_name

Searches the MEntities that matches full_name.
fun mentity_by_full_name(full_name: String, filter: nullable ModelFilter): nullable MEntity

nitc :: Model :: mentity_by_full_name

Searches the MEntity that matches full_name.
private fun mentity_kind_rank: Int

nitc :: MEntity :: mentity_kind_rank

Compare MEntity class kind
fun mexample: nullable MExample

nitc :: MEntity :: mexample

Return this entity as a MExample
protected fun mexample=(mexample: nullable MExample)

nitc :: MEntity :: mexample=

Return this entity as a MExample
fun mmodule_importation_hierarchy: POSet[MModule]

nitc :: Model :: mmodule_importation_hierarchy

Full module importation hierarchy including private or nested links.
protected fun mmodule_importation_hierarchy=(mmodule_importation_hierarchy: POSet[MModule])

nitc :: Model :: mmodule_importation_hierarchy=

Full module importation hierarchy including private or nested links.
fun mmodules: Array[MModule]

nitc :: Model :: mmodules

All known modules
protected fun mmodules=(mmodules: Array[MModule])

nitc :: Model :: mmodules=

All known modules
private fun mmodules_by_name: MultiHashMap[String, MModule]

nitc :: Model :: mmodules_by_name

Collections of modules grouped by their short names
private fun mmodules_by_name=(mmodules_by_name: MultiHashMap[String, MModule])

nitc :: Model :: mmodules_by_name=

Collections of modules grouped by their short names
abstract fun model: Model

nitc :: MEntity :: model

A Model Entity has a direct link to its model
private fun mpackage_by_name: MultiHashMap[String, MPackage]

nitc :: Model :: mpackage_by_name

Collections of package grouped by their names
private fun mpackage_by_name=(mpackage_by_name: MultiHashMap[String, MPackage])

nitc :: Model :: mpackage_by_name=

Collections of package grouped by their names
protected fun mpackage_importation_graph=(mpackage_importation_graph: HashDigraph[MPackage])

nitc :: Model :: mpackage_importation_graph=

Full package importation graph
fun mpackages: Array[MPackage]

nitc :: Model :: mpackages

packages of the model
protected fun mpackages=(mpackages: Array[MPackage])

nitc :: Model :: mpackages=

packages of the model
fun mproperties: Array[MProperty]

nitc :: Model :: mproperties

All known properties
protected fun mproperties=(mproperties: Array[MProperty])

nitc :: Model :: mproperties=

All known properties
private fun mproperties_by_name: MultiHashMap[String, MProperty]

nitc :: Model :: mproperties_by_name

Collections of properties grouped by their short name
private fun mproperties_by_name=(mproperties_by_name: MultiHashMap[String, MProperty])

nitc :: Model :: mproperties_by_name=

Collections of properties grouped by their short name
protected fun msgpack_extra_array_items: Int

serialization :: Serializable :: msgpack_extra_array_items

Hook to request a larger than usual metadata array
abstract fun name: String

nitc :: MEntity :: name

The short (unqualified) name of this model entity.
private fun name_sorter=(name_sorter: NameComparator)

nitc :: Model :: name_sorter=

private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
abstract fun nitdoc_breadcrumbs: Array[MEntity]

nitc :: MEntity :: nitdoc_breadcrumbs

MEntities composing the breadcrumbs of a nitdoc page
fun nitdoc_inline_processor: MarkdownProcessor

nitc :: Model :: nitdoc_inline_processor

Get a markdown inline processor for Nitdoc comments.
fun nitdoc_inline_processor=(nitdoc_inline_processor: MarkdownProcessor)

nitc :: Model :: nitdoc_inline_processor=

Get a markdown inline processor for Nitdoc comments.
fun nitdoc_md_processor: MarkdownProcessor

nitc :: Model :: nitdoc_md_processor

Get a markdown processor for Nitdoc comments.
fun nitdoc_md_processor=(nitdoc_md_processor: MarkdownProcessor)

nitc :: Model :: nitdoc_md_processor=

Get a markdown processor for Nitdoc comments.
fun no_location: Location

nitc :: Model :: no_location

Place-holder object that means no-location
protected fun no_location=(no_location: Location)

nitc :: Model :: no_location=

Place-holder object that means no-location
fun null_type: MNullType

nitc :: Model :: null_type

The only null type
protected fun null_type=(null_type: MNullType)

nitc :: Model :: null_type=

The only null type
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun ratings(config: NitwebConfig, user: nullable String): JsonObject

nitc :: MEntity :: ratings

Get the ratings of a mentity
fun ratings_by_dimension(config: NitwebConfig, dimension: String, user: nullable String): JsonObject

nitc :: MEntity :: ratings_by_dimension

Get the ratings of a dimension
private fun score_sorter=(score_sorter: ScoreComparator)

nitc :: Model :: score_sorter=

fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
fun serialize_msgpack(plain: nullable Bool): Bytes

serialization :: Serializable :: serialize_msgpack

Serialize self to MessagePack bytes
fun serialize_to(serializer: Serializer)

serialization :: Serializable :: serialize_to

Serialize self to serializer
fun serialize_to_json(plain: nullable Bool, pretty: nullable Bool): String

serialization :: Serializable :: serialize_to_json

Serialize self to JSON
private fun serialize_to_or_delay(v: Serializer)

serialization :: Serializable :: serialize_to_or_delay

Accept references or force direct serialization (using serialize_to)
private fun source_url(url_pattern: nullable String): String

nitc :: MEntity :: source_url

Render a HTML link for the MEntity location
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_dot_node: DotNode

nitc :: MEntity :: to_dot_node

Return self as a DotNode
fun to_json: String

serialization :: Serializable :: to_json

Serialize self to plain JSON
fun to_json_ref: MEntityRef

nitc :: MEntity :: to_json_ref

Return a new MEntityRef to self.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_mpackage_tree: MPackageTree

nitc :: Model :: to_mpackage_tree

Generate a MPackageTree based on the packages, groups and modules known in the model
private fun to_node(nodes: HashMap[MEntity, NeoNode], model_name: nullable String): NeoNode

nitc :: MEntity :: to_node

Build a NeoNode representing self.
fun to_pretty_json: String

serialization :: Serializable :: to_pretty_json

Serialize self to plain pretty JSON
fun to_s: String

core :: Object :: to_s

User readable representation of self.
abstract fun tpl_class(model: UMLModel): Writable

nitc :: MEntity :: tpl_class

Generates a dot-compatible Writable UML Class diagram from self
abstract fun tpl_module(model: UMLModel): Writable

nitc :: MEntity :: tpl_module

Builds a dot UML package diagram entity from self
private fun vis_sorter=(vis_sorter: VisibilityComparator)

nitc :: Model :: vis_sorter=

fun visibility: MVisibility

nitc :: MEntity :: visibility

The visibility of the MEntity.
fun visit_all(v: ModelVisitor)

nitc :: MEntity :: visit_all

Call v.enter_visit on all nested entities.
fun web_url: String

nitc :: MEntity :: web_url

URL to self within the web interface.
private fun write_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_doc

private fun write_extra_doc(model: Model, mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_extra_doc

Extra auto documentation to append to the stream
private fun write_location(mainmodule: MModule, stream: Writer)

nitc :: MEntity :: write_location

Location (file and line when available) of related declarations
package_diagram nitc::Model Model nitc::MEntity MEntity nitc::Model->nitc::MEntity nitc::HInfoBoxable HInfoBoxable nitc::MEntity->nitc::HInfoBoxable serialization::Serializable Serializable nitc::MEntity->serialization::Serializable ...nitc::HInfoBoxable ... ...nitc::HInfoBoxable->nitc::HInfoBoxable ...serialization::Serializable ... ...serialization::Serializable->serialization::Serializable nitc::ModelStandalone ModelStandalone nitc::ModelStandalone->nitc::Model nitc::ModelDiamond ModelDiamond nitc::ModelDiamond->nitc::ModelStandalone nitc::ModelDiamond... ... nitc::ModelDiamond...->nitc::ModelDiamond

Ancestors

interface HInfoBoxable

nitc :: HInfoBoxable

Model entity or whatever that can produce an infobox
interface Object

core :: Object

The root of the class hierarchy.
interface Serializable

serialization :: Serializable

Instances of this class can be passed to Serializer::serialize

Parents

abstract class MEntity

nitc :: MEntity

A named and possibly documented entity in the model.

Children

class ModelStandalone

nitc :: ModelStandalone

A standalone pre-constructed model used to test various model-related methods.

Descendants

class ModelDiamond

nitc :: ModelDiamond

A standalone model with the common class diamond-hierarchy ABCD

Class definitions

nitc $ Model
# The container class of a Nit object-oriented model.
# A model knows modules, classes and properties and can retrieve them.
class Model
	super MEntity

	redef fun model do return self

	# Place-holder object that means no-location
	#
	# See `MEntity::location`
	var no_location = new Location(null, 0, 0, 0, 0)
end
src/model/model_base.nit:21,1--32,3

nitc :: mpackage $ Model
redef class Model

	# Full package importation graph
	# Each package is in relation with itself
	var mpackage_importation_graph = new HashDigraph[MPackage]

	# packages of the model
	var mpackages = new Array[MPackage]

	# Collections of package grouped by their names
	private var mpackage_by_name = new MultiHashMap[String, MPackage]

	# Return all package named `name`
	# If such a package is not yet loaded, null is returned (instead of an empty array)
	fun get_mpackages_by_name(name: String): nullable Array[MPackage]
	do
		if mpackage_by_name.has_key(name) then
			return mpackage_by_name[name]
		else
			return null
		end
	end
end
src/model/mpackage.nit:182,1--204,3

nitc :: mmodule $ Model
# The container class of a Nit object-oriented model.
#
# A model knows modules, classes and properties and can retrieve them.
#
# However, a model is not a program or a library as it can contains modules
# found by the system (including broken ones) but not used.
redef class Model
	# All known modules
	var mmodules = new Array[MModule]

	# Full module importation hierarchy including private or nested links.
	var mmodule_importation_hierarchy = new POSet[MModule]

	# Collections of modules grouped by their short names
	private var mmodules_by_name = new MultiHashMap[String, MModule]

	# Return all module named `name`
	# If such a module does not exist, null is returned (instead of an empty array)
	#
	# Visibility or modules are not considered
	fun get_mmodules_by_name(name: String): nullable Array[MModule]
	do
		if mmodules_by_name.has_key(name) then
			return mmodules_by_name[name]
		else
			return null
		end
	end
end
src/model/mmodule.nit:23,1--51,3

nitc :: model $ Model
redef class Model
	# All known classes
	var mclasses = new Array[MClass]

	# All known properties
	var mproperties = new Array[MProperty]

	# Hierarchy of class definition.
	#
	# Each classdef is associated with its super-classdefs in regard to
	# its module of definition.
	#
	# ~~~
	# var m = new ModelDiamond
	# assert     m.mclassdef_hierarchy.has_edge(m.mclassdef_b, m.mclassdef_a)
	# assert not m.mclassdef_hierarchy.has_edge(m.mclassdef_a, m.mclassdef_b)
	# assert not m.mclassdef_hierarchy.has_edge(m.mclassdef_b, m.mclassdef_c)
	# ~~~
	var mclassdef_hierarchy = new POSet[MClassDef]

	# Class-type hierarchy restricted to the introduction.
	#
	# The idea is that what is true on introduction is always true whatever
	# the module considered.
	# Therefore, this hierarchy is used for a fast positive subtype check.
	#
	# This poset will evolve in a monotonous way:
	# * Two non connected nodes will remain unconnected
	# * New nodes can appear with new edges
	private var intro_mtype_specialization_hierarchy = new POSet[MClassType]

	# Global overlapped class-type hierarchy.
	# The hierarchy when all modules are combined.
	# Therefore, this hierarchy is used for a fast negative subtype check.
	#
	# This poset will evolve in an anarchic way. Loops can even be created.
	#
	# FIXME decide what to do on loops
	private var full_mtype_specialization_hierarchy = new POSet[MClassType]

	# Collections of classes grouped by their short name
	private var mclasses_by_name = new MultiHashMap[String, MClass]

	# Return all classes named `name`.
	#
	# If such a class does not exist, null is returned
	# (instead of an empty array)
	#
	# Visibility or modules are not considered
	#
	# ~~~
	# var m = new ModelStandalone
	# assert m.get_mclasses_by_name("Object") == [m.mclass_o]
	# assert m.get_mclasses_by_name("Fail") == null
	# ~~~
	fun get_mclasses_by_name(name: String): nullable Array[MClass]
	do
		return mclasses_by_name.get_or_null(name)
	end

	# Collections of properties grouped by their short name
	private var mproperties_by_name = new MultiHashMap[String, MProperty]

	# Return all properties named `name`.
	#
	# If such a property does not exist, null is returned
	# (instead of an empty array)
	#
	# Visibility or modules are not considered
	fun get_mproperties_by_name(name: String): nullable Array[MProperty]
	do
		return mproperties_by_name.get_or_null(name)
	end

	# The only null type
	var null_type = new MNullType(self)

	# The only bottom type
	var bottom_type: MBottomType = null_type.as_notnull

	# Build an ordered tree with from `concerns`
	fun concerns_tree(mconcerns: Collection[MConcern]): ConcernsTree do
		var seen = new HashSet[MConcern]
		var res = new ConcernsTree

		var todo = new Array[MConcern]
		todo.add_all mconcerns

		while not todo.is_empty do
			var c = todo.pop
			if seen.has(c) then continue
			var pc = c.parent_concern
			if pc == null then
				res.add(null, c)
			else
				res.add(pc, c)
				todo.add(pc)
			end
			seen.add(c)
		end

		return res
	end
end
src/model/model.nit:42,1--145,3

nitc :: model_viz $ Model
redef class Model
	# Generate a MPackageTree based on the packages, groups and modules known in the model
	fun to_mpackage_tree: MPackageTree
	do
		var res = new MPackageTree(self)
		for p in mpackages do
			for g in p.mgroups do
				res.add(g.parent, g)
				for m in g.mmodules do
					res.add(g, m)
				end
			end
		end
		return res
	end
end
src/model/model_viz.nit:115,1--130,3

nitc :: model_collect $ Model
redef class Model

	# Collect all MPackages in `self`
	fun collect_mpackages(filter: nullable ModelFilter): HashSet[MPackage] do
		var res = new HashSet[MPackage]
		for mpackage in mpackages do
			if filter == null or filter.accept_mentity(mpackage) then res.add(mpackage)
		end
		return res
	end

	# Collect all MGroups in `self`
	fun collect_mgroups(filter: nullable ModelFilter): HashSet[MGroup] do
		var res = new HashSet[MGroup]
		for mpackage in collect_mpackages(filter) do
			res.add_all mpackage.collect_all_mgroups(filter)
		end
		return res
	end

	# Collect all MModules in `self`
	fun collect_mmodules(filter: nullable ModelFilter): HashSet[MModule] do
		var res = new HashSet[MModule]
		for mpackage in collect_mpackages(filter) do
			res.add_all mpackage.collect_all_mmodules(filter)
		end
		return res
	end

	# Collect all MClasses in `self`
	fun collect_mclasses(filter: nullable ModelFilter): HashSet[MClass] do
		var res = new HashSet[MClass]
		for mclass in mclasses do
			if filter == null or filter.accept_mentity(mclass) then res.add mclass
		end
		return res
	end

	# Collect all MClasses introduced in `self`
	fun collect_intro_mclasses(filter: nullable ModelFilter): HashSet[MClass] do
		var res = new HashSet[MClass]
		for mpackage in collect_mpackages(filter) do
			res.add_all mpackage.collect_intro_mclasses(filter)
		end
		return res
	end

	# Collect all MClassDefs in `self`
	fun collect_mclassdefs(filter: nullable ModelFilter): HashSet[MClassDef] do
		var res = new HashSet[MClassDef]
		for mclass in collect_mclasses(filter) do
			res.add_all mclass.collect_mclassdefs(filter)
		end
		return res
	end

	# Collect all MProperties introduced in `self`
	fun collect_intro_mproperties(filter: nullable ModelFilter): HashSet[MProperty] do
		var res = new HashSet[MProperty]
		for mpackage in collect_mpackages(filter) do
			res.add_all mpackage.collect_intro_mproperties(filter)
		end
		return res
	end

	# Collect all MProperties in `self`
	fun collect_mproperties(filter: nullable ModelFilter): HashSet[MProperty] do
		var res = new HashSet[MProperty]
		for mproperty in mproperties do
			if filter == null or filter.accept_mentity(mproperty) then res.add mproperty
		end
		return res
	end

	# Collect all MPropDefs in `self`
	fun collect_mpropdefs(filter: nullable ModelFilter): HashSet[MPropDef] do
		var res = new HashSet[MPropDef]
		for mproperty in collect_mproperties(filter) do
			for mpropdef in mproperty.mpropdefs do
				if filter == null or filter.accept_mentity(mpropdef) then res.add mpropdef
			end
		end
		return res
	end

	# Collect all MEntities in `self`
	fun collect_mentities(filter: nullable ModelFilter): HashSet[MEntity] do
		var res = new HashSet[MEntity]
		res.add_all collect_mpackages(filter)
		res.add_all collect_mgroups(filter)
		res.add_all collect_mmodules(filter)
		res.add_all collect_mclasses(filter)
		res.add_all collect_mclassdefs(filter)
		res.add_all collect_mproperties(filter)
		res.add_all collect_mpropdefs(filter)
		return res
	end

	# Searches the MEntity that matches `full_name`.
	fun mentity_by_full_name(full_name: String, filter: nullable ModelFilter): nullable MEntity do
		for mentity in collect_mentities(filter) do
			if filter != null and not filter.accept_mentity(mentity) then continue
			if mentity.full_name == full_name then return mentity
		end
		return null
	end

	# Searches the MEntities that matches `full_name`.
	fun mentities_by_name(name: String, filter: nullable ModelFilter): Array[MEntity] do
		var res = new Array[MEntity]
		for mentity in collect_mentities(filter) do
			if filter != null and not filter.accept_mentity(mentity) then continue
			if mentity.name == name then res.add mentity
		end
		return res
	end
end
src/model/model_collect.nit:148,1--264,3

nitc :: model_visitor $ Model
redef class Model
	# Visit all the packages of the model.
	redef fun visit_all(v) do
		for x in mpackages do v.enter_visit(x)
	end
end
src/model/model_visitor.nit:106,1--111,3

nitc :: model_index $ Model
redef class Model

	# Keep a direct link to mentities by full name to speed up `mentity_from_uri`
	var mentities_by_full_name: HashMap[String, MEntity] is lazy do
		var mentities_by_full_name = new HashMap[String, MEntity]
		for mentity in collect_mentities do
			mentities_by_full_name[mentity.full_name] = mentity
		end
		return mentities_by_full_name
	end

	# ModelIndex used to perform searches
	var index: ModelIndex is lazy, writable do
		var index = new ModelIndex
		for mentity in collect_mentities do
			if mentity isa MClassDef or mentity isa MPropDef then continue
			index.index mentity
		end
		return index
	end

	redef fun mentities_by_name(name, filter) do
		var res = new Array[MEntity]
		if not index.names.has_key(name) then return res
		for mentity in index.names[name] do
			if filter == null or filter.accept_mentity(mentity) then res.add mentity
		end
		return res
	end

	redef fun mentity_by_full_name(full_name, filter) do
		if mentities_by_full_name.has_key(full_name) then
			var mentity = mentities_by_full_name[full_name]
			if filter == null or filter.accept_mentity(mentity) then return mentity
		end
		return null
	end

	private var score_sorter = new ScoreComparator
	private var vis_sorter = new VisibilityComparator
	private var kind_sorter = new MEntityComparator
	private var name_sorter = new NameComparator
	private var lname_sorter = new NameLengthComparator
	private var fname_sorter = new FullNameComparator
	private var lfname_sorter = new FullNameLengthComparator

	# Search mentities based on a `query` string
	#
	# Lookup the index for anything matching `query` and return `limit` results.
	#
	# The algorithm used is the following:
	# 1- lookup by name prefix
	# 2- lookup by full_name prefix
	# 3- loopup by levenshtein distance
	#
	# At each step if the `limit` is reached, the algorithm stops and returns the results.
	fun find(query: String, limit: nullable Int, filter: nullable ModelFilter): Array[MEntity] do
		# Find, lookup by name prefix
		var matches = index.find_by_name_prefix(query, filter).uniq.
			sort(lname_sorter, name_sorter, kind_sorter)
		if limit != null and matches.length >= limit then
			return matches.limit(limit).rerank.sort(vis_sorter, score_sorter).mentities
		end
		matches = matches.rerank.sort(vis_sorter, score_sorter)

		# If limit not reached, lookup by full_name prefix
		var malus = matches.length
		var full_matches = new IndexMatches
		for match in index.find_by_full_name_prefix(query, filter).
			sort(kind_sorter, lfname_sorter, fname_sorter) do
			match.score += malus
			full_matches.add match
		end
		matches = matches.uniq
		if limit != null and matches.length + full_matches.length >= limit then
			matches.add_all full_matches
			matches = matches.uniq.limit(limit).rerank.sort(vis_sorter, score_sorter)
			return matches.mentities
		end

		# If limit not reached, lookup by similarity
		malus = matches.length
		var sim_matches = new IndexMatches
		for match in index.find_by_similarity(query, filter).sort(score_sorter, kind_sorter, lname_sorter, name_sorter) do
			match.score += malus
			sim_matches.add match
		end
		matches.add_all sim_matches
		matches = matches.uniq
		if limit != null then matches = matches.limit(limit)
		return matches.rerank.sort(vis_sorter, score_sorter).mentities
	end
end
src/model/model_index.nit:133,1--225,3

nitc :: codesmells_metrics $ Model
redef class Model
	fun get_avg_parameter: Float do
		var counter = new Counter[MMethodDef]
		var filter = new ModelFilter
		for mclassdef in collect_mclassdefs(filter) do
			for method in mclassdef.collect_intro_and_redef_mpropdefs(filter) do
			# check if the property is a method definition
				if not method isa MMethodDef then continue
				#Check if method has a signature
				if method.msignature == null then continue
				if method.msignature.mparameters.length == 0 then continue
				counter[method] = method.msignature.mparameters.length
			end
		end
		return counter.avg + counter.std_dev
	end

	fun get_avg_attribut: Float do
		var counter = new Counter[MClassDef]
		var filter = new ModelFilter
		for mclassdef in collect_mclassdefs(filter) do
			var number_attributs = mclassdef.collect_intro_and_redef_mattributes(filter).length
			if number_attributs != 0 then counter[mclassdef] = number_attributs
		end
		return counter.avg + counter.std_dev
	end

	fun get_avg_method: Float do
		var counter = new Counter[MClassDef]
		var filter = new ModelFilter
		for mclassdef in collect_mclassdefs(filter) do
			var number_methodes = mclassdef.collect_intro_and_redef_methods(filter).length
			if number_methodes != 0 then counter[mclassdef] = number_methodes
		end
		return counter.avg + counter.std_dev
	end

	fun get_avg_linenumber(model_builder: ModelBuilder): Float do
		var methods_analyse_metrics = new Counter[MClassDef]
		var filter = new ModelFilter
		for mclassdef in collect_mclassdefs(filter) do
			var result = 0
			var count = 0
			for mmethoddef in call_analyze_methods(mclassdef,model_builder, filter) do
				result += mmethoddef.line_number
				if mmethoddef.line_number == 0 then continue
				count += 1
			end
			if not mclassdef.collect_local_mproperties(filter).length != 0 then continue
			if count == 0 then continue
			methods_analyse_metrics[mclassdef] = (result/count).to_i
		end
		return methods_analyse_metrics.avg + methods_analyse_metrics.std_dev
	end
end
src/metrics/codesmells_metrics.nit:376,1--430,3

nitc :: html_model $ Model
redef class Model
	# Get a markdown processor for Nitdoc comments.
	var nitdoc_md_processor: MarkdownProcessor is lazy, writable do
		var proc = new MarkdownProcessor
		proc.decorator = new NitdocDecorator
		return proc
	end

	# Get a markdown inline processor for Nitdoc comments.
	#
	# This processor is specificaly designed to inlinable doc elements like synopsis.
	var nitdoc_inline_processor: MarkdownProcessor is lazy, writable do
		var proc = new MarkdownProcessor
		proc.decorator = new InlineDecorator
		return proc
	end
end
src/doc/templates/html_model.nit:554,1--570,3