Find unused code with coverage
Run an application in the Code Coverage mode
Choose the newly created configuration in the Select run/debug configuration list on the toolbar and click the Run with Coverage button () next to the list.
The URL address specified in the run configuration opens in the browser.
To learn what code was executed during the page load, just load the application and then stop it by clicking the Stop button () on the toolbar, next to the Run with Coverage button (), or in the Run tool window. If you need a coverage report for some specific features of your application, trigger these features in the browser and only then click the Stop button () to stop the application.
View the report in the Coverage tool window. The Project tool window shows information about the coverage of files and folders. In the editor, the gutter shows green markers next to the lines that were executed and red markers next to those that were not. You can also hover over the line markers and see how many times each line of code was hit.