Configure a Universal Analyzer language for the dashboards

Declare the technology, module, object and subset categories that the CAST dashboards need to measure a Universal Analyzer language
Updated

Overview

For the CAST dashboards to measure your language, its objects must be mapped to the categories that the measurement process uses. These changes are made in the xxxMetaModel.xml file of the language package. This page uses the PHP language as an example.

Step 1 - Declare the technology and module category

Declare a category that names the technology and associates modules with it. The description of the category must be identical to the name of the language:

<category name="APM PHP Module" rid="16">
    <description>PHP</description>
    <inheritedCategory name="APM Client Modules"/>
</category>

Then make the project type of the language inherit from this category:

<type name="phpProject" rid="6">
    <description>PHP Project</description>
    <inheritedCategory name="UAProject"/>
    <inheritedCategory name="PHP"/>
    <inheritedCategory name="APM PHP Module"/>
</type>

Step 2 - Map the objects to measurement categories

Make the object types of the language inherit from the measurement categories that describe them. There are two kinds of category:

  • Process categories identify the objects used in the measurement calculations.
  • Inventory categories identify the objects counted in the inventory metrics, such as the number of classes or programs.

To keep the metamodel readable, you can declare a category for the language that groups its artifacts:

<category name="APM PHP Artifacts" rid="7">
    <description>PHP Artifacts</description>
    <inheritedCategory name="APM Client Language Artifacts"/>
</category>
Process category Use for
APM Client Language Artifacts Basic programming elements that contain source code
APM Sources The highest-level objects that contain source code, used to count lines
APM Forms Forms
APM Events Form events
APM Controls Form controls
APM Interfaces Interfaces, in object-oriented languages
APM Classes Classes, in object-oriented languages
APM Methods Methods of a class or interface, in object-oriented languages
APM Data Members Members of a class, in object-oriented languages
Inventory category Use for
APM Inventory Files Files
APM Inventory Methods Methods
APM Inventory Functions Functions
APM Inventory Functions and Procedures SQL functions and procedures
APM Inventory Triggers Triggers
APM Inventory Events Events
APM Inventory Macros Macros
APM Inventory Programs Programs

Step 3 - Declare a subset type

A subset type is mandatory. It allows users to create user defined modules for the language. It inherits from PROJECT_SUBSET, from the language category and from the module category declared in Step 1. Give it a unique rid:

<type name="PHP_SUBSET" rid="9">
    <description>PHP Subset</description>
    <inheritedCategory name="PROJECT_SUBSET"/>
    <inheritedCategory name="PHP"/>
    <inheritedCategory name="APM PHP Module"/>
</type>

Step 4 - Set the assessment model parameters

Some quality distributions and sizing measures use thresholds that are set per technology. Add values for your language to the following measures in the assessment model, so that your objects are graded correctly:

ID Measure Parameters
10201 Backfired OMG-compliant Automated Function Points Backfired FP ratio
65105 Distribution of artifacts by size (lines of code) Small, average, large and very large size thresholds
65350 Distribution of artifacts by coupling Low, average, high and very high coupling thresholds
65501 Distribution of artifacts by cyclomatic complexity Low, average, high and very high complexity thresholds
7122 Complexity volume (% of LoC) Complexity volume
66010 Distribution of artifacts by reuse Low, average, high and very high reuse thresholds
66015 Class complexity distribution (WMC) Low, moderate, high and very high complexity classes
66020 Class fan-out distribution Low, moderate, high and very high fan-out classes
66021 Class fan-in distribution Low, moderate, high and very high fan-in classes

For each measure, add the parameter value for your language and a technology filter for the language. The changes apply from the next snapshot.

Quality status thresholds

New diagnostic-based metrics use the following default thresholds to grade objects:

Compliant objects Grade Status
0% to 10% 1 Very high risk
10% to 70% From 1 to 2 Very high risk
70% to 90% From 2 to 3 High risk
90% to 99% From 3 to 4 Moderate risk
99% to 100% 4 Low risk