Configuration options for Clover are accessible on the Clover panel of the Project Properties dialog. The first Tab on this panel provides compilation options:
Screenshot: Clover for IDEA Compilation Options
This section controls where the Clover coverage database will be stored. Select 'Automatic' to have Clover manage this location for you (relative to your project directory). Select 'User Specified' to nominate the path to the Clover coverage database. This is useful if you want to use the plugin in conjunction with an Ant build that already sets the location of the Clover coverage database.
The Flush Policy controls how Clover writes coverage data to disk at runtime. See Flush Policies.
Allows you to specify a comma separated list of set of Ant Patternsets that describe which files to include and exclude in instrumentation. These options are the same as those described in the <clover-setup> task. You can also specify whether source in test folders should be also instrumented.
For example, by using an "Excludes" value of _**/remote/*.java _ you will stop instrumentation of files in the "remote" folder of your project.
It is now possible to change exclusion/inclusion patterns directly from the Project Explorer.
Right click on a package or file, click the Change Exclusion context menu and select whether a pattern corresponding to the selected element should be added (or removed) from your includes or excludes list.
Files in the Project Explorer are annotated by gray or green clover when they are currently excluded or included by the current Clover configuration. A package is annotated when it is explicitly excluded or included.
When your Includes/Excludes are edited manually via the settings, the package annotation may not work correctly (manual pattern may be not recognized), but the file annotation always reflects what the Clover instrumenter will use.
Screenshot: Right-Click Context Menu for Setting Includes and Excludes
Due to Clover's restrictions related with code instrumentation and javac compiler's type inference capabilities, you may get compilation errors when expression-like lambda functions are passed to generic methods or types. In such case disable instrumentation of expression-like form (i.e. use the none or block setting). See the Java 8 code instrumented by Clover fails to compile Knowledge Base article for more details.
The Clover database becomes obsolete after certain operations (such as toggling Build with Clover). The Rebuild Policy setting allows defining the plugin's behavior in the case of such an event.
The second Tab on the configuration panel provides view options;
Screenshot: Clover for IDEA View Options
The Refresh Policy controls how the Clover Plugin monitors the Coverage Database for new data.
"Manual" means that you have to click button to refresh the coverage data.
"Automatic" means that the Clover Plugin will refresh the database on:
"Periodically" means that the Clover Plugin will periodically check for new coverage data for you.
Allows you to customize where coverage data is displayed within the IntelliJ IDE. Gutter marks appear in the left hand gutter of the Java Source Editor. Source highlights appear directly over your source code. Shortcut marks appear in the right hand gutter and allow you to navigate directly to uncovered regions of code.
See Using Spans.
Per-test coverage can be disabled to boost performance. If you disable this feature, the following information will not be available:
However, the coverage data will load load faster as a result.
Allows you to fine tune the colours used Clover in its coverage reporting. The 'highlight colour' for each item is used for Source Highlights and the 'stripe colour' for each item is used for Gutter and Shortcut marks.
The third Tab on the configuration panel provides filter options;
Screenshot: Clover for IDEA Filter Options
Allows you to specify contexts to ignore when viewing coverage information. For example, selecting the finally body context will remove 'finally' block bodies ('block' syntatic constructs in the Java language) from the reported coverage. For more information, see Coverage Contexts in the Clover Core documentation.
This allow you to define custom contexts to ignore when viewing coverage information.
Working with regexp filters:
To make a new/edited filter active, you need to delete the existing coverage database using the button and rebuild your project/module.
See Coverage Contexts for more information.
For the sake of this example, let us assume that we want to remove all private methods from the coverage reports. How would we go about this?
Now you have tweaked and hacked Clover according to your developer needs. But you would like to share information about code coverage with you colleagues or present it to management? If yes, read next chapter: 6. Generating reports in IDEA.