Including Child Artefacts Data

You can include charts and tables from child artefacts 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 artefacts internally in the report

  • artefactTypes or linkType (mandatory) identify the type of target artefacts to include in the report. For more information about links, refer to Artefact Links.

  • onlyDirectChildren (optional, default: false) includes artefacts that are direct children of the current artefact when set to true. Or all descendants of the current artefact when set to false. (Only available if linkType is not defined).

  • orderByMeasure (optional, alphabetical if omitted) allows sorting the list of artefacts according to the value of the specified measure ID.

  • inverted (optional, default: false) allows reversing the sort order defined by the orderByMeasure attribute.

  • artefactsLimit (optional, default: none) allows limiting the number of child artefacts to include.

The list of sub-artefacts can be further refined with a Where element that specifies a value or bounds for a metric, as illustrated in the two examples below.

Including functions with failing tests
<SubArtefacts id="WITH_FAILED_TESTS" artefactTypes="FUNCTION">
	<where>
		<measure id="TEST_FAILURES" bounds="[1;[" />
	</where>
</SubArtefacts>
Including functions no test coverage
<SubArtefacts id="FULLY_COVERED" artefactTypes="FUNCTION">
	<where>
		<measure id="TEST_COVERAGE" value="0" />
	</where>
</SubArtefacts>

The where element accepts the following sub-elements:

  • measure to 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

  • indicator to 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

  • info to 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