Set up Kotlin analysis for Eclipse, IntelliJ, or Visual Studio Code

Code Sight Documentation

Version
2026.5.0

While running Coverity Analysis 2022.12.0 or a later version of Coverity, the Eclipse, IntelliJ, and VS Code development environments can analyze Kotlin source code. Some additional setup is required.

In the configuration file that you use, add the string "--kotlin" to the compiler configuration settings. In the same file, specify custom build and clean commands that are compatible with Kotlin.

The following code sample shows a bare-minimum JSON configuration file that can be used to analyze a Kotlin project:

{
    "type": "Coverity configuration",
    "format_version": 1,
    "format_minor_version": 7,
    "settings": {
        "cov_run_desktop": {       
            "build_cmd": ["gradle", "build"],
            "clean_cmd": ["gradle", "clean"]     
        },
        "ide": {       
            "build_strategy": "CUSTOM"     
        },
        "add_compiler_configurations": [
            { "cov_configure_args": ["--kotlin"] }
        ]
    }
}
Attention: In certain cases, when the Gradle® build files have been configured to override the standard Kotlin compilation strategy, you might need to add the following option to the invocation of the build command:
-Pkotlin.compiler.execution.strategy=in-process