You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2503a13
Browse filesBrowse the repository at this point in the historyBrowse files
* If you want to use the most up to date CodeQL tools and features, download the version tagged ``latest``.
54
+
* If you want to generate code scanning data to upload to GitHub Enterprise server, then download the version that is compatible with the CodeQL CLI used in your CI system. For more information, see "`Installing CodeQL CLI in your CI system <https://docs.github.com/en/enterprise-server/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/installing-codeql-cli-in-your-ci-system#downloading-the-codeql-cli>`__" in the GitHub documentation.
66
55
67
56
If you use Linux, Windows, or macOS version 10.14 ("Mojave") or earlier, simply
68
57
`download the zip archive
@@ -232,15 +221,7 @@ see ":doc:`About CodeQL packs <about-codeql-packs>`."
232
221
- For the most up to date CodeQL queries, check out the ``main`` branch.
233
222
This branch represents the very latest version of CodeQL's analysis.
234
223
235
-
- For the queries used in a particular LGTM Enterprise release, check out the
236
-
branch tagged with the relevant release number. For example, the branch
237
-
tagged ``v1.27.0`` corresponds to LGTM Enterprise 1.27. You must use this
238
-
version if you want to upload data to LGTM Enterprise. For further
239
-
information, see `Preparing CodeQL databases to upload to LGTM
Copy file name to clipboardExpand all lines: docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ To analyze a project, you need to add a :ref:`CodeQL database <codeql-database>`
14
14
15
15
#. Open the CodeQL Databases view in the sidebar.
16
16
17
-
#. Hover over the **Databases** title bar and click the appropriate icon to add your database. You can add a database from a local ZIP archive or folder, from a public URL, or from a project slug or URL on LGTM.com.
17
+
#. Hover over the **Databases** title bar and click the appropriate icon to add your database. You can add a database from a local ZIP archive or folder, from a public URL, or from a project's URL on GitHub.com.
- To analyze a test database, add a ``.testproj`` folder to the Databases view.
37
35
Test databases (that is, folders with a ``.testproj`` extension) are generated when you run regression tests on custom queries using the :ref:`CodeQL CLI <codeql-cli>`.
38
36
If a query fails a regression test, you may want to analyze the test database in Visual Studio Code to debug the failure.
39
37
40
38
For more information about running query tests, see ":ref:`Testing custom queries <testing-custom-queries>`" in the CodeQL CLI help.
Copy file name to clipboardExpand all lines: docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Editing settings
28
28
Choosing a version of the CodeQL CLI
29
29
--------------------------------------
30
30
31
-
The CodeQL extension uses the CodeQL CLI to run commands. If you already have the CLI installed and added to your ``PATH``, the extension uses that version. This might be the case if you create your own CodeQL databases instead of downloading them from LGTM.com. Otherwise, the extension automatically manages access to the executable of the CLI for you. For more information about creating databases, see ":ref:`Creating CodeQL databases <creating-codeql-databases>`" in the CLI help.
31
+
The CodeQL extension uses the CodeQL CLI to run commands. If you already have the CLI installed and added to your ``PATH``, the extension uses that version. This might be the case if you create your own CodeQL databases instead of downloading them from GitHub.com. Otherwise, the extension automatically manages access to the executable of the CLI for you. For more information about creating databases, see ":ref:`Creating CodeQL databases <creating-codeql-databases>`" in the CLI help.
32
32
33
33
To override the default behavior and use a different CLI, you can specify the CodeQL CLI **Executable Path**.
Copy file name to clipboardExpand all lines: docs/codeql/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code.rst
+1-15Lines changed: 1 addition & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ Configuring access to the CodeQL CLI
28
28
29
29
The extension uses the CodeQL CLI to compile and run queries.
30
30
31
-
If you already have the CLI installed and added to your ``PATH``, the extension uses that version. This might be the case if you create your own CodeQL databases instead of downloading them from LGTM.com. For more information, see ":ref:`CodeQL CLI <codeql-cli>`."
31
+
If you already have the CLI installed and added to your ``PATH``, the extension uses that version. This might be the case if you create your own CodeQL databases instead of downloading them from GitHub.com. For more information, see ":ref:`CodeQL CLI <codeql-cli>`."
32
32
33
33
Otherwise, the extension automatically manages access to the executable of the CLI for you. This ensures that the CLI is compatible with the CodeQL extension. You can also check for updates with the **CodeQL: Check for CLI Updates** command.
34
34
@@ -57,20 +57,6 @@ There are two ways to do this:
57
57
58
58
For CLI users there is a third option: If you have followed the instructions in ":ref:`Getting started with the CodeQL CLI <getting-started-with-the-codeql-cli>`" to create a CodeQL directory (for example ``codeql-home``) containing the CodeQL libraries, you can open this directory in VS Code. This also gives the extension access to the CodeQL libraries.
59
59
60
-
.. container:: toggle
61
-
62
-
.. container:: name
63
-
64
-
**Click to show information for LGTM Enterprise users**
65
-
66
-
Your local version of the CodeQL queries and libraries should match your version of LGTM Enterprise. For example, if you
67
-
use LGTM Enterprise 1.27, then you should clone the ``1.27.0`` branch of the `starter workspace <https://github.com/github/vscode-codeql-starter/>`__ (or the appropriate ``1.27.x`` branch, corresponding to each maintenance release).
68
-
69
-
This ensures that the queries and libraries you write in VS Code also work in the query console on LGTM Enterprise.
70
-
71
-
If you prefer to add the CodeQL queries and libraries to an :ref:`existing workspace <existing-workspace>` instead of the starter workspace, then you should
72
-
clone the appropriate branch of the `CodeQL repository <https://github.com/github/codeql>`__ and add it to your workspace.
GitHub stores CodeQL databases for over 200,000 repos on GitHub.com, which you can download using the REST API. The list of repos is constantly growing and evolving to make sure that it includes the most interesting codebases for security research.
2
+
3
+
You can check if a repository has any CodeQL databases available for download using the ``/repos/<owner>/<repo>/code-scanning/codeql/databases`` endpoint.
4
+
For example, to check for CodeQL databases using the `GitHub CLI <https://cli.github.com/manual/gh_api>`__ you would run::
5
+
6
+
gh api /repos/<owner>/<repo>/code-scanning/codeql/databases/
7
+
8
+
This command returns information about any CodeQL databases that are available for a repository, including the language the database represents, and when the database was last updated. If no CodeQL databases are available, the response is empty.
9
+
10
+
When you have confirmed that a CodeQL database exists for the language you are interested in, you can download it using the following command::
11
+
12
+
gh api /repos/<owner>/<repo>/code-scanning/codeql/databases/<language> -H 'Accept: application/zip' > path/to/local/database.zip
13
+
14
+
For more information, see the documentation for the `Get CodeQL database <https://docs.github.com/en/rest/reference/code-scanning#get-codeql-database>`__ endpoint in the GitHub REST API documentation.
0 commit comments