Indicators

Indicators associate a measure with a scale.

<Indicator indicatorId="ROKR_REQ" measureId="ROKR_REQ" scaleId="SCALE_DECILE" displayTypes="VALUE;LEVEL" />

The attributes allowed in the Indicator tag are the following:

  • indicatorId (mandatory) the unique identifier of the indicator being defined.

  • measureId (optional) the unique identifier of the measure to map.

  • scaleId (optional) the unique identifier of the scale to be used for the measure.

  • targetArtefactTypes (optional) is the type of artefact targeted by this indicator. For more information about artefact types, consult Artefact Types. If you do not define a target artefact type for an indicator, then the types specified for the measure or the scale associated with the indicator are used.

  • displayTypes (optional, default: empty) specifies which details relative to the indicator should be displayed in the Indicator tree on the left of the dashboard. The accepted values are

    • LEVEL to display the level name of the indicator after its name

    • VALUE to display the actual value of the metric associated to the indicator after its name

  • families (optional) the families associated with the indicator.

  • displayedScale (optional) allows displaying an alternate scale in the indicator details popup in the Explorer instead of the real scale associated with the indicator. This is generally useful when you are using a complicated scale internally, but want to show something simpler to your users instead (when using dynamic scales for example). This attribute accepts any valid scale ID from your model.

  • displayedValue (optional) allows displaying an alternate measure in the indicator details popup in the Explorer instead of the real measure associated with the indicator. This is generally useful when you are using a measure internally that would not make sense to end users, but want to show something simpler instead (when using dynamic scales for example). This attribute accepts any valid measure ID from your model.

In order to quickly define an indicator using the same value for indicatorId, measureId and scaleId you can use this quick notation syntax:

<Indicator indicatorId="TEST_COVERAGE" />

Squore will automatically assume that measureId and scaleId for this indicator are also TEST_COVERAGE.

Advanced Examples

  1. Defining a single indicator that uses different measures depending on the type of artefact:

    <Indicator indicatorId="WEIGHTED_NCC" measureId="WEIGHTED_NCC" targetArtefactTypes="CLASSES;MODULES;CODE_SPECIFICATIONS" />
    <Indicator indicatorId="WEIGHTED_NCC" measureId="WEIGHTED_NCC_DENSITY" targetArtefactTypes="PACKAGES;FILES" />
  2. Defining a single indicator that uses different scales depending on the artefact type:

    <Indicator indicatorId="COMPLEXITY" targetArtefactTypes="APPLICATION;SOURCE_CODE;FOLDER;FILES;CLASSES;MODULES;CODE_SPECIFICATIONS"/>
    
    <Measure measureId="COMPLEXITY" targetArtefactTypes="APPLICATION;SOURCE_CODE;FOLDER;FILES;CLASSES;MODULES;CODE_SPECIFICATIONS" defaultValue="-1">
    	<Computation targetArtefactTypes="CLASSES;MODULES;CODE_SPECIFICATIONS" result="..." />
    	<Computation targetArtefactTypes="APPLICATION;SOURCE_CODE;FOLDER;FILES" result="..." />
    </Measure>
    
    <Scale scaleId="COMPLEXITY" macro="TRAFFIC_LIGHT" vars="5;30" targetArtefactTypes="APPLICATION;SOURCE_CODE;FOLDER;FILES" />
    <Scale scaleId="COMPLEXITY" macro="TRAFFIC_LIGHT" vars="20;200" targetArtefactTypes="CLASSES;MODULES;CODE_SPECIFICATIONS" />