I am trying to find dead code on our application by using a code coverage tool (rather a static code analysis tool). I have chosen JaCoCo and am able to get a report thanks to the JaCoCo agent.
I know that Intellij IDEA works with JaCoCo but I couldn't find anyway to import my JaCoCo report into Intellij IDEA. Any idea on how to do that?
Thanks
Step 4: To get you code coverage report navigate to the target > site > jacoco > index. html > right-click > Open In > Browser > And your preferred browser. So basically index. html is your code coverage report file.
For generating JaCoCo reports only run the maven build with profile jacoco-generate-report as it is shown in the example above. After the command was executed, in directory target/jacoco-report you can find reports in HTML and XML formats.
Coverage in the Coverage tool window If you want to reopen the Coverage tool window, select Run | Show Code Coverage Data from the main menu, or press Ctrl+Alt+F6 . The report shows the percentage of the code that has been executed or covered by tests. You can see the coverage result for classes, methods, and lines.
Found the solution. I have installed the coverage plugin and the EclEmma plugin (not sure if this one is really necessary...). Then "Analyse -> Show Coverage Data..." and pick your Jacoco output file. This file HAS to have the .exec extension, otherwise you can't select it. That was my problem...
Thanks
For everyone being stuck (like me) trying to find the Show Coverage Data... action. It's been relocated to the Run section.
As you can read in the official documentation (Version 2020.3), the action can be reached by using the quick search, the various keymaps or by navigating to Run > Show Coverage Data....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With