Operands

An operand is any element defined in the model, called with its unique identifier (ID).

Measures may be prefixed with B when a Base and a Derived measure share the same ID, and you want to make sure that Squore uses the base measure in your syntax.

The following example shows a computation that adds and divides the TOPD (Operand Occurrences), TOPT (Operator Occurrences), DOPD (Distinct Operands), DOPT (Distinct Operators) measures.

<Computation targetArtefactTypes="FUNCTION" 
result="(TOPD+TOPT)/(DOPD+DOPT)" />

Rules have different attributes that can be called in expressions.

Below is an example of computation using rules attributes:

<Test 
expr="COUNT RULE.OCCURRENCES FROM DESCENDANTS 
WHERE FAMILY=CPRS" 
bounds="[10;[" 
descrId="PRESENTATION_CPRS" />

Indicators are prefixed with a I. The following example shows a computation which sums the values of the SDOC (Self-Descriptiveness), DFCX (Data Flow Complexity), and CFCX (Control Flow Complexity) indicators.

<Computation targetArtefactTypes="FUNCTION" 
result="I.SDOC+I.DFCX+I.CFCX" />

Examples of operands are: RULES.OCCURRENCES, FAMILY, MEASUREID, FUNCTION, PROGRAM.LEVEL, FUNCTION.I.HIS_LEVL, etc.