Including Child Artifacts Data
You can include charts and tables from child artifacts in reports by adding a SubData node in your report Bundle.
This allows you for example to generate a report at project level that includes information about every complex function in your project, as shown below:
<Bundle xmlns:xi="http://www.w3.org/2001/XInclude">
<Report id="SubDataSample" template="..." type="APPLICATION">
<Charts>
...
</Charts>
<SubData>
<SubArtefacts id="COMPLEX_MODULES" artefactTypes="MODULES" orderByMeasure="VG" inverted="true">
<where>
<measure id="CPXT" bounds="[0.5;["/>
</where>
<Charts>
<xi:include href="../../Shared/data_provider/squan_sources/dashboard/control_flow_graph.xml" />
<xi:include href="../Dashboards/issues_distribution_pie.xml" />
<xi:include href="../Dashboards/quality_kiviat.xml" />
</Charts>
<Tables>
<xi:include href="../Dashboards/table_complexity_module.xml" />
<xi:include href="../Dashboards/table_self_descriptiveness_module.xml" />
<xi:include href="../Dashboards/table_rule_compliance.xml" />
<xi:include href="../Dashboards/issue_by_severity_table.xml" />
<xi:include href="../../Shared/Analysis/product_quality/code/line_counting/line_counting_table.xml" />
</Tables>
</SubArtefacts>
</SubData>
</Report>
</Bundle>
The SubData element accepts one or more SubArtefacts elements with the following specification:
<SubData>
<SubArtefacts id="CONTROL_GRAPH"
artefactTypes="FUNCTION" | [linkType="<linkId>"]
[onlyDirectChildren="false"]
[orderByMeasure="LC"]
[inverted="false"]
[artefactsLimit=""]>
<where>
<measure id="" values|bounds="" [invert="false"] />
<indicator id="" levels="" [invert="false"] />
<info id="" values|patterns [invert="false"]>
</where>
<Charts>
<xi:include href="../Dashboards/charts/control_graph.xml" />
</Charts>
<Tables>
<xi:include href="../Dashboards/tables/table.xml" />
</Tables>
</SubArtefacts>
</SubData>
</Bundle>
-
id(mandatory) is an ID to identify the list of child artifacts internally in the report -
artefactTypesorlinkType(mandatory) identify the type of target artifacts to include in the report. For more information about links, refer to Artifact Links. -
onlyDirectChildren(optional, default: false) includes artifacts that are direct children of the current artifact when set to true. Or all descendants of the current artifact when set to false. (Only available iflinkTypeis not defined). -
orderByMeasure(optional, default: alphabetical ) allows sorting the artifacts according to the value of the specified measure. -
inverted(optional, default: false) allows reversing the sort order defined by theorderByMeasureattribute. -
artefactsLimit(optional, default: none ) allows limiting the number of child artifacts to include.
The list of sub-artifacts can be further refined with a Where element that specifies a value or bounds for a metric, as illustrated in the two examples below.
<SubArtefacts id="WITH_FAILED_TESTS" artefactTypes="FUNCTION">
<where>
<measure id="TEST_FAILURES" bounds="[1;[" />
</where>
</SubArtefacts>
<SubArtefacts id="FULLY_COVERED" artefactTypes="FUNCTION">
<where>
<measure id="TEST_COVERAGE" value="0" />
</where>
</SubArtefacts>
The where element accepts the following sub-elements:
-
measureto filter based on a measure. Following attributes are supported:-
id(mandatory) is the entity identifier in the analysis model. -
values|bounds(mandatory) is respectively, a semicolon-separated list of values or an interval, to test for the specified metric. -
invert(optional, default: false) allows checking for the invert of a condition when set to true.
-
-
indicatorto filter based on an indicator. Following attributes are supported:-
id(mandatory) is the entity identifier in the analysis model. -
levels(mandatory) is a semicolon-separated list of scale levels to test for the specified metric. -
invert(optional, default: false) allows checking for the invert of a condition when set to true
-
-
infoto filter based on an information. Following attributes are supported:-
id(mandatory) is the entity identifier in the analysis model. -
values|patterns(mandatory) is a semicolon-separated list of respectively, values or wildcard patterns, to test for the specified metric. -
invert(optional, default: false) allows checking for the invert of a condition when set to true.
-