Newer Version Available

This content describes an older version of this product. View Latest

ApexCodeCoverageAggregate

Represents aggregate code coverage test results for an Apex class or trigger. Available in Tooling API version 29.0 and later.

Supported SOAP API Calls

describeSObjects()query()retrieve()

Supported REST API HTTP Methods

Query, GET, DELETE

Special Access Rules

In API version 49.0 and later, users must have the View Setup and Configuration permission to access this object.

Fields

Field Details
ApexClassorTriggerId
Type
string
Properties
Filter, Group, Sort
Description
The ID of the class or trigger under test.
NumLinesCovered
Type
int
Properties
Filter, Group, Sort
Description
The number of covered lines.
NumLinesUncovered
Type
int
Properties
Filter, Group, Sort
Description
The number of uncovered lines.
Coverage
Type
complexvalue
Properties
None
Description
Two lists of integers. The first is the covered lines, and the second is the list of uncovered lines. If a line is missing from both lists, the line isn’t executable and doesn’t require coverage.
Coverage includes the following fields:
  • coveredLines
  • namespace
  • uncoveredLines

Usage

To query for aggregate code coverage, specify an Apex test class. The returned JSON or XML object will contain two lists of integers: one for covered and one for uncovered lines. For examples, see ApexCodeCoverage.