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

The enableApexTestReqViewSetup field on the ApexSettings metadata type controls the activation of the critical update “Require View Setup permission to access Apex test data”. In API version 49.0 and later, when the field is set to true, 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 lines is missing from both lists, the line is not executable and does not 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.