{"meta":{"title":"Warning: Detected X Kotlin files in your project that could not be processed without a build","intro":"CodeQL databases can be created for Java without building the code, but Kotlin files are excluded unless the code is built.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/troubleshoot-analysis-errors","title":"Troubleshoot analysis errors"},{"href":"/en/code-security/reference/code-scanning/troubleshoot-analysis-errors/kotlin-detected-in-no-build","title":"Kotlin detected in no build"}],"documentType":"article"},"body":"# Warning: Detected X Kotlin files in your project that could not be processed without a build\n\nCodeQL databases can be created for Java without building the code, but Kotlin files are excluded unless the code is built.\n\n## About this warning\n\n```text\nWarning: Detected X Kotlin files in your project that could not be processed without a build. To process these files...\n```\n\nThis warning is reported when Kotlin files are detected in a repository that ran CodeQL code scanning for Java using the build mode of `none` (default setup), or if you run the CodeQL CLI using `--build-mode none` for a repository containing Java and Kotlin files.\n\n## Confirming the cause of the warning\n\nThis warning is only displayed when the build mode of `none` is used for a repository with both Java and Kotlin files.\n\nThe CodeQL action and CodeQL CLI support a build mode of `none` for Java. This provides an easy way to enable analysis for Java code without building the codebase. However, Kotlin files are not included in the resulting CodeQL database.\n\nYou can verify the presence of Kotlin files by looking at the repository or pull request that triggered the warning. The `none` build mode is used only in the following circumstances:\n\n* Code scanning was enabled for the repository before Kotlin code was added and after the new mode was introduced (previously it would have used the `autobuild` mode).\n* The CodeQL workflow specifies a build mode of `none` for the repository (check for `build-mode: none`).\n* The CodeQL CLI is called without a `--command` and with `--build-mode none`.\n\n## Fixing the problem\n\nYou may not want to analyze the Kotlin files, in which case you can ignore the warning message.\n\nIf you want to update the analysis to also include Kotlin files, then CodeQL will need to build the Java and Kotlin code.\n\n### Code scanning default setup\n\n1. Wait until the Kotlin code is merged into the default branch for the repository.\n2. Disable and then re-enable default setup on the \"Settings\" page for your repository.\n\nThis will trigger a new analysis using automatic build detection. See [Configuring default setup for code scanning](/en/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning) and [Building Java and Kotlin](/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#building-java-and-kotlin).\n\nIf the automatic build detection fails, you will need to use advanced setup with the correct build commands for the project to analyze both languages.\n\n### Code scanning advanced setup\n\nIf you already use advanced setup, you can edit the CodeQL workflow and change the build mode for `java-kotlin` from `none` to either `autobuild` to automatically build your project, or `manual` to specify your own build steps. [Building Java and Kotlin](/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#building-java-and-kotlin).\n\nIf you need to convert from default setup to advanced setup, you need enable advanced setup on the on the \"Settings\" page for your repository and create a CodeQL workflow. Then you can define a `manual` build mode for `java-kotlin` and define the build commands for the project.\n\n### Running the CodeQL CLI directly\n\nUpdate your calls to run the CodeQL CLI for the repository and pull requests to replace `--build-mode none` by `--build-mode autobuild` to try the automatic build detection. If automatic build detection is unsuccessful, remove the `--build-mode` option and include one or more `--command` options detailing the build script or steps required to build the project.\n\n## Further reading\n\n* [Configuring advanced setup for code scanning](/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning)\n* [Building Java and Kotlin](/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#building-java-and-kotlin)\n* [CodeQL build modes](/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes)"}