Clearing coverage highlighting in Eclipse

JavaEclipseCode CoverageCoberturaEmma

Java Problem Overview


After running coverage reports in Eclipse (using cobertura or an EMMA plugin), my source code files get highlighted in green, red and yellow depending on which lines of code were covered by tests.

How can I clear this highlighting after I'm done?

Java Solutions


Solution 1 - Java

Click the "Remove all Sessions" button in the toolbar of the "Coverage" view.

enter image description here

Solution 2 - Java

On 4.2 eclipse it seems to be impossible to remove the eCobertura highlights. Sadly eCobertura plugins seems to be not maintained anymore. However if you start writing into the class, its gone. So type a space, and then undo, and its gone.

Solution 3 - Java

For people who are not able to find the coverage view , follow these steps :

Go to Windows Menu bar > Show View > Other > Type coverage and open it.

enter image description here

Click on Coverage.

To clear highlightings, click on X or XX icon as per convenience.

enter image description here

Solution 4 - Java

I found a workaround over on GitHub: https://github.com/jmhofer/eCobertura/issues/8

For those who don't want to click the link, here's the text of the comment:

> Good workaround: > Create a run configuration with a filter, that excludes everything ("*") and let it run just a single test. Name it "Undo coverage".

I did this and it worked quite well in Eclipse Juno.

Credit for this goes to UsulSK.

Solution 5 - Java

If you remove the coverage session, also the coverage coloring will disappear. For this, hit Remove Session or Remove All Sessions in the Coverage view's toolbar.

http://eclemma.org/faq.html

Solution 6 - Java

For those using Cobertura and only have the Coverage Session View like I do,just try closing Eclipse and starting it up again. This got rid of the highlighting for me.

Solution 7 - Java

Added shortcut Ctrl+Shift+X C to Keybindings (Window -> Preferences -> filter for Keys) when 'Editing Java Source' for 'Remove Active Session'.

Solution 8 - Java

If you would like to remove active session/project/folder then you can follow

Click the "Remove Active Session" button in the toolbar of the "Coverage" view.

Solution 9 - Java

I have used the Open Clover Tool for the code coverage, I have also been searching this for a long time. Its pretty straightforward, in the Coverage Explorer tab, you can find three square buttons which says the code lines you wanted to display, click on hide the coverage square box and its gone. Last button in the image below: enter image description here

Solution 10 - Java

Close the IDE and open it again. This works if you did not use any code coverage tools and have just clicked the basic "Coverage" icon in the IDE.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCharbelView Question on Stackoverflow
Solution 1 - JavaKaiView Answer on Stackoverflow
Solution 2 - JavaGábor LiptákView Answer on Stackoverflow
Solution 3 - JavaDivyanshu JimmyView Answer on Stackoverflow
Solution 4 - JavaDan HankinsView Answer on Stackoverflow
Solution 5 - JavaSandeep SinghView Answer on Stackoverflow
Solution 6 - JavaRyan2189View Answer on Stackoverflow
Solution 7 - JavaasdfView Answer on Stackoverflow
Solution 8 - JavaSachin NikamView Answer on Stackoverflow
Solution 9 - JavaYash BansalView Answer on Stackoverflow
Solution 10 - JavaSatyaView Answer on Stackoverflow