{"id":27958061,"url":"https://github.com/ericsson/codecheckervscodeplugin","last_synced_at":"2025-05-07T18:16:10.424Z","repository":{"id":39971117,"uuid":"378966443","full_name":"Ericsson/CodecheckerVSCodePlugin","owner":"Ericsson","description":"VSCode plugin that shows bugs detected by the Clang Static Analyzer and Clang Tidy analyzers using CodeChecker as a backend.","archived":false,"fork":false,"pushed_at":"2024-10-03T05:51:20.000Z","size":8271,"stargazers_count":24,"open_issues_count":17,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-07T18:16:03.396Z","etag":null,"topics":["analysis","c","codechecker","cpp","plugin","static-analysis","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ericsson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-21T14:52:02.000Z","updated_at":"2024-10-02T12:11:00.000Z","dependencies_parsed_at":"2024-04-10T09:45:30.636Z","dependency_job_id":"554ae5be-1bdf-4c06-98a8-8d82f676a077","html_url":"https://github.com/Ericsson/CodecheckerVSCodePlugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ericsson%2FCodecheckerVSCodePlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ericsson%2FCodecheckerVSCodePlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ericsson%2FCodecheckerVSCodePlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ericsson%2FCodecheckerVSCodePlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ericsson","download_url":"https://codeload.github.com/Ericsson/CodecheckerVSCodePlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931507,"owners_count":21827112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","c","codechecker","cpp","plugin","static-analysis","vscode","vscode-extension"],"created_at":"2025-05-07T18:16:09.714Z","updated_at":"2025-05-07T18:16:10.377Z","avatar_url":"https://github.com/Ericsson.png","language":"TypeScript","readme":"# CodeChecker VSCode Plugin\n\nThis is a C/C++ code analysis plugin for VSCode that shows bug reports detected by the [Clang Static Analyzer] and [Clang Tidy] analyzers, using [CodeChecker] as a backend.\n\n[Clang Static Analyzer]: http://clang-analyzer.llvm.org/\n[Clang Tidy]: http://clang.llvm.org/extra/clang-tidy/\n[CodeChecker]: https://github.com/Ericsson/codechecker\n\n![CodeChecker extension](media/codechecker-splash.png)\n\n## Quick Start\n\n1. [Install CodeChecker] version 6.18.2 or later, and optionally add it to the `PATH` environment variable.\n2. Install the CodeChecker extension from the [Visual Studio Marketplace], from [Open VSX], or download manually from [Downloads].\n3. [Set up your build environment] to generate a `compile_commands.json` file.\n4. Check the path to CodeChecker, and set your preferred command-line arguments - see [Configuring CodeChecker] for more information.\n5. Open your project, and run an analysis, or browse through the found reports!\n\n[Install CodeChecker]: https://github.com/Ericsson/CodeChecker#install-guide\n[Visual Studio Marketplace]: https://marketplace.visualstudio.com/items?itemName=codechecker.vscode-codechecker\n[Open VSX]: https://open-vsx.org/extension/codechecker/codechecker\n[Downloads]: https://github.com/Ericsson/CodecheckerVSCodePlugin/releases\n[Set up your build environment]: #setting-up-your-build-environment\n[Configuring CodeChecker]: #configuring-codechecker\n\n## Features\n\n- Browse through the found reports, and show the reproduction steps directly in the code\n- Navigate between the reproduction steps (`F9`/`Shift-F9` by default)\n\n![Showcase of repr steps](media/codechecker-repr-step.gif)\n\n- Run a CodeChecker analysis from the editor, and see the results automatically\n- Re-analyze the current file when saved (can be disabled in Settings)\n\n![File analysis](media/codechecker-analysis.gif)\n\n- Commands and build tasks for running CodeChecker as part of a build system\n\n![Commands and tasks](media/codechecker-tasks.gif)\n\n## Setting up your build environment\n\nCodeChecker works by reading a generated [compilation database], often called `compile_commands.json`, and executing specific analyses based on that.\n\n`CMake` has built-in support for generating a compilation database. Set the environment variable `CMAKE_EXPORT_COMPILE_COMMANDS=ON`, and the compilation database should be inside your build folder.\nIf you are using the `CMake Tools` extension for VS Code, you can add this flag to the extension settings under `Cmake \u003e Build Environment`.\n\n`make` and other build systems have no built-in support for generating a compilation database, but CodeChecker can generate one based on the build command. To generate one, you can use the command `CodeChecker log -b \"[full build command]\" -o .codechecker/compile_commands.json`.\n\nTo automate the process, the extension provides ways to run the `CodeChecker log` command automatically. First, in the Extension Settings set `CodeChecker \u003e Executor \u003e Log build command`, and then use either the VS Code Task, or the VS Code command `CodeChecker: Run CodeChecker Log` to execute the analysis. You can also run `CodeChecker: Preview CodeChecker log in terminal` to have more fine-grained control over the parameters passed to CodeChecker.\n\n[compilation database]: https://clang.llvm.org/docs/JSONCompilationDatabase.html\n\n## Configuring CodeChecker\n\nThe extension uses Codechecker version 6.18.2 or later. If your installation path is different, or CodeChecker is not in the the `PATH` environment variable, the path to it can be set manually under `Preferences \u003e Settings \u003e Extensions \u003e CodeChecker \u003e Executable path`.\n\nThe extension can run a CodeChecker analysis on your project, either when saving a file, or when using one of the `CodeChecker: Analyze` commands. You can stop the analysis by clicking the *Cancel* button on CodeChecker's notification - partial results are saved automatically.\n\nThe analysis is fully configurable, and the resulting CodeChecker command line can be previewed with the `CodeChecker: Show full command line` command (for supported arguments, run `CodeChecker analyze --help`). Settings for the current workspace can be set on the *Workspace* tab in the Settings. Automatic analysis on saving can be configured as well.\n\nDetailed information about the configuration options can be found under [Settings].\n\n[Settings]: #settings\n\n## Commands and tasks\n\nThe extension provides the following commands:\n\n| Command | Description |\n| --- | --- |\n| `CodeChecker: Analyze current file` | Analyzes the currently opened source file using CodeChecker. Can also be called by clicking on the `Re-analyze current file` button in CodeChecker's side panel. \u003cbr\u003e Useful when the `Run On Save` is turned off in the plugin's settings. |\n| `CodeChecker: Analyze selected files...` | Analyzes the files selected by the user, using CodeChecker. Accepts multiple files as input. |\n| `CodeChecker: Analyze entire project` | Analyzes the entire project using CodeChecker. Can also be called by clicking on the `Re-analyze entire project` button in CodeChecker's side panel.\u003cbr\u003e *Warning:* A full analysis can take minutes, or even hours on larger projects. |\n| `CodeChecker: Stop running CodeChecker instance` | Stops the currently running analysis. Partial results are saved and updated. |\n| `CodeChecker: Run CodeChecker log` | Updates the compilation database, by building the current project. A variant with a custom user-specified build command is also available. |\n| `CodeChecker: Preview CodeChecker log in terminal` | The current CodeChecker log command is pasted into a new terminal window, where it can be edited before running it. |\n| `CodeChecker: Show database setup dialog` | Shows the dialog to select the path to an existing compilation database, or to create a new one. |\n| `CodeChecker: Next reproduction step`, \u003cbr\u003e `CodeChecker: Previous reproduction step` | Moves between a displayed reproduction path's steps. You can also navigate directly to a report's step via CodeChecker's side panel. \u003cbr\u003e Default keybinds: `Ctrl-F7`, `Ctrl-Shift-F7` respectively. |\n| `CodeChecker: Show full CodeChecker analyze command line` | Shows the full CodeChecker command line used to analyze files. \u003cbr\u003e Useful if you want to review the analyzer's options before running, or if you want to run the analysis manually. |\n| `CodeChecker: Show Output` | Focuses CodeChecker's output in the editor. The plugin's logs, as well as the output of previous CodeChecker runs are displayed here. |\n| `CodeChecker: Reload metadata` | Reloads CodeChecker's `metadata.json` file. Can also be called by clicking on the `Reload CodeChecker metadata` button on the CodeChecker's side panel. |\n\n\nThe analysis commands are also available in task form:\n| **Task** | **Equivalent command** |\n| --- | --- |\n| `{ type: \"CodeChecker\", taskType: \"currentFile\" }` | `CodeChecker: Analyze current file` |\n| `{ type: \"CodeChecker\", taskType: \"selectedFiles\", selectedFiles: [] }` | `CodeChecker: Analyze selected files...` \u003cbr\u003e Selected files are listed in the `selectedFiles` array, using full paths. |\n| `{ type: \"CodeChecker\", taskType: \"project\" }` | `CodeChecker: Analyze entire project` |\n| `{ type: \"CodeChecker log\" }` | `CodeChecker: Run CodeChecker log` |\n| `{ type: \"CodeChecker log\", customBuildCommand: \"...\" }` | `CodeChecker: Run CodeChecker log with custom build command` |\n\n## Settings\n\nSince CodeChecker-related paths vary greatly between systems, the following settings are provided, accessible through the Settings menu:\n\n| Name | Description |\n| --- | --- |\n| CodeChecker \u003e Backend \u003e Output folder \u003cbr\u003e (default: `${workspaceFolder}/.codechecker`) | The output folder where the CodeChecker analysis files are stored. |\n| CodeChecker \u003e Backend \u003e Compilation database path \u003cbr\u003e (default: *(empty)*) | Path to a custom compilation database, in case of a custom build system. The database setup dialog sets the path for the current workspace only. Leave blank to use the database in CodeChecker's output folder, or to use CodeChecker's autodetection for multi-root workspaces. |\n| CodeChecker \u003e Editor \u003e Custom bug severities \u003cbr\u003e (default: `null`) | Control how a bug is displayed in the editor, depending on what its severity is. Bugs can be displayed as 'Error', 'Warning', 'Information' or 'Hint'. By default, everything except 'STYLE' severity is displayed as an error. Configured as an array, such as `{ \"UNSPECIFIED\": \"Warning\", \"LOW\": \"Warning\" }` |\n| CodeChecker \u003e Editor \u003e Show database dialog \u003cbr\u003e (default: `on`) | Controls the dialog when opening a workspace without a compilation database. |\n| CodeChecker \u003e Editor \u003e Enable CodeLens \u003cbr\u003e (default: `on`) | Enable CodeLens for displaying the reproduction path in the editor. |\n| CodeChecker \u003e Executor \u003e Enable notifications \u003cbr\u003e (default: `on`) | Enable CodeChecker-related toast notifications. |\n| CodeChecker \u003e Executor \u003e Executable path \u003cbr\u003e (default: `CodeChecker`) | Path to the CodeChecker executable. Can be an executable in the `PATH` environment variable, or an absolute path to one. |\n| CodeChecker \u003e Executor \u003e Analysis timeout \u003cbr\u003e (default: *60*) | The timeout (in seconds) for each individual analysis run by the CodeChecker analyze command - set to 0 to disable the timeout. |\n| CodeChecker \u003e Executor \u003e Thread count \u003cbr\u003e (default: *(empty)*) | CodeChecker's thread count - leave empty to use all threads. |\n| CodeChecker \u003e Executor \u003e Arguments \u003cbr\u003e (default: *(empty)*) | Additional arguments to `CodeChecker analyze`. For example, if you want to use a config file for CodeChecker pass '--config \u003cconfig.json\u003e'. For supported arguments, run `CodeChecker analyze --help`. \u003cbr\u003e *Note:* The resulting command-line can be previewed with the command `CodeChecker: Show full CodeChecker analyze command line`. |\n| CodeChecker \u003e Executor \u003e Log build command \u003cbr\u003e (default: `make`) | The default build command used when running `CodeChecker log` via commands or tasks. |\n| CodeChecker \u003e Executor \u003e Log Arguments \u003cbr\u003e (default: *(empty)*) | Additional arguments to `CodeChecker log`. \u003cbr\u003e *Note:* The resulting command-line can be previewed with the command `CodeChecker: Preview CodeChecker log in terminal`. |\n| CodeChecker \u003e Executor \u003e Run on save \u003cbr\u003e (default: `on`) | Controls auto-run of CodeChecker on saving a file. |\n\n## Development\n_Note_: If you have already installed this extension from Marketplace, uninstall it first to prevent conflicts with your own build.\n\nThis extension uses Node.js (v12+) and Yarn (v2+).\nRecommended VS Code extensions are [ESLint] and [TypeScript+Webpack Problem Matcher]\n\nTo build and run the extension, do the following:\n\n* `yarn install --immutable`, to install dependencies\n* Open in Visual Studio Code (`code .`)\n* Press F5 to start debugging\n  \nTo run tests, select Extension Tests as the active debug configuration, or run `yarn run test`.\n\n[ESLint]: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint\n[TypeScript+Webpack Problem Matcher]: https://marketplace.visualstudio.com/items?itemName=amodio.tsl-problem-matcher\n\n## License\n\nThe extension is released under the [Apache 2.0 license], the same license as [CodeChecker].\n\n[Apache 2.0 license]: https://github.com/Ericsson/CodecheckerVSCodePlugin/blob/main/LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericsson%2Fcodecheckervscodeplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericsson%2Fcodecheckervscodeplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericsson%2Fcodecheckervscodeplugin/lists"}