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
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/2-what-is-codeql.md
+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
@@ -38,7 +38,7 @@ There are two built-in query suites for CodeQL:
38
38
*`default`: These are the queries run by default in CodeQL code scanning on GitHub, available with the default setup of code scanning. The queries in this query suite are highly precise and return few false positive code scanning results. Relative to the `security-extended` query suite, the default suite returns fewer low-confidence code scanning results.
39
39
*`security-extended`: This suite contains all of the queries from the `default` suite, plus extra security queries with slightly lower precision and severity. It's available with the default setup of code scanning and is listed as the "Extended" option in the query suites dropdown. Relative to the `default` query suite, this suite may return a greater number of false positive code scanning results.
40
40
41
-
The default setup of code scanning will use the `default` query suite. This can be changed by selecting the overflow icon to view the CodeQL configuration, and then selecting to the edit button. Under "Scan settings," you may choose one of the above two options as the query suite.
41
+
The default setup of code scanning will use the `default` query suite. This can be changed by selecting the overflow icon to view the CodeQL configuration, and then selecting to the edit button. Under "Scan settings," you may choose one of the two options outlined as the query suite.
42
42
43
43
## CodeQL packs
44
44
@@ -47,8 +47,8 @@ CodedQL packs are used to organize the files used in CodeQL analysis so you can
47
47
There are three types of CodeQL packs: query packs, library packs, and model packs.
48
48
49
49
* Query packs are designed to be run. When a query pack is published, the bundle includes all the transitive dependencies and pre-compiled representations of each query, in addition to the query sources. This ensures consistent and efficient execution of the queries in the pack.
50
-
* Library packs are designed to be used by query packs (or other library packs) and do not contain queries themselves. The libraries are not compiled separately.
51
-
* Model packs can be used to expand code scanning analysis to include dependencies that are not supported by default. Model packs are currently in beta and subject to change. During the beta, model packs are available for Java analysis at the repository level. For more information about creating your own model packs, see "Creating a CodeQL model pack."
50
+
* Library packs are designed to be used by query packs (or other library packs) and don't contain queries themselves. The libraries aren't compiled separately.
51
+
* Model packs can be used to expand code scanning analysis to include dependencies that aren't supported by default. Model packs are currently in beta and subject to change. During the beta, model packs are available for Java analysis at the repository level. For more information about creating your own model packs, see "Creating a CodeQL model pack."
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/3-how-does-codeql-analyze-code.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ For compiled languages, extraction works by monitoring the normal build process.
16
16
17
17
For interpreted languages, the extractor runs directly on the source code, resolving dependencies to give an accurate representation of the codebase.
18
18
19
-
There is one extractor for each language supported by CodeQL to ensure that the extraction process is as accurate as possible. For multi-language codebases, databases are generated one language at a time.
19
+
There's one extractor for each language supported by CodeQL to ensure that the extraction process is as accurate as possible. For multi-language codebases, databases are generated one language at a time.
20
20
21
21
After extraction, all the data required for analysis (relational data, copied source files, and a language-specific database schema that specifies the mutual relations in the data) is imported into a single directory, known as a CodeQL database.
22
22
@@ -32,6 +32,6 @@ The final step converts results produced during query execution into a form that
32
32
33
33
:::image type="content" source="../media/codeql-query-results.png" alt-text="Screenshot of CodeQL query results.":::
34
34
35
-
Queries contain metadata properties that indicate how the results should be interpreted. For instance, some queries display a simple message at a single location in the code. Others display a series of locations that represent steps along a data-flow or control-flow path, along with a message explaining the significance of the result. Queries that don't have metadata are not interpreted; their results are output as a table and not displayed in the source code.
35
+
Queries contain metadata properties that indicate how the results should be interpreted. For instance, some queries display a simple message at a single location in the code. Others display a series of locations that represent steps along a data-flow or control-flow path, along with a message explaining the significance of the result. Queries that don't have metadata aren't interpreted; their results are output as a table and not displayed in the source code.
36
36
37
37
Following interpretation, results are output for code review and triaging. In CodeQL for Visual Studio Code, interpreted query results are automatically displayed in the source code. You can output results generated by the CodeQL CLI into a number of different formats for use with different tools.
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/4-what-is-ql.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ The syntax of QL is similar to SQL. However, the semantics of QL are based on Da
17
17
1. Find a descendant of the given person; that is, a child or a descendant of a child.
18
18
2. Count the number of descendants found using the previous step.
19
19
20
-
When you write this process in QL, it closely resembles the above structure. Notice that the example used recursion to find all descendants of the given person, and an aggregate to count the number of descendants. Translating these steps into the final query without adding any procedural details is possible due to the declarative nature of the language. The QL code would look something like this:
20
+
When you write this process in QL, it closely resembles this described structure. Notice that the example used recursion to find all descendants of the given person, and an aggregate to count the number of descendants. Translating these steps into the final query without adding any procedural details is possible due to the declarative nature of the language. The QL code would look something like this:
21
21
22
22
```ql
23
23
Person getADescendant(Person p) {
@@ -38,7 +38,7 @@ Object orientation is an important feature of QL. The benefits of object orienta
38
38
39
39
Here are a few prominent conceptual and functional differences between general purpose programming languages and QL:
40
40
41
-
* QL does not have any imperative features such as assignments to variables or file system operations.
41
+
* QL doesn't have any imperative features such as assignments to variables or file system operations.
42
42
* QL operates on sets of tuples, and a query can be viewed as a complex sequence of set operations that defines the result of the query.
43
43
* QL's set-based semantics makes it very natural to process collections of values without having to worry about efficiently storing, indexing, and traversing them.
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/6-customize-your-scanning-workflow-with-codeql.md
+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
@@ -29,7 +29,7 @@ We don't recommend referencing query suites directly from the `github/codeql` re
29
29
30
30
To add one or more CodeQL query packs (beta), add a `with: packs:` entry within the `uses: github/codeql-action/init@v1` section of the workflow. Within packs, you can specify one or more packages to use and, optionally, which version to download. Where you don't specify a version, the latest version is downloaded. If you want to use packages that aren't publicly available, you need to set the `GITHUB_TOKEN` environment variable to a secret that has access to the packages.
31
31
32
-
In the following example, scope is the organization or personal account that published the package. When the workflow runs, the three CodeQL query packs download from GitHub and the default queries or query suite for each pack run. In the below example, each of the packs in the list will download based on their specifications:
32
+
In the following example, scope is the organization or personal account that published the package. When the workflow runs, the three CodeQL query packs download from GitHub and the default queries or query suite for each pack run. In the following example, each of the packs in the list will download based on their specifications:
33
33
* The latest version of `pack1` is downloaded, and all default queries are run.
34
34
* Version 1.2.3 of `pack2` is downloaded, and all default queries are run.
35
35
* The latest version of `pack3` that is compatible with version 3.2.1 is downloaded, and all queries are run.
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/8-customize-your-scanning-workflow-with-codeql-2.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,10 +110,10 @@ If you only want to run custom queries, you can disable the default security que
110
110
You can add `exclude` and `include` filters to your custom configuration file, to specify the queries you want to exclude or include in the analysis, such as:
111
111
112
112
* Specific queries from the default suites (`security`, `security-extended` and `security-and-quality`).
113
-
* Specific queries whose results do not interest you.
113
+
* Specific queries whose results don't interest you.
114
114
* All the queries that generate warnings and recommendations.
115
115
116
-
You can use `exclude` filters similar to those in the configuration the following file to exclude queries that you want to remove from the default analysis. In the example of configuration file below, both the `js/redundant-assignment` and the `js/useless-assignment-to-local` queries are excluded from analysis.
116
+
You can use `exclude` filters similar to those in the configuration the following file to exclude queries that you want to remove from the default analysis. In the example of a configuration file that follows, both the `js/redundant-assignment` and the `js/useless-assignment-to-local` queries are excluded from analysis.
117
117
118
118
```yml
119
119
query-filters:
@@ -143,9 +143,9 @@ paths-ignore:
143
143
```
144
144
145
145
> [!NOTE]
146
-
> * The `paths` and `paths-ignore` keywords, used in the context of the code scanning configuration file, should not be confused with the same keywords when used for `on.<push|pull_request>.paths` in a workflow. When they're used to modify `on.<push|pull_request>` in a workflow, they determine whether the actions will be run when someone modifies code in the specified directories.
146
+
> * The `paths` and `paths-ignore` keywords, used in the context of the code scanning configuration file, shouldn't be confused with the same keywords when used for `on.<push|pull_request>.paths` in a workflow. When they're used to modify `on.<push|pull_request>` in a workflow, they determine whether the actions will be run when someone modifies code in the specified directories.
147
147
> * The filter pattern characters `?`, `+`, `[`, `]`, and `!` aren't supported and will be matched literally.
148
-
> * `**` characters can only be at the start or end of a line, or surrounded by slashes, and you can't mix `**` and other characters. For example: `foo/**`, `**/foo`, and `foo/**/bar` are all allowed syntax, but `**foo` isn't. However ,you can use single stars along with other characters, as shown in the example. You'll need to quote anything that contains a `*` character.
148
+
> * `**` characters can only be at the start or end of a line, or surrounded by slashes, and you can't mix `**` and other characters. For example: `foo/**`, `**/foo`, and `foo/**/bar` are all allowed syntax, but `**foo` isn't. However, you can use single stars along with other characters, as shown in the example. You'll need to quote anything that contains a `*` character.
149
149
150
150
For compiled languages, if you want to limit code scanning to specific directories in your project, you must specify appropriate build steps in the workflow. The commands you need to use to exclude a directory from the build will depend on your build system.
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/includes/9-use-codeql-cli.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,9 +48,9 @@ The full list of parameters for the `database create` command is shown in the fo
48
48
|---|---|
49
49
|`<database>`| Specify the name and location of a directory to create for the CodeQL database. The command will fail if you try to overwrite an existing directory. If you also specify `--db-cluster`, this is the parent directory, and a subdirectory is created for each language analyzed. |
50
50
|`--language`| Specify the identifier for the language to create a database for one of `cpp`, `csharp`, `go`, `java`, `javascript`, `python`, and `ruby` (use JavaScript to analyze TypeScript code). When used with `--db-cluster`, the option accepts a comma-separated list, or can be specified more than once. |
51
-
|`--command`| Recommended. Use to specify the build command or script that invokes the build process for the codebase. Commands are run from the current folder or, where it is defined, from `--source-root`. Not needed for Python and JavaScript/TypeScript analysis. |
51
+
|`--command`| Recommended. Use to specify the build command or script that invokes the build process for the codebase. Commands are run from the current folder or, where it's defined, from `--source-root`. Not needed for Python and JavaScript/TypeScript analysis. |
52
52
| `--db-cluster` | Optional. Use in multi-language codebases to generate one database for each language specified by `--language`.|
53
-
|`--no-run-unnecessary-builds`| Recommended. Use to suppress the build commandfor languages where the CodeQL CLI does not need to monitor the build (for example, Python and JavaScript/TypeScript).|
53
+
| `--no-run-unnecessary-builds` | Recommended. Use to suppress the build command for languages where the CodeQL CLI doesn't need to monitor the build (for example, Python and JavaScript/TypeScript).|
54
54
|`--source-root`| Optional. Use if you run the CLI outside the checkout root of the repository. By default, the database create command assumes that the current directory is the root directory for the source files; use this option to specify a different location.|
SARIF upload supports a maximum of 25,000 results per upload. However, only the top 5,000 results will be displayed, prioritized by severity. If a tool generates too many results, you should update the configuration to focus on results for the most important rules or queries.
159
+
SARIF upload supports a maximum of 25,000 results per upload. However, only the top 5,000 results are displayed, prioritized by severity. If a tool generates too many results, you should update the configuration to focus on results for the most important rules or queries.
160
160
161
-
For each upload, SARIF upload supports a maximum size of 10 MB for the gzip-compressed SARIF file. Any uploads over this limit will be rejected. If your SARIF file is too large because it contains too many results, you should update the configuration to focus on results for the most important rules or queries. For more information on limitations and validating SARIF files see the documentation<sup>[6]</sup>.
161
+
For each upload, SARIF upload supports a maximum size of 10 MB for the gzip-compressed SARIF file. Any uploads over this limit will be rejected. If your SARIF file is too large because it contains too many results, you should update the configuration to focus on results for the most important rules or queries. For more information on limitations and validating SARIF files, see the documentation<sup>[6]</sup>.
162
162
163
163
Before you can upload results to GitHub, you must determine the best way to pass the GitHub App or personal access token you created earlier to the CodeQL CLI. We recommend that you review your CI system's guidance on the secure use of a secret store. The CodeQL CLI supports:
Copy file name to clipboardExpand all lines: learn-pr/github/code-scanning-with-github-codeql/knowledge-check.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,10 @@ quiz:
40
40
choices:
41
41
- content: "Scheduled events are more difficult to configure than triggered events."
42
42
isCorrect: false
43
-
explanation: "Incorrect. Scheduled events are not more difficult to configure than triggered events. Both can be configured easily. "
43
+
explanation: "Incorrect. Scheduled events aren't more difficult to configure than triggered events. Both can be configured easily. "
44
44
- content: "Scheduled events run based on a specified schedule and triggered events run on code events such a push. "
45
45
isCorrect: true
46
-
explanation: "Correct. Scheduled events are specified by the developer and triggered events are set by default but can also be configured by the developer."
46
+
explanation: "Correct. The developer specifies scheduled events and triggered events are set by default but can also be developer configured."
47
47
- content: "Triggered events run less frequently than scheduled events."
48
48
isCorrect: false
49
49
explanation: "Incorrect. The frequency of both triggered events and scheduled events varies depending on how often pushes and pull requests occur, as well as how the developer may have configured the frequency."
0 commit comments