Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>C++ Code DoctorNew to Visual Studio Code? Get it now.
C++ Code Doctor

C++ Code Doctor

RSCD

rscd.net
|
69 installs
| (0) | Free
C++ code analysis in VS Code. Detect issues instantly with zero configuration and no external dependencies.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

C++ Code Doctor - Compiler-Independent C++ Static Analysis for VS Code

Find unused C++ variables, remove unnecessary includes, and catch overlooked code issues directly in VS Code, without compiler setup or an additional build step.

C++ Code Doctor helps you keep your C++ codebase clean and maintainable with immediate feedback while you code, independently of your compiler toolchain.

  • Unused variable detection - find variables that are declared but never used.
  • Unused include detection - identify unnecessary #include directives.
  • Unevaluated return value checks with Pro - identify return values that are computed but never used.
  • AST-based analysis with Pro - analyze C++ code structurally instead of relying on text patterns.
  • Project-wide analysis with Pro - inspect code across multiple files.

Start with the free version and upgrade when you need deeper analysis.

Install C++ Code Doctor · Explore Pro


See It in Action

Unused Variable Detection

C++ Code Doctor highlighting an unused variable in VS Code

Find unused variables directly in your C++ source files.

Unused Include Detection

C++ Code Doctor detecting an unnecessary include in VS Code

Identify unnecessary header dependencies and keep your source files focused on the headers they actually need.

Unevaluated Return Value Detection (Pro only)

C++ Code Doctor detecting an unevaluated return value in VS Code

Detect function return values that are computed but never used and identify potential logic issues that might otherwise go unnoticed.


Why C++ Code Doctor?

C++ projects accumulate unused variables, unnecessary includes, and other code that makes a codebase harder to maintain.

C++ Code Doctor helps you identify these issues directly in VS Code, without requiring a separate compiler integration or build step.

Compiler-Independent Analysis

Add static analysis to your C++ workflow without configuring compiler integration for the supported checks. C++ Code Doctor works independently of your compiler and build system, making it useful for projects with custom toolchains and complex build environments.

Clean Up Unused Code

Find unused variables and unnecessary includes before they become part of a larger codebase.

Reduce Unnecessary Dependencies

Unneeded includes can increase dependency coupling and contribute to longer compilation times. Identifying them helps keep your translation units leaner.


Free vs. Pro

Choose the analysis approach that fits your project.

Feature Free Pro
Unused variable detection Yes Yes
Unused include detection Yes Yes
Unevaluated return value checks - Yes
AST-based analysis - Yes
Scope-aware analysis - Yes
Analysis across multiple files - Yes
Dedicated findings panel - Yes
Persistent false-positive suppression - Yes

Compare plans and upgrade to Pro


Free: Lightweight C++ Analysis

The Free version uses regex-based detection to identify unused variables and includes in individual files.

What's Included

  • Unused variable detection
  • Unused include detection
  • Immediate feedback inside VS Code
  • No additional setup or external toolchain required

Limitations

Because the analysis relies on text patterns rather than a full structural representation of the code, complex C++ syntax can lead to false positives or missed findings.

In particular:

  • Templates, macros, and namespaces can be difficult to handle reliably.
  • Complex declarations and language constructs may not be interpreted correctly.
  • Some header filenames containing multiple dots, such as my.header.hpp, may be misdetected.
  • System headers are excluded from the checks.

The Free version is a convenient starting point for straightforward C++ files.

If you work with complex C++ code or need analysis across multiple files, Pro provides a more advanced approach.


Pro: AST-Based C++ Analysis

Go beyond text matching.

Pro uses Tree-sitter to analyze C++ code structure, enabling more context-aware checks for unused variables and includes. It also provides unevaluated return value checks, project-wide analysis, a dedicated findings panel, and persistent false-positive suppression.

What's Included

  • AST-based unused variable detection - analyze variable usage with awareness of code structure and scope.
  • AST-based unused include detection - identify unnecessary includes using structural analysis.
  • Unevaluated return value checks - find return values that are produced but not used.
  • Project-wide analysis - analyze code across multiple files.
  • Dedicated findings panel - review detected issues in one place.
  • Persistent false-positive suppression - mark findings as false positives and retain those decisions.

Why AST-Based Analysis Matters

C++ is more than a collection of text patterns.

Scopes, declarations, namespaces, templates, and relationships between files can make it difficult to determine whether a variable or include is actually needed.

Pro uses Tree-sitter to analyze the structure of your code, enabling more context-aware checks and helping reduce false positives in cases where text-based detection falls short.

This makes Pro particularly useful for larger and more complex C++ codebases.

AST-based analysis is not infallible. Certain aliases, complex include dependencies, and macro-heavy code can still produce inaccurate results.

Upgrade to Pro


Installation and Requirements

  1. Open Visual Studio Code.
  2. Open the Extensions view.
  3. Search for C++ Code Doctor.
  4. Install the extension.
  5. Open a C++ project and start coding.

No separate compiler integration, build step, or additional analysis toolchain is required for the supported checks.

C++ Code Doctor does not replace your compiler, build system, or existing diagnostics. It complements your development workflow with additional code-quality checks.


Activating Pro

To activate Pro, enter your license key in the VS Code setting:

cppCodeDoctor.licenseKey

Once activated, the Pro features become available according to your license.

For pricing and licensing information, visit the C++ Code Doctor pricing page.


Known Limitations

Static analysis has inherent limitations, especially when analyzing complex C++ language constructs.

Free

  • Text-based detection can produce false positives and false negatives.
  • Templates, macros, namespaces, and complex declarations are not always handled correctly.
  • Some header filenames containing multiple dots may not be detected.

Pro

  • Some typedef and macro cases may not always resolve correctly.
  • Complex include chains can produce edge cases.
  • Extremely macro-heavy code can still lead to inaccurate results.

The analysis is continuously refined to improve reliability across real-world C++ codebases.


Third-Party Components

C++ Code Doctor uses the following third-party components:

  • Tree-sitter - MIT
  • Tree-sitter C grammar - MIT
  • Tree-sitter C++ grammar - MIT
  • vscode-languageclient - MIT
  • TypeScript - Apache 2.0
  • ESLint - MIT

See the NOTICE file for details.


License

C++ Code Doctor is proprietary software.

See LICENSE for details.


Changelog

See CHANGELOG.md for release history and updates.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft