Artifact Types
Artifact types are created dynamically into Squore if declared by the Data Providers when artifacts are created. However, in order to be able to rate your projects, artifact types need to be associated with an existing indicator.
Defining a root indicator
This indicator is what we call a root indicator, which is the top-level mark displayed next to an artifact in the artifact tree. It is defined using a RootIndicator
element, as follows:
<RootIndicator artefactTypes="APPLICATION;FILE;CLASS;FUNCTION;REQUIREMENT;TEST_PLAN;TEST_SUITE;TEST" indicatorId="ANALYTICS" />
In this example, the artifact 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 artifact types for which this indicator is the root indicator. Note that the indicator must exist for all the types of artifacts specified.
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 artifacts 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 artifact type containing the others specified inheirs
. -
heirs
the artifact types contained in the artifact type specified inid
. -
manual
to be able to manually create this type of artifact from Squore’s web interface. -
compactable
to allow grouping artifacts of this type in the Artifact Tree, when they are adjacent. -
parents
the parent artifact types for the alias.
The artifact 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. |