I am working on a unit test of a class in developer console.

My target is to achieve a certain level of coverage.

I am on edge of reaching my coverage target, so I need to know the number of lines covered in that class.

Whenever I make changes in the test class and complete the run, I go to Overall Code Coverage section and scroll to the class name and check how many lines are covered.

Is there any other quicker way to get the number of lines coverage for the class?

  • If you use the Intellij IDE with the Illuminated Cloud plugin, you can view code coverage in each class and you can see the lines that are not covered. Note that while the Intellij community edition is free, Illuminated Cloud is a paid plugin. Aug 4, 2019 at 3:21

1 Answer 1


In the Developer Console, click on "Query Editor", then type in the query:

SELECT NumLinesCovered FROM ApexCodeCoverage WHERE ApexClassOrTrigger.Name = 'myClassName'

Then, check the "Tooling API" checkbox. Once you run the test, execute this query, and you'll get a result back. If you leave this tab open, you can simply click the "Rerun Query" button after a test run, and you'll get immediate results back without looking through the full list.

Note that "System.debug" lines are never covered or uncovered (they are simply ignored for this purpose).

  • This SELECT NumLinesCovered, NumLinesUncovered FROM ApexCodeCoverageAggregate WHERE ApexClassOrTrigger.Name = 'myClassName' worked for me. Thanks Aug 8, 2019 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .