Artefact Types
Artefact types are created dynamically into Squore if declared by the Data Providers when artefacts are created. However, in order to be able to rate your projects, artefact types need to be associated with an existing indicator.
Defining a root indicator
To do so, we define a RootIndicator
element as follows:
<RootIndicator artefactTypes="APPLICATION;FILE;CLASS;FUNCTION;REQUIREMENT;TEST_PLAN;TEST_SUITE;TEST" indicatorId="ANALYTICS" />
In this example, the artefact types APPLICATION, FILE, CLASS, FUNCTION, REQUIREMENT, TEST_PLAN, TEST_SUITE and TEST are associated with the main indicator, ANALYTICS.
The RootIndicator
element accepts the following attributes:
-
indicatorId
the unique identifier of the indicator chosen as root. -
artefactTypes
is the artefact types for which this indicator is the root indicator. Note that the indicator must exist for all the types of artefacts specified.
The root indicator is the top-level mark displayed next to an artefact in the artefact tree. |
A root indicator must be based on a derived measure, not a base measure. If the measure you want to use as an indicator is a base, add a dummy derived measure as shown below. Before:
After:
|
Defining aliases
You can also define aliases to group types of artefacts together, which can be useful when defining metrics in your analysis model.
To do so, we use an ArtefactType
element, as follows:
<ArtefactType id="CODE" heirs="PACKAGES;FILES;CLASSES;MODULES;CODE_SPECIFICATIONS" />
<ArtefactType id="APPLICATIONS" heirs="APPLICATION;SUB_APPLICATION" />
<ArtefactType id="PACKAGES" heirs="APPLICATIONS;SOURCE_CODE;FOLDER" />
<ArtefactType id="FOLDER" compactable="true" />
<ArtefactType id="GENERIC_FILES" heirs="FILES;GENERIC_FILE" />
<ArtefactType id="FILES" heirs="FILE;HEADER" />
<ArtefactType id="SUB_FILES" heirs="CLASSES;MODULES;CODE_SPECIFICATIONS" />
<ArtefactType id="CLASSES" heirs="CLASS;FORTRAN_MODULE;SQL_CLASS;TYPESCRIPT_MODULE" />
<ArtefactType id="MODULES" heirs="FUNCTION" />
<ArtefactType id="CODE_SPECIFICATIONS" heirs="OBJECTIVEC_PROTOCOL;JAVA_INTERFACE;ADA_SPACK;ADA_STASK;ADA_SPROTOBJ;ADA_PROTOBJ;ABAP_CLASSDEF;VBNET_INTERFACE;TYPESCRIPT_INTERFACE;SWIFT_INTERFACE;GROOVY_INTERFACE" /> <!-- TODO: Set ADA_PROTOBJ as CLASS ? -->
The ArtefactType
element accepts the following attributes:
-
id
the alias, i.e. the ID of the artefact type containing the others specified inheirs
. -
heirs
the artefact types contained in the artefact type specified inid
. -
manual
to be able to manually create this type of artefact from Squore’s web interface. -
compactable
to allow grouping artefacts of this type in the Artefact Tree, when they are adjacent. -
parents
the parent artefact types for the alias.
The artefact types used in the default configuration for source code are all defined in <SQUORE_HOME>/configuration/models/Shared/data_provider/squan_sources/artefact_types.xml, so you can include them easily in your model. |
You can use aliases everywhere in your configuration, except in properties files. |
The root node of a project is always of type APPLICATION. The SUB_APPLICATION type is used as the type for the root node of a project that is a component of a meta-project only. |