Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-04-09. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Scan from VS Code

Scan and analyze code from Visual Studio Code using CodeQL to write, test, and run queries, explore code structure, and manage databases and packs.

Installing CodeQL for Visual Studio Code

To get started with CodeQL for Visual Studio Code, you need to install and set up the extension.

Managing CodeQL databases

You can work with CodeQL databases using the extension.

Running CodeQL queries

You can run queries on CodeQL databases and view the results in Visual Studio Code.

Exploring data flow with path queries

Detect potential vulnerabilities by running path queries and analyzing your data flow.

Using the CodeQL model editor

You can view, write, and edit CodeQL model packs in Visual Studio Code.

Creating a custom query

You can work from a template to write your own code to create a custom query to analyze a specific language.

Managing CodeQL query packs and library packs

Download and install dependencies for your CodeQL query and library packs in Visual Studio Code using the CodeQL extension.

Exploring the structure of your source code

Visualize how your code maps to CodeQL classes in VS Code.

Testing CodeQL queries in Visual Studio Code

You can run unit tests for CodeQL queries using the Visual Studio Code extension.

Customizing settings

You can edit the settings for the CodeQL for Visual Studio Code extension to suit your needs.

Setting up a CodeQL workspace

When you're working with CodeQL, you need access to the standard libraries and queries.

Managing the CodeQL CLI in the VS Code extension

The CodeQL for Visual Studio Code extension uses the CodeQL CLI to compile and run queries.

Accessing logs for CodeQL in Visual Studio Code

If you need to troubleshoot problems with CodeQL for Visual Studio Code, there are several logs you can access.