mirror of
https://github.com/hohn/codeql-info.git
synced 2025-12-16 20:53:04 +01:00
354 lines
32 KiB
HTML
354 lines
32 KiB
HTML
<!DOCTYPE html>
|
||
|
||
<html lang="en" data-content_root="../">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<title>Running CodeQL queries at scale with multi-repository variant analysis — CodeQL</title>
|
||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
|
||
<link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=93459777" />
|
||
<script src="../_static/documentation_options.js?v=5929fcd5"></script>
|
||
<script src="../_static/doctools.js?v=888ff710"></script>
|
||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<link rel="icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="Testing CodeQL queries in Visual Studio Code" href="testing-codeql-queries-in-visual-studio-code.html" />
|
||
<link rel="prev" title="Exploring data flow with path queries" href="exploring-data-flow-with-path-queries.html" />
|
||
|
||
<title>CodeQL docs</title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<link rel="stylesheet" href="../_static/custom.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/primer.css" type="text/css" />
|
||
|
||
|
||
</head><body>
|
||
<header class="Header">
|
||
<div class="Header-item--full">
|
||
<a href="https://codeql.github.com/docs" class="Header-link f2 d-flex flex-items-center">
|
||
<!-- <%= octicon "mark-github", class: "mr-2", height: 32 %> -->
|
||
<svg height="32" class="octicon octicon-mark-github mr-2" viewBox="0 0 16 16" version="1.1" width="32"
|
||
aria-hidden="true">
|
||
<path fill-rule="evenodd"
|
||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">
|
||
</path>
|
||
</svg>
|
||
<span class="hide-sm">CodeQL documentation</span>
|
||
</a>
|
||
</div>
|
||
<div class="Header-item hide-sm hide-md">
|
||
<script src="https://addsearch.com/js/?key=93b4d287e2fc079a4089412b669785d5&categories=!0xhelp.semmle.com,0xcodeql.github.com,1xdocs,1xcodeql-standard-libraries,1xcodeql-query-help"></script>
|
||
</div>
|
||
<div class="Header-item">
|
||
|
||
<details class="dropdown details-reset details-overlay d-inline-block">
|
||
<summary class="btn bg-gray-dark text-white border" aria-haspopup="true">
|
||
CodeQL resources
|
||
<div class="dropdown-caret"></div>
|
||
</summary>
|
||
|
||
<ul class="dropdown-menu dropdown-menu-se dropdown-menu-dark">
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/codeql-overview">CodeQL overview</a></li>
|
||
<li class="dropdown-divider" role="separator"></li>
|
||
<div class="dropdown-header">
|
||
CodeQL tools
|
||
</div>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/codeql-for-visual-studio-code">CodeQL for VS Code</a>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/codeql-cli">CodeQL CLI</a>
|
||
</li>
|
||
<li class="dropdown-divider" role="separator"></li>
|
||
<div class="dropdown-header">
|
||
CodeQL guides
|
||
</div>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/writing-codeql-queries">Writing CodeQL queries</a></li>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/codeql-language-guides">CodeQL language guides</a>
|
||
<li class="dropdown-divider" role="separator"></li>
|
||
<div class="dropdown-header">
|
||
Reference docs
|
||
</div>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/docs/ql-language-reference/">QL language
|
||
reference</a>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/codeql-standard-libraries">CodeQL
|
||
standard-libraries</a>
|
||
<li><a class="dropdown-item" href="https://codeql.github.com/codeql-query-help">CodeQL
|
||
query help</a>
|
||
<li class="dropdown-divider" role="separator"></li>
|
||
<div class="dropdown-header">
|
||
Source files
|
||
</div>
|
||
<li><a class="dropdown-item" href="https://github.com/github/codeql">CodeQL repository</a>
|
||
</ul>
|
||
</details>
|
||
|
||
</div>
|
||
|
||
</header>
|
||
<main class="bg-gray-light clearfix">
|
||
<nav class="SideNav position-sticky top-0 col-lg-3 col-md-3 float-left p-4 hide-sm hide-md overflow-y-auto">
|
||
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="../codeql-overview/index.html">CodeQL overview</a></li>
|
||
<li class="toctree-l1 current"><a class="reference internal" href="index.html">CodeQL for Visual Studio Code</a><ul class="current">
|
||
<li class="toctree-l2"><a class="reference internal" href="about-codeql-for-visual-studio-code.html">About CodeQL for Visual Studio Code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="setting-up-codeql-in-visual-studio-code.html">Setting up CodeQL in Visual Studio Code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="analyzing-your-projects.html">Analyzing your projects</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="exploring-the-structure-of-your-source-code.html">Exploring the structure of your source code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="exploring-data-flow-with-path-queries.html">Exploring data flow with path queries</a></li>
|
||
<li class="toctree-l2 current"><a class="current reference internal" href="#">Running CodeQL queries at scale with multi-repository variant analysis</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="testing-codeql-queries-in-visual-studio-code.html">Testing CodeQL queries in Visual Studio Code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="working-with-codeql-packs-in-visual-studio-code.html">Working with CodeQL packs in Visual Studio Code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="using-the-codeql-model-editor.html">Using the CodeQL model editor</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="customizing-settings.html">Customizing settings</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="troubleshooting-codeql-for-visual-studio-code.html">Troubleshooting CodeQL for Visual Studio Code</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="troubleshooting-variant-analysis.html">Troubleshooting variant analysis</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="about-telemetry-in-codeql-for-visual-studio-code.html">About telemetry in CodeQL for Visual Studio Code</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../codeql-cli/index.html">CodeQL CLI</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../writing-codeql-queries/index.html">Writing CodeQL queries</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../codeql-language-guides/index.html">CodeQL language guides</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../ql-language-reference/index.html">QL language reference</a></li>
|
||
</ul>
|
||
|
||
|
||
</nav>
|
||
|
||
|
||
<div class="body col-sm-12 col-md-9 col-lg-9 float-left border-left">
|
||
|
||
<div class="hide-lg hide-xl px-4 pt-4">
|
||
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<ul>
|
||
<li class="nav-item nav-item-0"><a href="../contents.html">CodeQL</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="index.html"
|
||
accesskey="U">CodeQL for Visual Studio Code</a> »</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<article class="p-4 col-lg-10 col-md-10 col-sm-12">
|
||
|
||
<section id="running-codeql-queries-at-scale-with-multi-repository-variant-analysis">
|
||
<span id="running-codeql-queries-at-scale-with-mrva"></span><h1>Running CodeQL queries at scale with multi-repository variant analysis<a class="headerlink" href="#running-codeql-queries-at-scale-with-multi-repository-variant-analysis" title="Link to this heading">¶</a></h1>
|
||
<blockquote class="pull-quote">
|
||
<div><p>Note</p>
|
||
<p>Multi-repository variant analysis is currently available as a beta release and is subject to change. To use this feature, you must upgrade the CodeQL extension for Visual Studio Code to a minimum of version 1.8.0.</p>
|
||
<p>You can report your feedback in the community discussion for the beta release: <a class="reference external" href="https://gh.io/mrva-public-beta-discussion">https://gh.io/mrva-public-beta-discussion</a>.</p>
|
||
</div></blockquote>
|
||
<section id="about-multi-repository-variant-analysis">
|
||
<h2>About multi-repository variant analysis<a class="headerlink" href="#about-multi-repository-variant-analysis" title="Link to this heading">¶</a></h2>
|
||
<p>When you write a query to find variants of a security vulnerability and finish testing it locally, the next step is to run it on a large group of repositories. Multi-repository variant analysis (variant analysis) makes it easy run a query on up to 1000 repositories without leaving Visual Studio Code.</p>
|
||
<p>The core functionality of the CodeQL extension helps you write queries and run them locally against a CodeQL database. In contrast, variant analysis allows you to send your CodeQL query to GitHub.com to be tested against a list of repositories.</p>
|
||
<p>When you run variant analysis against a list of repositories, your query is run against each repository that has a CodeQL database available to analyze. GitHub creates and stores the latest CodeQL database for the default branch of thousands of public repositories, including every repository that runs code scanning using CodeQL.</p>
|
||
<p>If you want to run variant analysis on your repositories, you need to enable code scanning using CodeQL on GitHub.com before adding your repository to a list for analysis (either default setup, or advanced setup using the CodeQL action). For information about enabling code scanning using CodeQL, see “<a class="reference external" href="https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically">Configuring code scanning automatically</a>.”</p>
|
||
</section>
|
||
<section id="setting-a-controller-repository-for-variant-analysis">
|
||
<span id="controller-repository"></span><h2>Setting a controller repository for variant analysis<a class="headerlink" href="#setting-a-controller-repository-for-variant-analysis" title="Link to this heading">¶</a></h2>
|
||
<p>When you run variant analysis, the analysis is run entirely using GitHub Actions. You don’t need to create any workflows, but you must specify which GitHub repository the CodeQL extension should use as the “controller repository.” Controller repositories can be empty, but they must have at least one commit.</p>
|
||
<blockquote class="pull-quote">
|
||
<div><p>Note</p>
|
||
<ul class="simple">
|
||
<li><p>The controller repository visibility can be “public” if you plan to analyze public repositories. The variant analysis will be free.</p></li>
|
||
<li><p>The controller repository visibility must be “private” if you need to analyze any private or internal repositories. Any actions minutes used by variant analysis, above the free limit, will be charged to the repository owner. For more information about free minutes and billing, see “<a class="reference external" href="https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions">About billing for GitHub Actions</a>.”</p></li>
|
||
</ul>
|
||
</div></blockquote>
|
||
<p>You must define a controller repository before you can run your first variant analysis.</p>
|
||
<a class="reference internal image-reference" href="../_images/controller-repository.png"><img alt="Screenshot of the CodeQL extension in Visual Studio Code. The "Variant Analysis Repositories" section is expanded and the "Set up controller repository" button is highlighted with a dark orange outline." src="../_images/controller-repository.png" style="width: 350px;" /></a>
|
||
<ol class="arabic simple">
|
||
<li><p>In Visual Studio Code, click <strong>QL</strong> in the left sidebar to display the CodeQL extension.</p></li>
|
||
<li><p>Expand <strong>Variant Analysis Repositories</strong> and click <strong>Set up controller repository</strong> to display a field for the controller repository.</p></li>
|
||
<li><p>Type the owner and name of the repository on GitHub.com that you want to use as your controller repository and press the <strong>Enter</strong> key.</p></li>
|
||
<li><p>If you are prompted to authenticate with GitHub, follow the instructions and sign into your personal or organization account. When you have finished following the process, a prompt from GitHub Authentication may ask for permission to open a URI in Visual Studio Code, click <strong>Open</strong>.</p></li>
|
||
</ol>
|
||
<p>The name of the controller repository is saved in your settings for the CodeQL extension. For information on how to edit the controller repository, see “<a class="reference internal" href="customizing-settings.html#customizing-settings"><span class="std std-ref">Customizing settings</span></a>.”</p>
|
||
</section>
|
||
<section id="running-a-query-at-scale-using-variant-analysis">
|
||
<h2>Running a query at scale using variant analysis<a class="headerlink" href="#running-a-query-at-scale-using-variant-analysis" title="Link to this heading">¶</a></h2>
|
||
<ol class="arabic">
|
||
<li><p>Expand the <strong>Variant Analysis Repositories</strong> section, to show the default lists which include a selection of 10, 100, and 1,000 public repositories on GitHub.com for the language that you are analyzing.</p></li>
|
||
<li><p>Select which GitHub repository or repositories you want to run your query against. Click a row to highlight it, and then click <strong>Select</strong> to select that repository, organization, or list of repositories. If you want to add a new repository, organization, or list, use the options in the header panel. For information, see “<a class="reference internal" href="#custom-lists"><span class="std std-ref">Creating custom lists of repositories</span></a>”, later in this article.</p>
|
||
<blockquote>
|
||
<div><a class="reference internal image-reference" href="../_images/variant-analysis-repo-lists.png"><img alt="Screenshot of the CodeQL extension in Visual Studio Code. The "Variant Analysis Repositories" section is expanded. The "Top 10 repositories" item has a checkmark to show that it is currently selected for analysis. The user has clicked on the row for a single repository "octo-org/octo-repo" and it is highlighted blue. The "Select" button for that row is highlighted with a dark orange highlight." src="../_images/variant-analysis-repo-lists.png" style="width: 350px;" /></a>
|
||
</div></blockquote>
|
||
</li>
|
||
<li><p>Open the query you want to run, right-click in the query file, and select <strong>CodeQL: Run Variant Analysis</strong> to start variant analysis.</p></li>
|
||
</ol>
|
||
<p>The CodeQL extension builds a CodeQL pack with your library and any library dependencies. The CodeQL pack and your selected repository list are posted to an API endpoint on GitHub.com which triggers a GitHub Actions dynamic workflow in your controller repository. The workflow spins up multiple parallel jobs to execute the CodeQL query against the repositories in the list, optimizing query execution. As each repository is analyzed, the results are processed and displayed in a Variant Analysis Results view in Visual Studio Code.</p>
|
||
<blockquote class="pull-quote">
|
||
<div><p>Note</p>
|
||
<p>If you need to cancel the variant analysis run for any reason, click <strong>Stop query</strong> in the Variant Analysis Results view.</p>
|
||
</div></blockquote>
|
||
</section>
|
||
<section id="exploring-your-results">
|
||
<h2>Exploring your results<a class="headerlink" href="#exploring-your-results" title="Link to this heading">¶</a></h2>
|
||
<p>When you run variant analysis, as soon as a workflow to run your analysis on GitHub is running, a Variant Analysis Results view opens to display the results as they are ready. You can use this view to monitor progress, see any errors, and access the workflow logs in your controller repository.</p>
|
||
<img alt="Screenshot of the "Variant Analysis Results" view showing a partially complete run. Analysis of ``angular/angular`` is still running but all other results are displayed. ``facebook/create-react-app`` has three results for this query." src="../_images/variant-analysis-results-view.png" />
|
||
<p>When your variant analysis run is scheduled, the results view automatically opens. Initially the view shows a list of every repository that was scheduled for analysis. As each repository is analyzed, the view is updated to show a summary of the number of results. To view the detailed results for a repository (including results paths), click the repository name.</p>
|
||
<p>For each repository, you can see:</p>
|
||
<ul class="simple">
|
||
<li><p>Number of results found by the query</p></li>
|
||
<li><p>Visibility of the repository</p></li>
|
||
<li><p>Whether analysis is still running (black, moving circle) or finished (green checkmark)</p></li>
|
||
<li><p>Number of stars the repository has on GitHub</p></li>
|
||
</ul>
|
||
<p>To see the results for a repository:</p>
|
||
<img alt="Screenshot of an example result in the "Variant Analysis Results" view. The result has blue links to the source files in GitHub so you can go straight to the repository to fix the problem. There is also a "Show paths" link because this is a data flow query." src="../_images/variant-analysis-result.png" />
|
||
<ol class="arabic simple">
|
||
<li><p>Click the repository name to show a summary of each result.</p></li>
|
||
<li><p>Explore the information available for each result using links to the source files in GitHub.com and, for data flow queries, the <strong>Show paths</strong> link. For more information, see “<a class="reference internal" href="exploring-data-flow-with-path-queries.html#exploring-data-flow-with-path-queries"><span class="std std-ref">Exploring data flow with path queries</span></a>.”</p></li>
|
||
</ol>
|
||
</section>
|
||
<section id="exporting-your-results">
|
||
<h2>Exporting your results<a class="headerlink" href="#exporting-your-results" title="Link to this heading">¶</a></h2>
|
||
<p>You can export your results for further analysis or to discuss them with collaborators. In the results view, click <strong>Export results</strong> to export the results to a secret gist on GitHub.com or to a markdown file in your workspace.</p>
|
||
</section>
|
||
<section id="creating-custom-lists-of-repositories">
|
||
<span id="custom-lists"></span><h2>Creating custom lists of repositories<a class="headerlink" href="#creating-custom-lists-of-repositories" title="Link to this heading">¶</a></h2>
|
||
<p>After you have defined a controller repository, the Variant Analysis Repositories panel shows the lists of repositories that you can select for variant analysis. You can use the options in the panel header to add a specific repository or organization to the panel, and to create and manage custom lists of repositories for variant analysis.</p>
|
||
<blockquote class="pull-quote">
|
||
<div><p>Note</p>
|
||
<p>CodeQL analysis always requires a CodeQL database to run queries against. When you run variant analysis against a list of repositories, your query will only be executed against the repositories that currently have a CodeQL database available to download. The best way to make a repository available for variant analysis is to enable code scanning with CodeQL. For information about enabling code scanning using CodeQL, see “<a class="reference external" href="https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#configuring-code-scanning-automatically">Configuring code scanning automatically</a>.”</p>
|
||
</div></blockquote>
|
||
<section id="selecting-a-single-github-repository-or-organization-for-analysis">
|
||
<h3>Selecting a single GitHub repository or organization for analysis<a class="headerlink" href="#selecting-a-single-github-repository-or-organization-for-analysis" title="Link to this heading">¶</a></h3>
|
||
<ol class="arabic">
|
||
<li><p>In the Variant Analysis Repositories panel, click the <strong>+</strong>, add new database, icon.</p></li>
|
||
<li><p>From the dropdown menu, click <strong>From a GitHub repository</strong> or <strong>All repositories of GitHub org or owner</strong>.</p></li>
|
||
<li><p>Type the identifier of the repository or organization that you want to use into the field.</p>
|
||
<blockquote>
|
||
<div><a class="reference internal image-reference" href="../_images/variant-analysis-repo-and-org.png"><img alt="Screenshot of the CodeQL extension in Visual Studio Code. The "Variant Analysis Repositories" section is expanded to show a repository (octo-org/octo-repo) and an organization (octo-org). These items are highlighted with a dark orange outline." src="../_images/variant-analysis-repo-and-org.png" style="width: 350px;" /></a>
|
||
</div></blockquote>
|
||
</li>
|
||
</ol>
|
||
</section>
|
||
<section id="creating-a-custom-list-of-repositories">
|
||
<h3>Creating a custom list of repositories<a class="headerlink" href="#creating-a-custom-list-of-repositories" title="Link to this heading">¶</a></h3>
|
||
<ol class="arabic simple">
|
||
<li><p>In the Variant Analysis Repositories panel, click the <a class="reference internal" href="../_images/variant-analysis-add-list.png"><img alt="add-list" src="../_images/variant-analysis-add-list.png" style="height: 2ex;" /></a> icon.</p></li>
|
||
<li><p>Type a name for the new list and press <strong>Enter</strong>.</p></li>
|
||
<li><p>Select your list in the panel and then click <strong>+</strong>, to add a repository to your list.</p></li>
|
||
</ol>
|
||
<p>You can manage and edit your custom lists by right-clicking on either the list name, or a repository name within the list, and selecting an option from the context menu.</p>
|
||
<p>The custom lists are stored in your workspace in a <code class="docutils literal notranslate"><span class="pre">databases.json</span></code> file. If you want to edit this file directly, you can open it by clicking <strong>{ }</strong> in the panel header.</p>
|
||
<p>For example, if you want to continue analyzing a set of repositories that had results for your query, click <strong>Copy repository list</strong> in the Variant Analysis Results view to add a list of only the repositories that have results to the clipboard as JSON. For example:</p>
|
||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"new-repo-list"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"repositories"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"facebook/create-react-app"</span>
|
||
<span class="w"> </span><span class="p">]</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>You can then insert the <code class="docutils literal notranslate"><span class="pre">new-repo-list</span></code> of repositories into your list of custom repository lists for easy access in the Variant Analysis Repositories panel.</p>
|
||
</section>
|
||
<section id="using-github-code-search-to-add-repositories-to-a-custom-list">
|
||
<h3>Using GitHub code search to add repositories to a custom list<a class="headerlink" href="#using-github-code-search-to-add-repositories-to-a-custom-list" title="Link to this heading">¶</a></h3>
|
||
<p>You can use code search directly in the CodeQL extension to add a subset of repositories from GitHub.com to a custom list.</p>
|
||
<blockquote class="pull-quote">
|
||
<div><p>Note</p>
|
||
<p>This feature uses the legacy code search via the code search API. For more information on the syntax to use, see “<a class="reference external" href="https://docs.github.com/en/search-github/searching-on-github/searching-code">Searching code (legacy)</a>.”</p>
|
||
</div></blockquote>
|
||
<p>For example, to add all repositories in the <code class="docutils literal notranslate"><span class="pre">rails</span></code> organization on GitHub, you can search <code class="docutils literal notranslate"><span class="pre">org:rails</span></code>.</p>
|
||
<p>You can add a maximum of 1000 repositories to a custom list per search.</p>
|
||
<ol class="arabic">
|
||
<li><p>In the Variant Analysis Repositories panel, choose the list that you want to add repositories to. You can create a new list or choose an existing list that already contains repositories.</p></li>
|
||
<li><p>Right-click on the list you have chosen and then click <strong>Add repositories with GitHub Code Search</strong>.</p></li>
|
||
<li><p>In the pop-up that appears at the top of the application, under the search bar, select a language for your search from the choices in the dropdown.</p>
|
||
<blockquote>
|
||
<div><img alt="Screenshot of the search bar for using code search to add repositories to a custom list. The search bar asks you to choose a language for your search and has a dropdown list of languages to choose from." src="../_images/variant-analysis-code-search-language.png" />
|
||
</div></blockquote>
|
||
</li>
|
||
<li><p>In the search bar, type the search query that you want to use and press <strong>Enter</strong>.</p></li>
|
||
</ol>
|
||
<p>You can view the progress of your search in the bottom right corner of the application in a box with the text “Searching for repositories…”. If you click <strong>Cancel</strong>, no repositories will be added to your list. Once complete, you will see the resulting repositories appear in the dropdown under your custom list in the Variant Analysis Repositories panel.</p>
|
||
<p>Some of the resulting repositories will not have CodeQL databases and some may not allow access by the CodeQL extension for Visual Studio Code. When you run an analysis on the list, the Variant Analysis Results view will show you which repositories were analyzed, which denied access, and which had no CodeQL database.</p>
|
||
</section>
|
||
</section>
|
||
<section id="troubleshooting-variant-analysis">
|
||
<h2>Troubleshooting variant analysis<a class="headerlink" href="#troubleshooting-variant-analysis" title="Link to this heading">¶</a></h2>
|
||
<p>For information on troubleshooting variant analysis, see
|
||
“<a class="reference internal" href="troubleshooting-variant-analysis.html#troubleshooting-variant-analysis"><span class="std std-ref">Troubleshooting variant analysis</span></a>.”</p>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</article>
|
||
|
||
<!-- GitHub footer, with links to terms and privacy statement -->
|
||
<div class="px-3 px-md-6 f6 py-4 d-sm-flex flex-justify-between flex-row-reverse flex-items-center border-top">
|
||
<ul class="list-style-none d-flex flex-items-center mb-3 mb-sm-0 lh-condensed-ultra">
|
||
<li class="mr-3">
|
||
<a href="https://twitter.com/github" title="GitHub on Twitter" style="color: #959da5;">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 273.5 222.3" class="d-block" height="18">
|
||
<path
|
||
d="M273.5 26.3a109.77 109.77 0 0 1-32.2 8.8 56.07 56.07 0 0 0 24.7-31 113.39 113.39 0 0 1-35.7 13.6 56.1 56.1 0 0 0-97 38.4 54 54 0 0 0 1.5 12.8A159.68 159.68 0 0 1 19.1 10.3a56.12 56.12 0 0 0 17.4 74.9 56.06 56.06 0 0 1-25.4-7v.7a56.11 56.11 0 0 0 45 55 55.65 55.65 0 0 1-14.8 2 62.39 62.39 0 0 1-10.6-1 56.24 56.24 0 0 0 52.4 39 112.87 112.87 0 0 1-69.7 24 119 119 0 0 1-13.4-.8 158.83 158.83 0 0 0 86 25.2c103.2 0 159.6-85.5 159.6-159.6 0-2.4-.1-4.9-.2-7.3a114.25 114.25 0 0 0 28.1-29.1"
|
||
fill="currentColor"></path>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li class="mr-3">
|
||
<a href="https://www.facebook.com/GitHub" title="GitHub on Facebook" style="color: #959da5;">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.3 15.4" class="d-block" height="18">
|
||
<path
|
||
d="M14.5 0H.8a.88.88 0 0 0-.8.9v13.6a.88.88 0 0 0 .8.9h7.3v-6h-2V7.1h2V5.4a2.87 2.87 0 0 1 2.5-3.1h.5a10.87 10.87 0 0 1 1.8.1v2.1h-1.3c-1 0-1.1.5-1.1 1.1v1.5h2.3l-.3 2.3h-2v5.9h3.9a.88.88 0 0 0 .9-.8V.8a.86.86 0 0 0-.8-.8z"
|
||
fill="currentColor"></path>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li class="mr-3">
|
||
<a href="https://www.youtube.com/github" title="GitHub on YouTube" style="color: #959da5;">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.17 13.6" class="d-block" height="16">
|
||
<path
|
||
d="M18.77 2.13A2.4 2.4 0 0 0 17.09.42C15.59 0 9.58 0 9.58 0a57.55 57.55 0 0 0-7.5.4A2.49 2.49 0 0 0 .39 2.13 26.27 26.27 0 0 0 0 6.8a26.15 26.15 0 0 0 .39 4.67 2.43 2.43 0 0 0 1.69 1.71c1.52.42 7.5.42 7.5.42a57.69 57.69 0 0 0 7.51-.4 2.4 2.4 0 0 0 1.68-1.71 25.63 25.63 0 0 0 .4-4.67 24 24 0 0 0-.4-4.69zM7.67 9.71V3.89l5 2.91z"
|
||
fill="currentColor"></path>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li class="mr-3 flex-self-start">
|
||
<a href="https://www.linkedin.com/company/github" title="GitHub on Linkedin" style="color: #959da5;">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19 18" class="d-block" height="18">
|
||
<path
|
||
d="M3.94 2A2 2 0 1 1 2 0a2 2 0 0 1 1.94 2zM4 5.48H0V18h4zm6.32 0H6.34V18h3.94v-6.57c0-3.66 4.77-4 4.77 0V18H19v-7.93c0-6.17-7.06-5.94-8.72-2.91z"
|
||
fill="currentColor"></path>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
<li>
|
||
<a href="https://github.com/github" title="GitHub's organization" style="color: #959da5;">
|
||
<svg version="1.1" width="20" height="20" viewBox="0 0 16 16" class="octicon octicon-mark-github"
|
||
aria-hidden="true">
|
||
<path fill-rule="evenodd"
|
||
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z">
|
||
</path>
|
||
</svg>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
<ul class="list-style-none d-flex text-gray">
|
||
<li class="mr-3">©
|
||
<script type="text/javascript">document.write(new Date().getFullYear());</script> GitHub, Inc.</li>
|
||
<li class="mr-3"><a
|
||
href="https://docs.github.com/github/site-policy/github-terms-of-service"
|
||
class="link-gray">Terms </a></li>
|
||
<li><a href="https://docs.github.com/github/site-policy/github-privacy-statement"
|
||
class="link-gray">Privacy </a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
|
||
<script type="text/javascript">
|
||
$(document).ready(function () {
|
||
$(".toggle > *").hide();
|
||
$(".toggle .name").show();
|
||
$(".toggle .name").click(function () {
|
||
$(this).parent().children().not(".name").toggle(400);
|
||
$(this).parent().children(".name").toggleClass("open");
|
||
})
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |