From 18acec3172816ea331c727e4a56fca444279d558 Mon Sep 17 00:00:00 2001 From: Felicity Chapman <1877141+felicitymay@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:39:46 +0000 Subject: [PATCH] Use Copilot to update scripts to add quality query tables (#58621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anne-Marie <102995847+am-stead@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: docs-bot <77750099+docs-bot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Óscar San José --- .../generate-code-scanning-query-lists.yml | 136 ++++++-- .../reference/codeql-detection.md | 30 +- .../codeql-queries/csharp-queries.md | 20 ++ .../reference/codeql-queries/go-queries.md | 19 ++ .../reference/codeql-queries/index.md | 17 + .../reference/codeql-queries/java-queries.md | 20 ++ .../codeql-queries/javascript-queries.md | 20 ++ .../codeql-queries/python-queries.md | 20 ++ .../reference/codeql-queries/ruby-queries.md | 20 ++ .../code-quality/reference/index.md | 1 + .../code-quality/codeql-detection-intro.md | 6 + .../codeql-query-tables/csharp.md | 77 +++++ .../code-quality/codeql-query-tables/go.md | 28 ++ .../code-quality/codeql-query-tables/java.md | 95 ++++++ .../codeql-query-tables/javascript.md | 104 +++++++ .../codeql-query-tables/python.md | 107 +++++++ .../code-quality/codeql-query-tables/ruby.md | 9 + .../code-quality/codeql-query-tables/rust.md | 0 eslint.config.ts | 4 +- package.json | 3 +- src/code-scanning/README.md | 64 ---- src/code-scanning/scripts/tsconfig.json | 5 - src/codeql-queries/README.md | 88 ++++++ .../generate-code-quality-query-list.ts | 291 ++++++++++++++++++ .../generate-code-scanning-query-list.ts | 3 +- src/codeql-queries/scripts/tsconfig.json | 5 + tsconfig.json | 3 +- 27 files changed, 1098 insertions(+), 97 deletions(-) create mode 100644 content/code-security/code-quality/reference/codeql-queries/csharp-queries.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/go-queries.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/index.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/java-queries.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/javascript-queries.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/python-queries.md create mode 100644 content/code-security/code-quality/reference/codeql-queries/ruby-queries.md create mode 100644 data/reusables/code-quality/codeql-detection-intro.md create mode 100644 data/reusables/code-quality/codeql-query-tables/csharp.md create mode 100644 data/reusables/code-quality/codeql-query-tables/go.md create mode 100644 data/reusables/code-quality/codeql-query-tables/java.md create mode 100644 data/reusables/code-quality/codeql-query-tables/javascript.md create mode 100644 data/reusables/code-quality/codeql-query-tables/python.md create mode 100644 data/reusables/code-quality/codeql-query-tables/ruby.md create mode 100644 data/reusables/code-quality/codeql-query-tables/rust.md delete mode 100644 src/code-scanning/README.md delete mode 100644 src/code-scanning/scripts/tsconfig.json create mode 100644 src/codeql-queries/README.md create mode 100644 src/codeql-queries/scripts/generate-code-quality-query-list.ts rename src/{code-scanning => codeql-queries}/scripts/generate-code-scanning-query-list.ts (98%) create mode 100644 src/codeql-queries/scripts/tsconfig.json diff --git a/.github/workflows/generate-code-scanning-query-lists.yml b/.github/workflows/generate-code-scanning-query-lists.yml index bf4aa979fc..1da11640e0 100644 --- a/.github/workflows/generate-code-scanning-query-lists.yml +++ b/.github/workflows/generate-code-scanning-query-lists.yml @@ -19,7 +19,8 @@ on: pull_request: paths: - .github/workflows/generate-code-scanning-query-lists.yml - - src/code-scanning/scripts/generate-code-scanning-query-list.ts + - src/codeql-queries/scripts/generate-code-scanning-query-list.ts + - src/codeql-queries/scripts/generate-code-quality-query-list.ts - .github/actions/install-cocofix/action.yml permissions: @@ -27,7 +28,7 @@ permissions: pull-requests: write jobs: - generate-query-lists: + generate-security-query-lists: if: github.repository == 'github/docs-internal' runs-on: ubuntu-latest steps: @@ -45,6 +46,7 @@ jobs: - name: Get the codeql SHA being synced id: codeql + shell: bash run: | cd codeql OPENAPI_COMMIT_SHA=$(git rev-parse HEAD) @@ -56,12 +58,14 @@ jobs: uses: ./codeql/.github/actions/fetch-codeql - name: Test CodeQL CLI Download + shell: bash run: codeql --version # "Server for running multiple commands while avoiding repeated JVM initialization." # Having started this should speed up the execution of the various # CLI calls of the executable. - name: Start CodeQL CLI server in the background + shell: bash run: | codeql execute cli-server & sleep 3 @@ -71,21 +75,8 @@ jobs: with: token: ${{ secrets.DOCS_BOT_PAT_BASE }} - - name: Lint the code (eslint) - if: ${{ github.event_name == 'pull_request' }} - env: - PATH: '$PATH:${{ github.workspace }}/node_modules/.bin' - run: | - eslint --no-ignore src/code-scanning/scripts/generate-code-scanning-query-list.ts - - - name: Lint the code (tsc) - if: ${{ github.event_name == 'pull_request' }} - env: - PATH: '$PATH:${{ github.workspace }}/node_modules/.bin' - run: | - tsc --noEmit --project src/code-scanning/scripts/tsconfig.json - - - name: Build code scanning query list + - name: Build code scanning security query lists + shell: bash run: | for lang in "actions" "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "rust" "swift"; do echo "Generating code scanning query list for $lang" @@ -97,7 +88,112 @@ jobs: $lang done + - name: Upload security query lists + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: security-query-lists + path: data/reusables/code-scanning/codeql-query-tables/ + + generate-quality-query-lists: + if: github.repository == 'github/docs-internal' + runs-on: ubuntu-latest + steps: + - name: Checkout repository code + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - uses: ./.github/actions/node-npm-setup + + - name: Checkout codeql repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + repository: github/codeql + path: codeql + ref: ${{ inputs.SOURCE_BRANCH || 'main' }} + + - name: Get the codeql SHA being synced + id: codeql + shell: bash + run: | + cd codeql + OPENAPI_COMMIT_SHA=$(git rev-parse HEAD) + echo "OPENAPI_COMMIT_SHA=$OPENAPI_COMMIT_SHA" >> $GITHUB_OUTPUT + echo "Copied files from github/codeql repo. Commit SHA: $OPENAPI_COMMIT_SHA" + + - name: Download CodeQL CLI + # Look under the `codeql` directory, as this is where we checked out the `github/codeql` repo + uses: ./codeql/.github/actions/fetch-codeql + + - name: Test CodeQL CLI Download + shell: bash + run: codeql --version + + # "Server for running multiple commands while avoiding repeated JVM initialization." + # Having started this should speed up the execution of the various + # CLI calls of the executable. + - name: Start CodeQL CLI server in the background + shell: bash + run: | + codeql execute cli-server & + sleep 3 + codeql --version + + - name: Build code quality query lists + shell: bash + run: | + for lang in "csharp" "go" "java" "javascript" "python" "ruby"; do + echo "Generating code quality query list for $lang" + npm run generate-code-quality-query-list -- \ + --verbose \ + --codeql-path codeql \ + --codeql-dir codeql \ + -o data/reusables/code-quality/codeql-query-tables/$lang.md \ + $lang + done + + - name: Upload quality query lists + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: quality-query-lists + path: data/reusables/code-quality/codeql-query-tables/ + + create-pull-request: + if: github.repository == 'github/docs-internal' + runs-on: ubuntu-latest + needs: [generate-security-query-lists, generate-quality-query-lists] + steps: + - name: Checkout repository code + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Checkout codeql repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + repository: github/codeql + path: codeql + ref: ${{ inputs.SOURCE_BRANCH || 'main' }} + + - name: Get the codeql SHA being synced + id: codeql + shell: bash + run: | + cd codeql + OPENAPI_COMMIT_SHA=$(git rev-parse HEAD) + echo "OPENAPI_COMMIT_SHA=$OPENAPI_COMMIT_SHA" >> $GITHUB_OUTPUT + echo "Copied files from github/codeql repo. Commit SHA: $OPENAPI_COMMIT_SHA" + + - name: Download security query lists + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: security-query-lists + path: data/reusables/code-scanning/codeql-query-tables/ + + - name: Download quality query lists + uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: quality-query-lists + path: data/reusables/code-quality/codeql-query-tables/ + - name: Insight into diff + shell: bash run: | git diff @@ -105,6 +201,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }} DRY_RUN: ${{ github.event_name == 'pull_request'}} + shell: bash run: | # When we started, we downloaded the CodeQL CLI here in this workflow. @@ -145,6 +242,7 @@ jobs: fi git add data/reusables/code-scanning/codeql-query-tables + git add data/reusables/code-quality/codeql-query-tables git commit -m "Update CodeQL query tables" git push -u origin $branchname @@ -157,6 +255,6 @@ jobs: No action is required from the first responder for the Docs content team. This PR is automatically added to the Docs content review board. Any writer can review this by checking that the PR looks sensible. If CI does not pass or other problems arise, contact #docs-engineering on slack. - - + + When the DRI for the CodeQL CLI release is ready to publish, they will ask us to merge this PR in #docs-content.' diff --git a/content/code-security/code-quality/reference/codeql-detection.md b/content/code-security/code-quality/reference/codeql-detection.md index a96d3d27e3..96158faa60 100644 --- a/content/code-security/code-quality/reference/codeql-detection.md +++ b/content/code-security/code-quality/reference/codeql-detection.md @@ -1,6 +1,7 @@ --- -title: CodeQL detection of code quality problems -shortTitle: CodeQL detection +title: CodeQL-powered analysis for Code Quality +shortTitle: CodeQL analysis +allowTitleToDifferFromFilename: true intro: 'Information on how CodeQL-powered analysis for {% data variables.product.prodname_code_quality_short %} works, the workflow used, and the status checks reported on pull requests.' versions: feature: code-quality @@ -11,11 +12,30 @@ contentType: reference {% data reusables.code-quality.code-quality-preview-note %} -## {% data variables.product.prodname_codeql %} detection +## {% data variables.product.prodname_codeql %}-powered analysis -{% data variables.product.prodname_code_quality_short %} performs rule-based analysis of pull requests and your default branch using {% data variables.product.prodname_codeql %}. Each rule is written as a query in {% data variables.product.prodname_codeql %} and then run using {% data variables.product.prodname_actions %}. +{% data variables.product.prodname_code_quality_short %} uses {% data variables.product.prodname_codeql %} to perform rule-based analysis of pull requests and your default branch. -The rules are continually refined by both {% data variables.product.github %} and open source developers. See [https://github.com/github/codeql](https://github.com/github/codeql). +* Findings for your **default branch** appear under the "{% data variables.code-quality.all_findings %}" dashboard under your repository's Security tab. + +* Findings **on pull requests** appear as comments made by `{% data variables.code-quality.pr_commenter %}`. + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +### Query lists for supported languages + +Each {% data variables.product.prodname_code_quality_short %} rule is written as a query in {% data variables.product.prodname_codeql %} and then run using {% data variables.product.prodname_actions %}. + +The rules are continually refined by both {% data variables.product.github %} and open source developers. + +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/csharp-queries) +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/go-queries) +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/java-queries) +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/javascript-queries) +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/python-queries) +* [AUTOTITLE](/code-security/code-quality/reference/codeql-queries/ruby-queries) + +For more information about the {% data variables.product.prodname_codeql %} project, see [https://codeql.github.com/](https://codeql.github.com/). ## Workflow used for code quality analysis diff --git a/content/code-security/code-quality/reference/codeql-queries/csharp-queries.md b/content/code-security/code-quality/reference/codeql-queries/csharp-queries.md new file mode 100644 index 0000000000..386f44e61b --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/csharp-queries.md @@ -0,0 +1,20 @@ +--- +title: C# CodeQL queries for Code Quality +shortTitle: C# queries +allowTitleToDifferFromFilename: true +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in C#.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze C# code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.csharp %} \ No newline at end of file diff --git a/content/code-security/code-quality/reference/codeql-queries/go-queries.md b/content/code-security/code-quality/reference/codeql-queries/go-queries.md new file mode 100644 index 0000000000..fd142d09ab --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/go-queries.md @@ -0,0 +1,19 @@ +--- +title: Go CodeQL queries for Code Quality +shortTitle: Go queries +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in Go.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze Go code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.go %} \ No newline at end of file diff --git a/content/code-security/code-quality/reference/codeql-queries/index.md b/content/code-security/code-quality/reference/codeql-queries/index.md new file mode 100644 index 0000000000..87e6de910b --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/index.md @@ -0,0 +1,17 @@ +--- +title: Queries for CodeQL detection +shortTitle: CodeQL queries +intro: 'Explore the {% data variables.product.prodname_codeql %} queries that {% data variables.product.prodname_code_quality_short %} uses to detect code quality issues in supported languages.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +children: + - csharp-queries + - go-queries + - java-queries + - javascript-queries + - python-queries + - ruby-queries +--- \ No newline at end of file diff --git a/content/code-security/code-quality/reference/codeql-queries/java-queries.md b/content/code-security/code-quality/reference/codeql-queries/java-queries.md new file mode 100644 index 0000000000..d0fe33c5d2 --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/java-queries.md @@ -0,0 +1,20 @@ +--- +title: Java CodeQL queries for Code Quality +shortTitle: Java queries +allowTitleToDifferFromFilename: true +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in Java.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze Java code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.java %} diff --git a/content/code-security/code-quality/reference/codeql-queries/javascript-queries.md b/content/code-security/code-quality/reference/codeql-queries/javascript-queries.md new file mode 100644 index 0000000000..1ca4e49cdd --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/javascript-queries.md @@ -0,0 +1,20 @@ +--- +title: JavaScript CodeQL queries for Code Quality +shortTitle: JavaScript queries +allowTitleToDifferFromFilename: true +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in JavaScript.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze JavaScript code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.javascript %} diff --git a/content/code-security/code-quality/reference/codeql-queries/python-queries.md b/content/code-security/code-quality/reference/codeql-queries/python-queries.md new file mode 100644 index 0000000000..24784bf558 --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/python-queries.md @@ -0,0 +1,20 @@ +--- +title: Python CodeQL queries for Code Quality +shortTitle: Python queries +allowTitleToDifferFromFilename: true +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in Python.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze Python code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.python %} diff --git a/content/code-security/code-quality/reference/codeql-queries/ruby-queries.md b/content/code-security/code-quality/reference/codeql-queries/ruby-queries.md new file mode 100644 index 0000000000..79417da340 --- /dev/null +++ b/content/code-security/code-quality/reference/codeql-queries/ruby-queries.md @@ -0,0 +1,20 @@ +--- +title: Ruby CodeQL queries for Code Quality +shortTitle: Ruby queries +allowTitleToDifferFromFilename: true +intro: 'Explore the queries that {% data variables.product.prodname_codeql %} uses to analyze code quality for code written in Ruby.' +versions: + feature: code-quality +topics: + - Code Quality +contentType: reference +--- + +{% data variables.product.prodname_code_quality_short %} uses the following {% data variables.product.prodname_codeql %} queries to analyze Ruby code and detect code quality issues on: + +* Your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* **Pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. + +{% data reusables.code-quality.codeql-query-tables.ruby %} diff --git a/content/code-security/code-quality/reference/index.md b/content/code-security/code-quality/reference/index.md index 643f83e7bc..188d0f76f4 100644 --- a/content/code-security/code-quality/reference/index.md +++ b/content/code-security/code-quality/reference/index.md @@ -10,4 +10,5 @@ contentType: reference children: - metrics-and-ratings - codeql-detection + - codeql-queries --- diff --git a/data/reusables/code-quality/codeql-detection-intro.md b/data/reusables/code-quality/codeql-detection-intro.md new file mode 100644 index 0000000000..4e50b8a4ec --- /dev/null +++ b/data/reusables/code-quality/codeql-detection-intro.md @@ -0,0 +1,6 @@ +{% data variables.product.prodname_code_quality_short %} uses {% data variables.product.prodname_codeql %} analysis to detect code quality issues: + +* On your **default branch**, with results shown on the repository's "{% data variables.code-quality.all_findings %}" dashboard +* In **pull requests**, with findings shown as comments made by `{% data variables.code-quality.pr_commenter %}` + +{% data variables.copilot.copilot_autofix_short %} suggestions are provided for findings where possible. diff --git a/data/reusables/code-quality/codeql-query-tables/csharp.md b/data/reusables/code-quality/codeql-query-tables/csharp.md new file mode 100644 index 0000000000..7747570114 --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/csharp.md @@ -0,0 +1,77 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| [Block code with a single Response.Write()](https://codeql.github.com/codeql-query-help/csharp/cs-asp-response-write/) | Maintainability | Recommendation | +| [Call to obsolete method](https://codeql.github.com/codeql-query-help/csharp/cs-call-to-obsolete-method/) | Maintainability | Warning | +| [Class has same name as super class](https://codeql.github.com/codeql-query-help/csharp/cs-class-name-matches-base-class/) | Maintainability | Recommendation | +| [Class implements ICloneable](https://codeql.github.com/codeql-query-help/csharp/cs-class-implements-icloneable/) | Maintainability | Recommendation | +| [Constant condition](https://codeql.github.com/codeql-query-help/csharp/cs-constant-condition/) | Maintainability | Warning | +| [Container contents are never accessed](https://codeql.github.com/codeql-query-help/csharp/cs-unused-collection/) | Maintainability | Error | +| [Field masks field in super class](https://codeql.github.com/codeql-query-help/csharp/cs-field-masks-base-field/) | Maintainability | Warning | +| [Futile conditional](https://codeql.github.com/codeql-query-help/csharp/cs-useless-if-statement/) | Maintainability | Warning | +| [Local scope variable shadows member](https://codeql.github.com/codeql-query-help/csharp/cs-local-shadows-member/) | Maintainability | Recommendation | +| [Missed 'readonly' opportunity](https://codeql.github.com/codeql-query-help/csharp/cs-missed-readonly-modifier/) | Maintainability | Recommendation | +| [Missed 'using' opportunity](https://codeql.github.com/codeql-query-help/csharp/cs-missed-using-statement/) | Maintainability | Recommendation | +| [Missed opportunity to use All](https://codeql.github.com/codeql-query-help/csharp/cs-linq-missed-all/) | Maintainability | Recommendation | +| [Missed opportunity to use Cast](https://codeql.github.com/codeql-query-help/csharp/cs-linq-missed-cast/) | Maintainability | Recommendation | +| [Missed opportunity to use OfType](https://codeql.github.com/codeql-query-help/csharp/cs-linq-missed-oftype/) | Maintainability | Recommendation | +| [Missed opportunity to use Select](https://codeql.github.com/codeql-query-help/csharp/cs-linq-missed-select/) | Maintainability | Recommendation | +| [Missed opportunity to use Where](https://codeql.github.com/codeql-query-help/csharp/cs-linq-missed-where/) | Maintainability | Recommendation | +| [Missed ternary opportunity](https://codeql.github.com/codeql-query-help/csharp/cs-missed-ternary-operator/) | Maintainability | Recommendation | +| [Nested 'if' statements can be combined](https://codeql.github.com/codeql-query-help/csharp/cs-nested-if-statements/) | Maintainability | Recommendation | +| [Redundant Select](https://codeql.github.com/codeql-query-help/csharp/cs-linq-useless-select/) | Maintainability | Warning | +| [Redundant ToString() call](https://codeql.github.com/codeql-query-help/csharp/cs-useless-tostring-call/) | Maintainability | Recommendation | +| [Static field written by instance method](https://codeql.github.com/codeql-query-help/csharp/cs-static-field-written-by-instance/) | Maintainability | Recommendation | +| [Unnecessarily complex Boolean expression](https://codeql.github.com/codeql-query-help/csharp/cs-simplifiable-boolean-expression/) | Maintainability | Recommendation | +| [Unused label](https://codeql.github.com/codeql-query-help/csharp/cs-unused-label/) | Maintainability | Warning | +| [Useless assignment to local variable](https://codeql.github.com/codeql-query-help/csharp/cs-useless-assignment-to-local/) | Maintainability | Warning | +| [Useless call to GetHashCode()](https://codeql.github.com/codeql-query-help/csharp/cs-useless-gethashcode-call/) | Maintainability | Recommendation | +| [A lock is held during a wait](https://codeql.github.com/codeql-query-help/csharp/cs-locked-wait/) | Reliability | Warning | +| [Call to GC.Collect()](https://codeql.github.com/codeql-query-help/csharp/cs-call-to-gc/) | Reliability | Warning | +| [Call to ReferenceEquals(...) on value type expressions](https://codeql.github.com/codeql-query-help/csharp/cs-reference-equality-on-valuetypes/) | Reliability | Error | +| [Call to System.IO.Path.Combine](https://codeql.github.com/codeql-query-help/csharp/cs-path-combine/) | Reliability | Recommendation | +| [Calls to unmanaged code](https://codeql.github.com/codeql-query-help/csharp/cs-call-to-unmanaged-code/) | Reliability | Recommendation | +| [Cast of 'this' to a type parameter](https://codeql.github.com/codeql-query-help/csharp/cs-cast-of-this-to-type-parameter/) | Reliability | Recommendation | +| [Character passed to StringBuilder constructor](https://codeql.github.com/codeql-query-help/csharp/cs-stringbuilder-initialized-with-character/) | Reliability | Error | +| [Comparison is constant](https://codeql.github.com/codeql-query-help/csharp/cs-constant-comparison/) | Reliability | Warning | +| [Comparison of identical values](https://codeql.github.com/codeql-query-help/csharp/cs-comparison-of-identical-expressions/) | Reliability | Warning | +| [Container contents are never initialized](https://codeql.github.com/codeql-query-help/csharp/cs-empty-collection/) | Reliability | Error | +| [Container size compared to zero](https://codeql.github.com/codeql-query-help/csharp/cs-test-for-negative-container-size/) | Reliability | Warning | +| [Dereferenced variable is always null](https://codeql.github.com/codeql-query-help/csharp/cs-dereferenced-value-is-always-null/) | Reliability | Error | +| [Dereferenced variable may be null](https://codeql.github.com/codeql-query-help/csharp/cs-dereferenced-value-may-be-null/) | Reliability | Warning | +| [Dubious downcast of 'this'](https://codeql.github.com/codeql-query-help/csharp/cs-downcast-of-this/) | Reliability | Warning | +| [Dubious type test of 'this'](https://codeql.github.com/codeql-query-help/csharp/cs-type-test-of-this/) | Reliability | Warning | +| [Empty branch of conditional, or empty loop body](https://codeql.github.com/codeql-query-help/csharp/cs-empty-block/) | Reliability | Warning | +| [Empty lock statement](https://codeql.github.com/codeql-query-help/csharp/cs-empty-lock-statement/) | Reliability | Warning | +| [Equality check on floating point values](https://codeql.github.com/codeql-query-help/csharp/cs-equality-on-floats/) | Reliability | Warning | +| [Equals on collections](https://codeql.github.com/codeql-query-help/csharp/cs-equals-on-arrays/) | Reliability | Recommendation | +| [Equals on incomparable types](https://codeql.github.com/codeql-query-help/csharp/cs-equals-on-unrelated-types/) | Reliability | Error | +| [Exposing internal representation](https://codeql.github.com/codeql-query-help/csharp/cs-expose-implementation/) | Reliability | Recommendation | +| [Futile synchronization on field](https://codeql.github.com/codeql-query-help/csharp/cs-unsafe-sync-on-field/) | Reliability | Error | +| [Generic catch clause](https://codeql.github.com/codeql-query-help/csharp/cs-catch-of-all-exceptions/) | Reliability | Recommendation | +| [Hashed value without GetHashCode definition](https://codeql.github.com/codeql-query-help/csharp/cs-gethashcode-is-not-defined/) | Reliability | Warning | +| [Impossible array cast](https://codeql.github.com/codeql-query-help/csharp/cs-impossible-array-cast/) | Reliability | Error | +| [Inconsistent lock sequence](https://codeql.github.com/codeql-query-help/csharp/cs-inconsistent-lock-sequence/) | Reliability | Error | +| [Inefficient use of ContainsKey](https://codeql.github.com/codeql-query-help/csharp/cs-inefficient-containskey/) | Reliability | Recommendation | +| [Invalid string formatting](https://codeql.github.com/codeql-query-help/csharp/cs-invalid-string-formatting/) | Reliability | Error | +| [Locking the 'this' object in a lock statement](https://codeql.github.com/codeql-query-help/csharp/cs-lock-this/) | Reliability | Warning | +| [Missing Dispose call on local IDisposable](https://codeql.github.com/codeql-query-help/csharp/cs-local-not-disposed/) | Reliability | Warning | +| [Nested loops with same variable](https://codeql.github.com/codeql-query-help/csharp/cs-nested-loops-with-same-variable/) | Reliability | Warning | +| [Null argument to Equals(object)](https://codeql.github.com/codeql-query-help/csharp/cs-null-argument-to-equals/) | Reliability | Warning | +| [Off-by-one comparison against container length](https://codeql.github.com/codeql-query-help/csharp/cs-index-out-of-bounds/) | Reliability | Error | +| [Poor error handling: catch of NullReferenceException](https://codeql.github.com/codeql-query-help/csharp/cs-catch-nullreferenceexception/) | Reliability | Warning | +| [Poor error handling: empty catch block](https://codeql.github.com/codeql-query-help/csharp/cs-empty-catch-block/) | Reliability | Recommendation | +| [Possible loss of precision](https://codeql.github.com/codeql-query-help/csharp/cs-loss-of-precision/) | Reliability | Error | +| [Potentially dangerous use of non-short-circuit logic](https://codeql.github.com/codeql-query-help/csharp/cs-non-short-circuit/) | Reliability | Error | +| [Property value is not used when setting a property](https://codeql.github.com/codeql-query-help/csharp/cs-unused-property-value/) | Reliability | Warning | +| [Recursive call to Equals(object)](https://codeql.github.com/codeql-query-help/csharp/cs-recursive-equals-call/) | Reliability | Error | +| [Rethrowing exception variable](https://codeql.github.com/codeql-query-help/csharp/cs-rethrown-exception-variable/) | Reliability | Warning | +| [Self-assignment](https://codeql.github.com/codeql-query-help/csharp/cs-self-assignment/) | Reliability | Error | +| [String concatenation in loop](https://codeql.github.com/codeql-query-help/csharp/cs-string-concatenation-in-loop/) | Reliability | Recommendation | +| [StringBuilder creation in loop](https://codeql.github.com/codeql-query-help/csharp/cs-stringbuilder-creation-in-loop/) | Reliability | Recommendation | +| [Unchecked cast in Equals method](https://codeql.github.com/codeql-query-help/csharp/cs-unchecked-cast-in-equals/) | Reliability | Warning | +| [Unmanaged code](https://codeql.github.com/codeql-query-help/csharp/cs-unmanaged-code/) | Reliability | Recommendation | +| [Use of default ToString()](https://codeql.github.com/codeql-query-help/csharp/cs-call-to-object-tostring/) | Reliability | Warning | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/go.md b/data/reusables/code-quality/codeql-query-tables/go.md new file mode 100644 index 0000000000..6d6f07987b --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/go.md @@ -0,0 +1,28 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| [Useless assignment to field](https://codeql.github.com/codeql-query-help/go/go-useless-assignment-to-field/) | Maintainability | Warning | +| [Useless assignment to local variable](https://codeql.github.com/codeql-query-help/go/go-useless-assignment-to-local/) | Maintainability | Warning | +| [Bitwise exclusive-or used like exponentiation](https://codeql.github.com/codeql-query-help/go/go-mistyped-exponentiation/) | Reliability | Warning | +| [Comparison of identical values](https://codeql.github.com/codeql-query-help/go/go-comparison-of-identical-expressions/) | Reliability | Warning | +| [Constant length comparison](https://codeql.github.com/codeql-query-help/go/go-constant-length-comparison/) | Reliability | Warning | +| [Duplicate 'if' branches](https://codeql.github.com/codeql-query-help/go/go-duplicate-branches/) | Reliability | Warning | +| [Duplicate 'if' condition](https://codeql.github.com/codeql-query-help/go/go-duplicate-condition/) | Reliability | Error | +| [Duplicate switch case](https://codeql.github.com/codeql-query-help/go/go-duplicate-switch-case/) | Reliability | Error | +| [Expression has no effect](https://codeql.github.com/codeql-query-help/go/go-useless-expression/) | Reliability | Warning | +| [Identical operands](https://codeql.github.com/codeql-query-help/go/go-redundant-operation/) | Reliability | Warning | +| [Impossible interface nil check](https://codeql.github.com/codeql-query-help/go/go-impossible-interface-nil-check/) | Reliability | Warning | +| [Inconsistent direction of for loop](https://codeql.github.com/codeql-query-help/go/go-inconsistent-loop-direction/) | Reliability | Error | +| [Missing error check](https://codeql.github.com/codeql-query-help/go/go-missing-error-check/) | Reliability | Warning | +| [Off-by-one comparison against length](https://codeql.github.com/codeql-query-help/go/go-index-out-of-bounds/) | Reliability | Error | +| [Redundant call to recover](https://codeql.github.com/codeql-query-help/go/go-redundant-recover/) | Reliability | Warning | +| [Redundant check for negative value](https://codeql.github.com/codeql-query-help/go/go-negative-length-check/) | Reliability | Warning | +| [Self assignment](https://codeql.github.com/codeql-query-help/go/go-redundant-assignment/) | Reliability | Warning | +| [Shift out of range](https://codeql.github.com/codeql-query-help/go/go-shift-out-of-range/) | Reliability | Warning | +| [Unreachable statement](https://codeql.github.com/codeql-query-help/go/go-unreachable-statement/) | Reliability | Warning | +| [Whitespace contradicts operator precedence](https://codeql.github.com/codeql-query-help/go/go-whitespace-contradicts-precedence/) | Reliability | Warning | +| [Wrapped error is always nil](https://codeql.github.com/codeql-query-help/go/go-unexpected-nil-value/) | Reliability | Warning | +| [Writable file handle closed without error handling](https://codeql.github.com/codeql-query-help/go/go-unhandled-writable-file-close/) | Reliability | Warning | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/java.md b/data/reusables/code-quality/codeql-query-tables/java.md new file mode 100644 index 0000000000..c7ae681645 --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/java.md @@ -0,0 +1,95 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| [Access to unsupported JDK-internal API](https://codeql.github.com/codeql-query-help/java/java-jdk-internal-api-access/) | Maintainability | Recommendation | +| [Boxed variable is never null](https://codeql.github.com/codeql-query-help/java/java-non-null-boxed-variable/) | Maintainability | Warning | +| [Cast from abstract to concrete collection](https://codeql.github.com/codeql-query-help/java/java-abstract-to-concrete-cast/) | Maintainability | Warning | +| [Class has same name as super class](https://codeql.github.com/codeql-query-help/java/java-class-name-matches-super-class/) | Maintainability | Recommendation | +| [Confusing method names because of capitalization](https://codeql.github.com/codeql-query-help/java/java-confusing-method-name/) | Maintainability | Recommendation | +| [Confusing overloading of methods](https://codeql.github.com/codeql-query-help/java/java-confusing-method-signature/) | Maintainability | Recommendation | +| [Constant interface anti-pattern](https://codeql.github.com/codeql-query-help/java/java-constants-only-interface/) | Maintainability | Recommendation | +| [Container contents are never accessed](https://codeql.github.com/codeql-query-help/java/java-unused-container/) | Maintainability | Error | +| [Inefficient empty string test](https://codeql.github.com/codeql-query-help/java/java-inefficient-empty-string-test/) | Maintainability | Recommendation | +| [Inefficient String constructor](https://codeql.github.com/codeql-query-help/java/java-inefficient-string-constructor/) | Maintainability | Recommendation | +| [Inner class could be static](https://codeql.github.com/codeql-query-help/java/java-non-static-nested-class/) | Maintainability | Recommendation | +| [Interface cannot be implemented](https://codeql.github.com/codeql-query-help/java/java-unimplementable-interface/) | Maintainability | Warning | +| [Javadoc has impossible 'throws' tag](https://codeql.github.com/codeql-query-help/java/java-inconsistent-javadoc-throws/) | Maintainability | Recommendation | +| [Misleading indentation](https://codeql.github.com/codeql-query-help/java/java-misleading-indentation/) | Maintainability | Warning | +| [Missing Override annotation](https://codeql.github.com/codeql-query-help/java/java-missing-override-annotation/) | Maintainability | Recommendation | +| [Missing space in string literal](https://codeql.github.com/codeql-query-help/java/java-missing-space-in-concatenation/) | Maintainability | Recommendation | +| [Mocking all public methods of a class may indicate the unit test is testing too much](https://codeql.github.com/codeql-query-help/java/java-excessive-public-method-mocking/) | Maintainability | Recommendation | +| [Non-case label in switch statement](https://codeql.github.com/codeql-query-help/java/java-label-in-switch/) | Maintainability | Recommendation | +| [Non-explicit control and whitespace characters](https://codeql.github.com/codeql-query-help/java/java-non-explicit-control-and-whitespace-chars-in-literals/) | Maintainability | Warning | +| [Possible confusion of local and field](https://codeql.github.com/codeql-query-help/java/java-local-shadows-field/) | Maintainability | Recommendation | +| [Spurious Javadoc @param tags](https://codeql.github.com/codeql-query-help/java/java-unknown-javadoc-parameter/) | Maintainability | Recommendation | +| [Subtle call to inherited method](https://codeql.github.com/codeql-query-help/java/java-subtle-inherited-call/) | Maintainability | Warning | +| [Underscore used as identifier](https://codeql.github.com/codeql-query-help/java/java-underscore-identifier/) | Maintainability | Recommendation | +| [Unread local variable](https://codeql.github.com/codeql-query-help/java/java-local-variable-is-never-read/) | Maintainability | Recommendation | +| [Unused classes and interfaces](https://codeql.github.com/codeql-query-help/java/java-unused-reference-type/) | Maintainability | Recommendation | +| [Unused format argument](https://codeql.github.com/codeql-query-help/java/java-unused-format-argument/) | Maintainability | Warning | +| [Unused label](https://codeql.github.com/codeql-query-help/java/java-unused-label/) | Maintainability | Recommendation | +| [Use of VisibleForTesting in production code](https://codeql.github.com/codeql-query-help/java/java-visible-for-testing-abuse/) | Maintainability | Warning | +| [Useless null check](https://codeql.github.com/codeql-query-help/java/java-useless-null-check/) | Maintainability | Warning | +| [Useless parameter](https://codeql.github.com/codeql-query-help/java/java-unused-parameter/) | Maintainability | Recommendation | +| [Useless toString on String](https://codeql.github.com/codeql-query-help/java/java-useless-tostring-call/) | Maintainability | Recommendation | +| [Useless type test](https://codeql.github.com/codeql-query-help/java/java-useless-type-test/) | Maintainability | Warning | +| [Array index out of bounds](https://codeql.github.com/codeql-query-help/java/java-index-out-of-bounds/) | Reliability | Error | +| [Character passed to StringBuffer or StringBuilder constructor](https://codeql.github.com/codeql-query-help/java/java-string-buffer-char-init/) | Reliability | Error | +| [Comparison of identical values](https://codeql.github.com/codeql-query-help/java/java-comparison-of-identical-expressions/) | Reliability | Error | +| [Constant loop condition](https://codeql.github.com/codeql-query-help/java/java-constant-loop-condition/) | Reliability | Warning | +| [Container contents are never initialized](https://codeql.github.com/codeql-query-help/java/java-empty-container/) | Reliability | Error | +| [Container size compared to zero](https://codeql.github.com/codeql-query-help/java/java-test-for-negative-container-size/) | Reliability | Warning | +| [Continue statement that does not continue](https://codeql.github.com/codeql-query-help/java/java-continue-in-false-loop/) | Reliability | Warning | +| [Contradictory type checks](https://codeql.github.com/codeql-query-help/java/java-contradictory-type-checks/) | Reliability | Error | +| [Dereferenced expression may be null](https://codeql.github.com/codeql-query-help/java/java-dereferenced-expr-may-be-null/) | Reliability | Warning | +| [Dereferenced variable is always null](https://codeql.github.com/codeql-query-help/java/java-dereferenced-value-is-always-null/) | Reliability | Error | +| [Dereferenced variable may be null](https://codeql.github.com/codeql-query-help/java/java-dereferenced-value-may-be-null/) | Reliability | Warning | +| [Direct call to a run() method](https://codeql.github.com/codeql-query-help/java/java-call-to-thread-run/) | Reliability | Recommendation | +| [Do not call `finalize()`](https://codeql.github.com/codeql-query-help/java/java-do-not-call-finalize/) | Reliability | Error | +| [Double-checked locking is not thread-safe](https://codeql.github.com/codeql-query-help/java/java-unsafe-double-checked-locking/) | Reliability | Error | +| [Equals method does not inspect argument type](https://codeql.github.com/codeql-query-help/java/java-unchecked-cast-in-equals/) | Reliability | Error | +| [Equals on incomparable types](https://codeql.github.com/codeql-query-help/java/java-equals-on-unrelated-types/) | Reliability | Error | +| [Equals or hashCode on arrays](https://codeql.github.com/codeql-query-help/java/java-equals-on-arrays/) | Reliability | Error | +| [Escaping](https://codeql.github.com/codeql-query-help/java/java-escaping/) | Reliability | Warning | +| [Exposing internal representation](https://codeql.github.com/codeql-query-help/java/java-internal-representation-exposure/) | Reliability | Recommendation | +| [Expression always evaluates to the same value](https://codeql.github.com/codeql-query-help/java/java-evaluation-to-constant/) | Reliability | Warning | +| [Hashed value without hashCode definition](https://codeql.github.com/codeql-query-help/java/java-hashing-without-hashcode/) | Reliability | Error | +| [Ignored error status of call](https://codeql.github.com/codeql-query-help/java/java-ignored-error-status-of-call/) | Reliability | Recommendation | +| [Ignored serialization member of record class](https://codeql.github.com/codeql-query-help/java/java-ignored-serialization-member-of-record-class/) | Reliability | Warning | +| [Implicit conversion from array to string](https://codeql.github.com/codeql-query-help/java/java-print-array/) | Reliability | Recommendation | +| [Inconsistent equals and hashCode](https://codeql.github.com/codeql-query-help/java/java-inconsistent-equals-and-hashcode/) | Reliability | Error | +| [Inconsistent synchronization of getter and setter](https://codeql.github.com/codeql-query-help/java/java-unsynchronized-getter/) | Reliability | Error | +| [Inefficient output stream](https://codeql.github.com/codeql-query-help/java/java-inefficient-output-stream/) | Reliability | Warning | +| [Inefficient primitive constructor](https://codeql.github.com/codeql-query-help/java/java-inefficient-boxed-constructor/) | Reliability | Recommendation | +| [Inefficient use of key set iterator](https://codeql.github.com/codeql-query-help/java/java-inefficient-key-set-iterator/) | Reliability | Recommendation | +| [Iterable wrapping an iterator](https://codeql.github.com/codeql-query-help/java/java-iterable-wraps-iterator/) | Reliability | Warning | +| [Iterator implementing Iterable](https://codeql.github.com/codeql-query-help/java/java-iterator-implements-iterable/) | Reliability | Warning | +| [Left shift by more than the type width](https://codeql.github.com/codeql-query-help/java/java-lshift-larger-than-type-width/) | Reliability | Warning | +| [Missing `@Nested` annotation on JUnit 5 inner test class](https://codeql.github.com/codeql-query-help/java/java-junit5-missing-nested-annotation/) | Reliability | Warning | +| [Missing catch of NumberFormatException](https://codeql.github.com/codeql-query-help/java/java-uncaught-number-format-exception/) | Reliability | Recommendation | +| [Missing format argument](https://codeql.github.com/codeql-query-help/java/java-missing-format-argument/) | Reliability | Error | +| [Non-final method invocation in constructor](https://codeql.github.com/codeql-query-help/java/java-non-final-call-in-constructor/) | Reliability | Error | +| [Non-synchronized override of synchronized method](https://codeql.github.com/codeql-query-help/java/java-non-sync-override/) | Reliability | Warning | +| [Not thread-safe](https://codeql.github.com/codeql-query-help/java/java-not-threadsafe/) | Reliability | Warning | +| [Potential database resource leak](https://codeql.github.com/codeql-query-help/java/java-database-resource-leak/) | Reliability | Warning | +| [Potential input resource leak](https://codeql.github.com/codeql-query-help/java/java-input-resource-leak/) | Reliability | Warning | +| [Potential output resource leak](https://codeql.github.com/codeql-query-help/java/java-output-resource-leak/) | Reliability | Warning | +| [Race condition in double-checked locking object initialization](https://codeql.github.com/codeql-query-help/java/java-unsafe-double-checked-locking-init-order/) | Reliability | Warning | +| [Reference equality test of boxed types](https://codeql.github.com/codeql-query-help/java/java-reference-equality-of-boxed-types/) | Reliability | Error | +| [Result of multiplication cast to wider type](https://codeql.github.com/codeql-query-help/java/java-integer-multiplication-cast-to-long/) | Reliability | Warning | +| [Safe publication](https://codeql.github.com/codeql-query-help/java/java-safe-publication/) | Reliability | Warning | +| [Self assignment](https://codeql.github.com/codeql-query-help/java/java-redundant-assignment/) | Reliability | Error | +| [Suspicious date format](https://codeql.github.com/codeql-query-help/java/java-suspicious-date-format/) | Reliability | Warning | +| [Synchronization on boxed types or strings](https://codeql.github.com/codeql-query-help/java/java-sync-on-boxed-types/) | Reliability | Error | +| [Type mismatch on container access](https://codeql.github.com/codeql-query-help/java/java-type-mismatch-access/) | Reliability | Error | +| [Type mismatch on container modification](https://codeql.github.com/codeql-query-help/java/java-type-mismatch-modification/) | Reliability | Error | +| [Unreachable catch clause](https://codeql.github.com/codeql-query-help/java/java-unreachable-catch-clause/) | Reliability | Warning | +| [Use of `String#replaceAll` with a first argument which is not a regular expression](https://codeql.github.com/codeql-query-help/java/java-string-replace-all-with-non-regex/) | Reliability | Recommendation | +| [Use of default toString()](https://codeql.github.com/codeql-query-help/java/java-call-to-object-tostring/) | Reliability | Recommendation | +| [Useless comparison test](https://codeql.github.com/codeql-query-help/java/java-constant-comparison/) | Reliability | Warning | +| [Whitespace contradicts operator precedence](https://codeql.github.com/codeql-query-help/java/java-whitespace-contradicts-precedence/) | Reliability | Warning | +| [Wrong NaN comparison](https://codeql.github.com/codeql-query-help/java/java-comparison-with-nan/) | Reliability | Error | +| [Zero threads set for `java.util.concurrent.ScheduledThreadPoolExecutor`](https://codeql.github.com/codeql-query-help/java/java-java-util-concurrent-scheduledthreadpoolexecutor/) | Reliability | Recommendation | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/javascript.md b/data/reusables/code-quality/codeql-query-tables/javascript.md new file mode 100644 index 0000000000..05e09d5629 --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/javascript.md @@ -0,0 +1,104 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| [Call to eval-like DOM function](https://codeql.github.com/codeql-query-help/javascript/js-eval-like-call/) | Maintainability | Recommendation | +| [Duplicate dependency](https://codeql.github.com/codeql-query-help/javascript/js-angular-duplicate-dependency/) | Maintainability | Warning | +| [Duplicate HTML element attributes](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-html-attribute/) | Maintainability | Warning | +| [Duplicate property](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-property/) | Maintainability | Warning | +| [Duplicate variable declaration](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-variable-declaration/) | Maintainability | Recommendation | +| [Expression has no effect](https://codeql.github.com/codeql-query-help/javascript/js-useless-expression/) | Maintainability | Warning | +| [Misleading indentation after control statement](https://codeql.github.com/codeql-query-help/javascript/js-misleading-indentation-after-control-statement/) | Maintainability | Warning | +| [Misleading indentation of dangling 'else'](https://codeql.github.com/codeql-query-help/javascript/js-misleading-indentation-of-dangling-else/) | Maintainability | Warning | +| [Missing space in string concatenation](https://codeql.github.com/codeql-query-help/javascript/js-missing-space-in-concatenation/) | Maintainability | Warning | +| [Repeated dependency injection](https://codeql.github.com/codeql-query-help/javascript/js-angular-repeated-dependency-injection/) | Maintainability | Warning | +| [Semicolon insertion](https://codeql.github.com/codeql-query-help/javascript/js-automatic-semicolon-insertion/) | Maintainability | Recommendation | +| [Unclear precedence of nested operators](https://codeql.github.com/codeql-query-help/javascript/js-unclear-operator-precedence/) | Maintainability | Recommendation | +| [Unneeded defensive code](https://codeql.github.com/codeql-query-help/javascript/js-unneeded-defensive-code/) | Maintainability | Recommendation | +| [Unused variable, import, function or class](https://codeql.github.com/codeql-query-help/javascript/js-unused-local-variable/) | Maintainability | Recommendation | +| [Use of for-in comprehension blocks](https://codeql.github.com/codeql-query-help/javascript/js-for-in-comprehension/) | Maintainability | Error | +| [Use of platform-specific language features](https://codeql.github.com/codeql-query-help/javascript/js-non-standard-language-feature/) | Maintainability | Warning | +| [Useless assignment to local variable](https://codeql.github.com/codeql-query-help/javascript/js-useless-assignment-to-local/) | Maintainability | Warning | +| [Useless assignment to property](https://codeql.github.com/codeql-query-help/javascript/js-useless-assignment-to-property/) | Maintainability | Warning | +| [Useless return in setter](https://codeql.github.com/codeql-query-help/javascript/js-setter-return/) | Maintainability | Warning | +| [Variable not declared before use](https://codeql.github.com/codeql-query-help/javascript/js-use-before-declaration/) | Maintainability | Warning | +| [With statement](https://codeql.github.com/codeql-query-help/javascript/js-with-statement/) | Maintainability | Warning | +| [Access to let-bound variable in temporal dead zone](https://codeql.github.com/codeql-query-help/javascript/js-variable-use-in-temporal-dead-zone/) | Reliability | Error | +| [Arguments redefined](https://codeql.github.com/codeql-query-help/javascript/js-arguments-redefinition/) | Reliability | Recommendation | +| [Arrow method on Vue instance](https://codeql.github.com/codeql-query-help/javascript/js-vue-arrow-method-on-vue-instance/) | Reliability | Warning | +| [Assignment to constant](https://codeql.github.com/codeql-query-help/javascript/js-assignment-to-constant/) | Reliability | Error | +| [Assignment to exports variable](https://codeql.github.com/codeql-query-help/javascript/js-node-assignment-to-exports-variable/) | Reliability | Warning | +| [Assignment to property of primitive value](https://codeql.github.com/codeql-query-help/javascript/js-property-assignment-on-primitive/) | Reliability | Error | +| [Back reference into negative lookahead assertion](https://codeql.github.com/codeql-query-help/javascript/js-regex-back-reference-to-negative-lookahead/) | Reliability | Error | +| [Back reference precedes capture group](https://codeql.github.com/codeql-query-help/javascript/js-regex-back-reference-before-group/) | Reliability | Error | +| [Comparison between inconvertible types](https://codeql.github.com/codeql-query-help/javascript/js-comparison-between-incompatible-types/) | Reliability | Warning | +| [Comparison with NaN](https://codeql.github.com/codeql-query-help/javascript/js-comparison-with-nan/) | Reliability | Error | +| [Conditional comments](https://codeql.github.com/codeql-query-help/javascript/js-conditional-comment/) | Reliability | Warning | +| [Conflicting function declarations](https://codeql.github.com/codeql-query-help/javascript/js-function-declaration-conflict/) | Reliability | Error | +| [Conflicting variable initialization](https://codeql.github.com/codeql-query-help/javascript/js-variable-initialization-conflict/) | Reliability | Error | +| [Default parameter references nested function](https://codeql.github.com/codeql-query-help/javascript/js-nested-function-reference-in-default-parameter/) | Reliability | Error | +| [Deleting non-property](https://codeql.github.com/codeql-query-help/javascript/js-deletion-of-non-property/) | Reliability | Warning | +| [Dependency mismatch](https://codeql.github.com/codeql-query-help/javascript/js-angular-dependency-injection-mismatch/) | Reliability | Warning | +| [Direct state mutation](https://codeql.github.com/codeql-query-help/javascript/js-react-direct-state-mutation/) | Reliability | Warning | +| [Duplicate 'if' condition](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-condition/) | Reliability | Warning | +| [Duplicate character in character class](https://codeql.github.com/codeql-query-help/javascript/js-regex-duplicate-in-character-class/) | Reliability | Warning | +| [Duplicate parameter names](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-parameter-name/) | Reliability | Error | +| [Duplicate switch case](https://codeql.github.com/codeql-query-help/javascript/js-duplicate-switch-case/) | Reliability | Warning | +| [Empty character class](https://codeql.github.com/codeql-query-help/javascript/js-regex-empty-character-class/) | Reliability | Warning | +| [Identical operands](https://codeql.github.com/codeql-query-help/javascript/js-redundant-operation/) | Reliability | Warning | +| [Ignoring result from pure array method](https://codeql.github.com/codeql-query-help/javascript/js-ignore-array-result/) | Reliability | Warning | +| [Illegal invocation](https://codeql.github.com/codeql-query-help/javascript/js-illegal-invocation/) | Reliability | Error | +| [Implicit operand conversion](https://codeql.github.com/codeql-query-help/javascript/js-implicit-operand-conversion/) | Reliability | Warning | +| [Incompatible dependency injection](https://codeql.github.com/codeql-query-help/javascript/js-angular-incompatible-service/) | Reliability | Error | +| [Inconsistent direction of for loop](https://codeql.github.com/codeql-query-help/javascript/js-inconsistent-loop-direction/) | Reliability | Error | +| [Inconsistent use of 'new'](https://codeql.github.com/codeql-query-help/javascript/js-inconsistent-use-of-new/) | Reliability | Warning | +| [Ineffective parameter type](https://codeql.github.com/codeql-query-help/javascript/js-ineffective-parameter-type/) | Reliability | Warning | +| [Invalid prototype value](https://codeql.github.com/codeql-query-help/javascript/js-invalid-prototype-value/) | Reliability | Error | +| [Invocation of non-function](https://codeql.github.com/codeql-query-help/javascript/js-call-to-non-callable/) | Reliability | Error | +| [Loop iteration skipped due to shifting](https://codeql.github.com/codeql-query-help/javascript/js-loop-iteration-skipped-due-to-shifting/) | Reliability | Warning | +| [Malformed id attribute](https://codeql.github.com/codeql-query-help/javascript/js-malformed-html-id/) | Reliability | Warning | +| [Missing '.length' in comparison](https://codeql.github.com/codeql-query-help/javascript/js-missing-dot-length-in-comparison/) | Reliability | Warning | +| [Missing 'this' qualifier](https://codeql.github.com/codeql-query-help/javascript/js-missing-this-qualifier/) | Reliability | Error | +| [Missing await](https://codeql.github.com/codeql-query-help/javascript/js-missing-await/) | Reliability | Warning | +| [Missing explicit dependency injection](https://codeql.github.com/codeql-query-help/javascript/js-angular-missing-explicit-injection/) | Reliability | Warning | +| [Missing exports qualifier](https://codeql.github.com/codeql-query-help/javascript/js-node-missing-exports-qualifier/) | Reliability | Error | +| [Missing variable declaration](https://codeql.github.com/codeql-query-help/javascript/js-missing-variable-declaration/) | Reliability | Warning | +| [Misspelled variable name](https://codeql.github.com/codeql-query-help/javascript/js-misspelled-variable-name/) | Reliability | Warning | +| [Non-case label in switch statement](https://codeql.github.com/codeql-query-help/javascript/js-label-in-switch/) | Reliability | Warning | +| [Non-linear pattern](https://codeql.github.com/codeql-query-help/javascript/js-non-linear-pattern/) | Reliability | Error | +| [Off-by-one comparison against length](https://codeql.github.com/codeql-query-help/javascript/js-index-out-of-bounds/) | Reliability | Warning | +| [Overwritten property](https://codeql.github.com/codeql-query-help/javascript/js-overwritten-property/) | Reliability | Error | +| [Potentially inconsistent state update](https://codeql.github.com/codeql-query-help/javascript/js-react-inconsistent-state-update/) | Reliability | Warning | +| [Property access on null or undefined](https://codeql.github.com/codeql-query-help/javascript/js-property-access-on-non-object/) | Reliability | Error | +| [Regular expression always matches](https://codeql.github.com/codeql-query-help/javascript/js-regex-always-matches/) | Reliability | Warning | +| [Return statement assigns local variable](https://codeql.github.com/codeql-query-help/javascript/js-useless-assignment-in-return/) | Reliability | Warning | +| [Self assignment](https://codeql.github.com/codeql-query-help/javascript/js-redundant-assignment/) | Reliability | Warning | +| [Shift out of range](https://codeql.github.com/codeql-query-help/javascript/js-shift-out-of-range/) | Reliability | Error | +| [String instead of regular expression](https://codeql.github.com/codeql-query-help/javascript/js-string-instead-of-regex/) | Reliability | Warning | +| [Superfluous trailing arguments](https://codeql.github.com/codeql-query-help/javascript/js-superfluous-trailing-arguments/) | Reliability | Warning | +| [Suspicious method name declaration](https://codeql.github.com/codeql-query-help/javascript/js-suspicious-method-name-declaration/) | Reliability | Warning | +| [Template syntax in string literal](https://codeql.github.com/codeql-query-help/javascript/js-template-syntax-in-string-literal/) | Reliability | Warning | +| [Unbound back reference](https://codeql.github.com/codeql-query-help/javascript/js-regex-unbound-back-reference/) | Reliability | Warning | +| [Unbound event handler receiver](https://codeql.github.com/codeql-query-help/javascript/js-unbound-event-handler-receiver/) | Reliability | Error | +| [Unhandled error in stream pipeline](https://codeql.github.com/codeql-query-help/javascript/js-unhandled-error-in-stream-pipeline/) | Reliability | Warning | +| [Unknown directive](https://codeql.github.com/codeql-query-help/javascript/js-unknown-directive/) | Reliability | Warning | +| [Unmatchable caret in regular expression](https://codeql.github.com/codeql-query-help/javascript/js-regex-unmatchable-caret/) | Reliability | Error | +| [Unmatchable dollar in regular expression](https://codeql.github.com/codeql-query-help/javascript/js-regex-unmatchable-dollar/) | Reliability | Error | +| [Unreachable method overloads](https://codeql.github.com/codeql-query-help/javascript/js-unreachable-method-overloads/) | Reliability | Warning | +| [Unreachable statement](https://codeql.github.com/codeql-query-help/javascript/js-unreachable-statement/) | Reliability | Warning | +| [Unsupported state update in lifecycle method](https://codeql.github.com/codeql-query-help/javascript/js-react-unsupported-state-update-in-lifecycle-method/) | Reliability | Warning | +| [Unused index variable](https://codeql.github.com/codeql-query-help/javascript/js-unused-index-variable/) | Reliability | Warning | +| [Unused loop iteration variable](https://codeql.github.com/codeql-query-help/javascript/js-unused-loop-variable/) | Reliability | Error | +| [Unused or undefined state property](https://codeql.github.com/codeql-query-help/javascript/js-react-unused-or-undefined-state-property/) | Reliability | Warning | +| [Use of AngularJS markup in URL-valued attribute](https://codeql.github.com/codeql-query-help/javascript/js-angular-expression-in-url-attribute/) | Reliability | Warning | +| [Use of call stack introspection in strict mode](https://codeql.github.com/codeql-query-help/javascript/js-strict-mode-call-stack-introspection/) | Reliability | Error | +| [Use of incompletely initialized object](https://codeql.github.com/codeql-query-help/javascript/js-incomplete-object-initialization/) | Reliability | Error | +| [Use of returnless function](https://codeql.github.com/codeql-query-help/javascript/js-use-of-returnless-function/) | Reliability | Warning | +| [Useless comparison test](https://codeql.github.com/codeql-query-help/javascript/js-useless-comparison-test/) | Reliability | Warning | +| [Useless conditional](https://codeql.github.com/codeql-query-help/javascript/js-trivial-conditional/) | Reliability | Warning | +| [Useless type test](https://codeql.github.com/codeql-query-help/javascript/js-useless-type-test/) | Reliability | Error | +| [Whitespace contradicts operator precedence](https://codeql.github.com/codeql-query-help/javascript/js-whitespace-contradicts-precedence/) | Reliability | Warning | +| [Wrong use of 'this' for static method](https://codeql.github.com/codeql-query-help/javascript/js-mixed-static-instance-this-access/) | Reliability | Error | +| [Yield in non-generator function](https://codeql.github.com/codeql-query-help/javascript/js-yield-outside-generator/) | Reliability | Error | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/python.md b/data/reusables/code-quality/codeql-query-tables/python.md new file mode 100644 index 0000000000..3360acd49b --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/python.md @@ -0,0 +1,107 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| ['import *' may pollute namespace](https://codeql.github.com/codeql-query-help/python/py-polluting-import/) | Maintainability | Recommendation | +| [Backspace escape in regular expression](https://codeql.github.com/codeql-query-help/python/py-regex-backspace-escape/) | Maintainability | Recommendation | +| [Commented-out code](https://codeql.github.com/codeql-query-help/python/py-commented-out-code/) | Maintainability | Recommendation | +| [Comparison of constants](https://codeql.github.com/codeql-query-help/python/py-comparison-of-constants/) | Maintainability | Warning | +| [Comparison of identical values](https://codeql.github.com/codeql-query-help/python/py-comparison-of-identical-expressions/) | Maintainability | Warning | +| [Constant in conditional expression or statement](https://codeql.github.com/codeql-query-help/python/py-constant-conditional-expression/) | Maintainability | Warning | +| [Duplicate key in dict literal](https://codeql.github.com/codeql-query-help/python/py-duplicate-key-dict-literal/) | Maintainability | Warning | +| [Duplication in regular expression character class](https://codeql.github.com/codeql-query-help/python/py-regex-duplicate-in-character-class/) | Maintainability | Warning | +| [First parameter of a class method is not named 'cls'](https://codeql.github.com/codeql-query-help/python/py-not-named-cls/) | Maintainability | Recommendation | +| [First parameter of a method is not named 'self'](https://codeql.github.com/codeql-query-help/python/py-not-named-self/) | Maintainability | Recommendation | +| [Implicit string concatenation in a list](https://codeql.github.com/codeql-query-help/python/py-implicit-string-concatenation-in-list/) | Maintainability | Warning | +| [Imprecise assert](https://codeql.github.com/codeql-query-help/python/py-imprecise-assert/) | Maintainability | Recommendation | +| [Module imports itself](https://codeql.github.com/codeql-query-help/python/py-import-own-module/) | Maintainability | Recommendation | +| [Module is imported more than once](https://codeql.github.com/codeql-query-help/python/py-repeated-import/) | Maintainability | Recommendation | +| [Module is imported with 'import' and 'import from'](https://codeql.github.com/codeql-query-help/python/py-import-and-import-from/) | Maintainability | Recommendation | +| [Nested loops with same variable](https://codeql.github.com/codeql-query-help/python/py-nested-loops-with-same-variable/) | Maintainability | Recommendation | +| [Overly complex `__del__` method](https://codeql.github.com/codeql-query-help/python/py-overly-complex-delete/) | Maintainability | Recommendation | +| [Redundant comparison](https://codeql.github.com/codeql-query-help/python/py-redundant-comparison/) | Maintainability | Warning | +| [Should use a 'with' statement](https://codeql.github.com/codeql-query-help/python/py-should-use-with/) | Maintainability | Recommendation | +| [Statement has no effect](https://codeql.github.com/codeql-query-help/python/py-ineffectual-statement/) | Maintainability | Recommendation | +| [Unnecessary 'else' clause in loop](https://codeql.github.com/codeql-query-help/python/py-redundant-else/) | Maintainability | Warning | +| [Unnecessary lambda](https://codeql.github.com/codeql-query-help/python/py-unnecessary-lambda/) | Maintainability | Recommendation | +| [Unnecessary pass](https://codeql.github.com/codeql-query-help/python/py-unnecessary-pass/) | Maintainability | Warning | +| [Unreachable code](https://codeql.github.com/codeql-query-help/python/py-unreachable-statement/) | Maintainability | Warning | +| [Unused argument in a formatting call](https://codeql.github.com/codeql-query-help/python/py-str-format-surplus-argument/) | Maintainability | Warning | +| [Unused global variable](https://codeql.github.com/codeql-query-help/python/py-unused-global-variable/) | Maintainability | Recommendation | +| [Unused import](https://codeql.github.com/codeql-query-help/python/py-unused-import/) | Maintainability | Recommendation | +| [Unused local variable](https://codeql.github.com/codeql-query-help/python/py-unused-local-variable/) | Maintainability | Recommendation | +| [Unused named argument in formatting call](https://codeql.github.com/codeql-query-help/python/py-str-format-surplus-named-argument/) | Maintainability | Warning | +| [Use of 'global' at module level](https://codeql.github.com/codeql-query-help/python/py-redundant-global-declaration/) | Maintainability | Warning | +| [Use of the return value of a procedure](https://codeql.github.com/codeql-query-help/python/py-procedure-return-value-used/) | Maintainability | Warning | +| [Variable defined multiple times](https://codeql.github.com/codeql-query-help/python/py-multiple-definition/) | Maintainability | Warning | +| [`__del__` is called explicitly](https://codeql.github.com/codeql-query-help/python/py-explicit-call-to-delete/) | Reliability | Warning | +| [`__eq__` not overridden when adding attributes](https://codeql.github.com/codeql-query-help/python/py-missing-equals/) | Reliability | Warning | +| [`__init__` method calls overridden method](https://codeql.github.com/codeql-query-help/python/py-init-calls-subclass/) | Reliability | Warning | +| [`__init__` method is a generator](https://codeql.github.com/codeql-query-help/python/py-init-method-is-generator/) | Reliability | Error | +| [`__init__` method returns a value](https://codeql.github.com/codeql-query-help/python/py-explicit-return-in-init/) | Reliability | Error | +| [`__iter__` method returns a non-iterator](https://codeql.github.com/codeql-query-help/python/py-iter-returns-non-iterator/) | Reliability | Error | +| [An assert statement has a side-effect](https://codeql.github.com/codeql-query-help/python/py-side-effect-in-assert/) | Reliability | Error | +| [Asserting a tuple](https://codeql.github.com/codeql-query-help/python/py-asserts-tuple/) | Reliability | Error | +| [Comparison using is when operands support `__eq__`](https://codeql.github.com/codeql-query-help/python/py-comparison-using-is/) | Reliability | Warning | +| [Conflicting attributes in base classes](https://codeql.github.com/codeql-query-help/python/py-conflicting-attributes/) | Reliability | Warning | +| [Empty except](https://codeql.github.com/codeql-query-help/python/py-empty-except/) | Reliability | Recommendation | +| [Encoding error](https://codeql.github.com/codeql-query-help/python/py-encoding-error/) | Reliability | Error | +| [Except block handles 'BaseException'](https://codeql.github.com/codeql-query-help/python/py-catch-base-exception/) | Reliability | Recommendation | +| [Explicit export is not defined](https://codeql.github.com/codeql-query-help/python/py-undefined-export/) | Reliability | Error | +| [Explicit returns mixed with implicit (fall through) returns](https://codeql.github.com/codeql-query-help/python/py-mixed-returns/) | Reliability | Recommendation | +| [File is not always closed](https://codeql.github.com/codeql-query-help/python/py-file-not-closed/) | Reliability | Warning | +| [First argument to super() is not enclosing class](https://codeql.github.com/codeql-query-help/python/py-super-not-enclosing-class/) | Reliability | Error | +| [Formatted object is not a mapping](https://codeql.github.com/codeql-query-help/python/py-percent-format-not-mapping/) | Reliability | Error | +| [Formatting string mixes implicitly and explicitly numbered fields](https://codeql.github.com/codeql-query-help/python/py-str-format-mixed-fields/) | Reliability | Error | +| [Illegal raise](https://codeql.github.com/codeql-query-help/python/py-illegal-raise/) | Reliability | Error | +| [Incomplete ordering](https://codeql.github.com/codeql-query-help/python/py-incomplete-ordering/) | Reliability | Warning | +| [Inconsistent equality and hashing](https://codeql.github.com/codeql-query-help/python/py-equals-hash-mismatch/) | Reliability | Warning | +| [Inconsistent equality and inequality](https://codeql.github.com/codeql-query-help/python/py-inconsistent-equality/) | Reliability | Warning | +| [Inconsistent method resolution order](https://codeql.github.com/codeql-query-help/python/py-inconsistent-mro/) | Reliability | Error | +| [Iterable can be either a string or a sequence](https://codeql.github.com/codeql-query-help/python/py-iteration-string-and-sequence/) | Reliability | Error | +| [Iterator does not return self from `__iter__` method](https://codeql.github.com/codeql-query-help/python/py-iter-returns-non-self/) | Reliability | Error | +| [Loop variable capture](https://codeql.github.com/codeql-query-help/python/py-loop-variable-capture/) | Reliability | Error | +| [Maybe missing 'self' in comparison](https://codeql.github.com/codeql-query-help/python/py-comparison-missing-self/) | Reliability | Warning | +| [Membership test with a non-container](https://codeql.github.com/codeql-query-help/python/py-member-test-non-container/) | Reliability | Error | +| [Mismatch between signature and use of an overridden method](https://codeql.github.com/codeql-query-help/python/py-inheritance-incorrect-overridden-signature/) | Reliability | Recommendation | +| [Mismatch between signature and use of an overriding method](https://codeql.github.com/codeql-query-help/python/py-inheritance-incorrect-overriding-signature/) | Reliability | Error | +| [Mismatch in multiple assignment](https://codeql.github.com/codeql-query-help/python/py-mismatched-multiple-assignment/) | Reliability | Error | +| [Missing call to superclass `__del__` during object destruction](https://codeql.github.com/codeql-query-help/python/py-missing-call-to-delete/) | Reliability | Error | +| [Missing call to superclass `__init__` during object initialization](https://codeql.github.com/codeql-query-help/python/py-missing-call-to-init/) | Reliability | Error | +| [Missing named arguments in formatting call](https://codeql.github.com/codeql-query-help/python/py-str-format-missing-named-argument/) | Reliability | Error | +| [Missing part of special group in regular expression](https://codeql.github.com/codeql-query-help/python/py-regex-incomplete-special-group/) | Reliability | Warning | +| [Modification of dictionary returned by locals()](https://codeql.github.com/codeql-query-help/python/py-modification-of-locals/) | Reliability | Warning | +| [Modification of parameter with default](https://codeql.github.com/codeql-query-help/python/py-modification-of-default-value/) | Reliability | Error | +| [Multiple calls to `__del__` during object destruction](https://codeql.github.com/codeql-query-help/python/py-multiple-calls-to-delete/) | Reliability | Warning | +| [Multiple calls to `__init__` during object initialization](https://codeql.github.com/codeql-query-help/python/py-multiple-calls-to-init/) | Reliability | Warning | +| [Mutation of descriptor in `__get__` or `__set__` method](https://codeql.github.com/codeql-query-help/python/py-mutable-descriptor/) | Reliability | Error | +| [Nested loops with same variable reused after inner loop body](https://codeql.github.com/codeql-query-help/python/py-nested-loops-with-same-variable-reused/) | Reliability | Error | +| [Non-callable called](https://codeql.github.com/codeql-query-help/python/py-call-to-non-callable/) | Reliability | Error | +| [Non-exception in 'except' clause](https://codeql.github.com/codeql-query-help/python/py-useless-except/) | Reliability | Error | +| [Non-iterable used in for loop](https://codeql.github.com/codeql-query-help/python/py-non-iterable-in-for-loop/) | Reliability | Error | +| [Non-standard exception raised in special method](https://codeql.github.com/codeql-query-help/python/py-unexpected-raise-in-special-method/) | Reliability | Recommendation | +| [Raising `NotImplemented`](https://codeql.github.com/codeql-query-help/python/py-raise-not-implemented/) | Reliability | Warning | +| [Redundant assignment](https://codeql.github.com/codeql-query-help/python/py-redundant-assignment/) | Reliability | Error | +| [Returning tuples with varying lengths](https://codeql.github.com/codeql-query-help/python/py-mixed-tuple-returns/) | Reliability | Recommendation | +| [Signature mismatch in overriding method](https://codeql.github.com/codeql-query-help/python/py-inheritance-signature-mismatch/) | Reliability | Warning | +| [Special method has incorrect signature](https://codeql.github.com/codeql-query-help/python/py-special-method-wrong-signature/) | Reliability | Error | +| [Superclass attribute shadows subclass method](https://codeql.github.com/codeql-query-help/python/py-attribute-shadows-method/) | Reliability | Error | +| [Suspicious unused loop iteration variable](https://codeql.github.com/codeql-query-help/python/py-unused-loop-variable/) | Reliability | Error | +| [Syntax error](https://codeql.github.com/codeql-query-help/python/py-syntax-error/) | Reliability | Error | +| [Testing equality to None](https://codeql.github.com/codeql-query-help/python/py-test-equals-none/) | Reliability | Recommendation | +| [Too few arguments in formatting call](https://codeql.github.com/codeql-query-help/python/py-str-format-missing-argument/) | Reliability | Error | +| [Unhashable object hashed](https://codeql.github.com/codeql-query-help/python/py-hash-unhashable-value/) | Reliability | Error | +| [Unmatchable caret in regular expression](https://codeql.github.com/codeql-query-help/python/py-regex-unmatchable-caret/) | Reliability | Error | +| [Unmatchable dollar in regular expression](https://codeql.github.com/codeql-query-help/python/py-regex-unmatchable-dollar/) | Reliability | Error | +| [Unreachable `except` block](https://codeql.github.com/codeql-query-help/python/py-unreachable-except/) | Reliability | Error | +| [Unsupported format character](https://codeql.github.com/codeql-query-help/python/py-percent-format-unsupported-character/) | Reliability | Error | +| [Unused exception object](https://codeql.github.com/codeql-query-help/python/py-unused-exception-object/) | Reliability | Error | +| [Use of a print statement at module level](https://codeql.github.com/codeql-query-help/python/py-print-during-import/) | Reliability | Recommendation | +| [Use of exit() or quit()](https://codeql.github.com/codeql-query-help/python/py-use-of-exit-or-quit/) | Reliability | Warning | +| [Wrong name for an argument in a call](https://codeql.github.com/codeql-query-help/python/py-call-wrong-named-argument/) | Reliability | Error | +| [Wrong name for an argument in a class instantiation](https://codeql.github.com/codeql-query-help/python/py-call-wrong-named-class-argument/) | Reliability | Error | +| [Wrong number of arguments for format](https://codeql.github.com/codeql-query-help/python/py-percent-format-wrong-arguments/) | Reliability | Error | +| [Wrong number of arguments in a call](https://codeql.github.com/codeql-query-help/python/py-call-wrong-arguments/) | Reliability | Error | +| [Wrong number of arguments in a class instantiation](https://codeql.github.com/codeql-query-help/python/py-call-wrong-number-class-arguments/) | Reliability | Error | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/ruby.md b/data/reusables/code-quality/codeql-query-tables/ruby.md new file mode 100644 index 0000000000..9e1532753e --- /dev/null +++ b/data/reusables/code-quality/codeql-query-tables/ruby.md @@ -0,0 +1,9 @@ +{% rowheaders %} + +| Query name | Category | Severity | +| --- | --- | --- | +| [Useless assignment to local variable](https://codeql.github.com/codeql-query-help/ruby/rb-useless-assignment-to-local/) | Maintainability | Warning | +| [Database query in a loop](https://codeql.github.com/codeql-query-help/ruby/rb-database-query-in-loop/) | Reliability | Info | +| [Potentially uninitialized local variable](https://codeql.github.com/codeql-query-help/ruby/rb-uninitialized-local-variable/) | Reliability | Error | + +{% endrowheaders %} diff --git a/data/reusables/code-quality/codeql-query-tables/rust.md b/data/reusables/code-quality/codeql-query-tables/rust.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/eslint.config.ts b/eslint.config.ts index c0937d6df7..510b63d1c7 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -102,13 +102,15 @@ export default [ }, // Ignored patterns + // CodeQL scripts included because cocofix is install manually by the workflow { ignores: [ 'tmp/*', '.next/', 'rest-api-description/', 'docs-internal-data/', - 'src/code-scanning/scripts/generate-code-scanning-query-list.ts', + 'src/codeql-queries/scripts/generate-code-scanning-query-list.ts', + 'src/codeql-queries/scripts/generate-code-quality-query-list.ts', 'next-env.d.ts', ], }, diff --git a/package.json b/package.json index db07b9267b..6c6376c15d 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "lint-translation": "vitest src/content-linter/tests/lint-files.ts", "liquid-markdown-tables": "tsx src/tools/scripts/liquid-markdown-tables/index.ts", "generate-article-api-docs": "tsx src/article-api/scripts/generate-api-docs.ts", - "generate-code-scanning-query-list": "tsx src/code-scanning/scripts/generate-code-scanning-query-list.ts", + "generate-code-scanning-query-list": "tsx src/codeql-queries/scripts/generate-code-scanning-query-list.ts", + "generate-code-quality-query-list": "tsx src/codeql-queries/scripts/generate-code-quality-query-list.ts", "generate-content-linter-docs": "tsx src/content-linter/scripts/generate-docs.ts", "move-content": "tsx src/content-render/scripts/move-content.ts", "openapi-docs": "tsx src/rest/docs.ts", diff --git a/src/code-scanning/README.md b/src/code-scanning/README.md deleted file mode 100644 index 2dbadbf130..0000000000 --- a/src/code-scanning/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Code scanning query tables - -This nascent pipeline creates autogenerated documentation docs.github.com from the query suites included with the [CodeQL bundle](https://github.com/github/codeql-action/releases). - -The pipeline is used to generate Markdown tables that are stored in reusable files and used in article pages on the docs.github.com site. - -## How does it work - -```mermaid ---- -title: "Process for generating Code scanning query tables" ---- -flowchart TB - -accDescr: A flow chart describing how the automation generates documentation for code scanning queries. - - start([Start]) --> checkout[Checkout the codeql repository] - start --- download[Download the CodeQL CLI] - checkout --- query-suites[fa:fa-file Query suites *.qls] - query-suites ---> generate[Generate tables:src/code-scanning/scripts/generate-code-scanning-query-lists.ts] - download --- codeql-cli[CodeQL CLI: codeql.exe] - codeql-cli --> generate - generate --- markdown[fa:fa-file Reusable files *.md] - markdown --> pr[Generate a PR overwriting:data/reusables/code-scanning/codeql-query-tables/*.md] - pr --> finish([End]) - -%% Define styles - classDef start fill:#1AAC9D, color:white - classDef action fill:#6557F6, color:white - classDef finish fill:#F8C324, color:white - classDef file fill:#ddd - -%% Assign styles - class start start; - class finish finish; - class checkout,download,generate,pr action; - class markdown,query-suites,codeql-cli file; -``` - -A [workflow](.github/workflows/generate-code-scanning-query-lists.yml) is used to trigger the automation of the code scanning query tables documentation. The workflow is manually triggered by a member of the GitHub Docs team approximately every two weeks to align to releases of the CodeQL CLI. The workflow takes an input parameter that specifies the branch to pull the source files from in the semmle-code repo. If the branch input is omitted, the workflow will default to the `main` branch. - -The workflow runs the `npm run generate-code-scanning-query-list` script, which generates Markdown files under `data/reusables/code-scanning/codeql-query-tables`. - -The workflow automatically creates a new pull request with the changes and the label `codeql-query-tables`. - -## Local development - -To run the pipeline locally, see the comments in the [script](scripts/generate-code-scanning-query-list.ts). - -## Content team - -The content writers can use the reusables in any content article. They have no need to make any changes to the script unless additional built-in query suites are added. - -## How to get help - -### For workflow and script problems - -Slack: `#docs-engineering` -Repo: `github/docs-engineering` - -### For CodeQL repository and CLI problems - -Slack: `#code-scanning-internal-dx` -Repo: `github/code-scanning-internal-dx-team` diff --git a/src/code-scanning/scripts/tsconfig.json b/src/code-scanning/scripts/tsconfig.json deleted file mode 100644 index 11ddf7df11..0000000000 --- a/src/code-scanning/scripts/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "include": ["generate-code-scanning-query-list.ts"], - "exclude": ["node_modules"] -} diff --git a/src/codeql-queries/README.md b/src/codeql-queries/README.md new file mode 100644 index 0000000000..5bf9bd0f09 --- /dev/null +++ b/src/codeql-queries/README.md @@ -0,0 +1,88 @@ +# CodeQL query tables + +This pipeline creates autogenerated documentation for docs.github.com from the query suites included with the [CodeQL bundle](https://github.com/github/codeql-action/releases). + +The pipeline generates Markdown tables that are stored in reusable files and used in article pages on the docs.github.com site. + +There are two types of query table generators: + +1. **Security queries** (`generate-code-scanning-query-list.ts`) - generates tables for security-related queries from the `code-scanning` and `security-extended` suites, including CWE information and autofix support. +2. **Code quality queries** (`generate-code-quality-query-list.ts`) - generates tables for code quality queries from the `code-quality` suite, showing query categories (reliability, maintainability). + +## How does it work + +```mermaid +--- +title: "Process for generating CodeQL query tables" +--- +flowchart TB + +accDescr: A flow chart describing how the automation generates documentation for CodeQL queries. + + start([Start]) --> checkout[Checkout the codeql repository] + start --> download[Download the CodeQL CLI] + + checkout --> security-suites[fa:fa-file Security query suites *.qls] + checkout --> quality-suites[fa:fa-file Quality query suites *.qls] + + security-suites --> generate-security[Generate security tables] + quality-suites --> generate-quality[Generate quality tables] + + download --> codeql-cli[CodeQL CLI: codeql.exe] + codeql-cli --> generate-security + codeql-cli --> generate-quality + + generate-security --> security-markdown[fa:fa-file Security reusables *.md] + generate-quality --> quality-markdown[fa:fa-file Quality reusables *.md] + + security-markdown --> merge[Merge artifacts] + quality-markdown --> merge + + merge --> pr[Generate a PR with both:
data/reusables/code-scanning/codeql-query-tables/*.md
data/reusables/code-quality/codeql-query-tables/*.md] + pr --> finish([End]) + +%% Define styles + classDef start fill:#1AAC9D, color:white + classDef action fill:#6557F6, color:white + classDef finish fill:#F8C324, color:white + classDef file fill:#ddd + +%% Assign styles + class start start; + class finish finish; + class checkout,download,generate-security,generate-quality,merge,pr action; + class security-markdown,quality-markdown,security-suites,quality-suites,codeql-cli file; +``` + +A [workflow](../../.github/workflows/generate-codeql-query-lists.yml) is used to trigger the automation of the CodeQL query tables documentation. The workflow is manually triggered by a member of the GitHub Docs team approximately every two weeks to align to releases of the CodeQL CLI. The workflow takes an input parameter that specifies the branch to pull the source files from in the codeql repo. If the branch input is omitted, the workflow will default to the `main` branch. + +The workflow runs two scripts in parallel: +- `npm run generate-code-scanning-query-list` - generates security query tables under `data/reusables/code-scanning/codeql-query-tables/` +- `npm run generate-code-quality-query-list` - generates code quality query tables under `data/reusables/code-quality/codeql-query-tables/` + +The workflow automatically creates a new pull request with changes from both scripts and the label `codeql-query-tables`. + +## Local development + +To run the pipeline locally, see the comments in the scripts: +- Security queries: [generate-code-scanning-query-list.ts](scripts/generate-code-scanning-query-list.ts) +- Code quality queries: [generate-code-quality-query-list.ts](scripts/generate-code-quality-query-list.ts) + +## Content team + +The content writers can use the reusables in any content article. They have no need to make any changes to the scripts unless additional built-in query suites are added. + +For security queries, reusables are stored in `data/reusables/code-scanning/codeql-query-tables/`. +For code quality queries, reusables are stored in `data/reusables/code-quality/codeql-query-tables/`. + +## How to get help + +### For workflow and script problems + +Slack: `#docs-engineering` +Repo: `github/docs-engineering` + +### For CodeQL repository and CLI problems + +Slack: `#code-scanning-engine-quality` +Repo: `github/code-scanning-engine-quality-team` diff --git a/src/codeql-queries/scripts/generate-code-quality-query-list.ts b/src/codeql-queries/scripts/generate-code-quality-query-list.ts new file mode 100644 index 0000000000..a034820100 --- /dev/null +++ b/src/codeql-queries/scripts/generate-code-quality-query-list.ts @@ -0,0 +1,291 @@ +/** + * This script generates a block of Markdown that can be saved as a reusable. + * The reusable lists all the code quality queries for one programming language, with categories, as a Markdown table. + * + * To be able to execute this script, you need to have the CodeQL CLI installed. + * To do that, you need two things: + * + * 1. The directory where the github/codeql repo is cloned + * 2. The path to the executable `codeql` file. + * + * The directory where the github/codeql repo is cloned is needed because + * that's how it looks up files. You can set it up like this: + * + * cd /tmp + * git clone git@github.com:github/codeql.git + * cd codeql + * pwd + * + * To install the codeql executable, use `gh` like this: + * + * gh extension install github/gh-codeql + * gh codeql set-channel nightly + * gh codeql version + * + * Note that when you run the `gh codeql version` command, it will tell you + * where the executable is installed. For example: + * + * /Users/peterbe/.local/share/gh/extensions/gh-codeql/dist/nightly/codeql-bundle-20231204/codeql + * + * If you've git cloned github/codeql in /tmp/ now you can execute this script. + * For example, to generate the Markdown + * for Python: + * + * npm run generate-code-quality-query-list -- \ + * --codeql-path ~/.local/share/gh/extensions/gh-codeql/dist/nightly/codeql-bundle-20231204/codeql \ + * --codeql-dir /tmp/codeql python | tee /tmp/python.md + * less /tmp/python.md + */ + +import fs from 'fs' +import { execFileSync } from 'child_process' + +import chalk from 'chalk' +import { program } from 'commander' + +program + .description('Generate a reusable Markdown for code quality queries by language') + .option('--verbose', 'Verbose outputs') + .option('--codeql-path ', 'path to the codeql executable', 'codeql') + .option('--codeql-dir ', 'path to the codeql executable', '.codeql/') + .option('-o, --output-file ', 'output file path (default: stdout)', 'stdout') + .argument('', 'for example java') + .parse(process.argv) + +type Options = { + codeqlPath: string + codeqlDir: string + outputFile: string + verbose: boolean +} + +type QueryMetadata = { + id?: string + name?: string + tags?: string + severity?: string + problem?: { + severity?: string + } +} + +type Query = { + name: string + url: string + categories: string[] + severity: string +} + +type QueryExtended = Query & { + primaryCategory: string +} + +const opts = program.opts() +main( + { + codeqlPath: opts.codeqlPath, + codeqlDir: opts.codeqlDir, + outputFile: opts.outputFile, + verbose: Boolean(opts.verbose), + }, + program.args[0], +) + +async function main(options: Options, language: string) { + if (options.verbose && options.outputFile === 'stdout') { + console.warn(chalk.yellow('Verbose mode is on but output is going to stdout')) + } + + if (!testCodeQLPath(options)) { + process.exit(1) + } + + const queries: { + [id: string]: Query + } = {} + + const languagePack = `${language}-code-quality.qls` + if (options.verbose) console.log(chalk.dim(`Searching for queries in ${languagePack}`)) + const res = execFileSync( + options.codeqlPath, + ['resolve', 'queries', `--search-path=${options.codeqlDir}`, languagePack], + { + encoding: 'utf-8', + }, + ) + for (const line of res.split('\n')) { + if (line.trim()) { + if (options.verbose) console.log('found', line) + const metadata = getMetadata(options, line) + const { id, name, tags, severity } = metadata + if (id && name) { + const categories = getCategories(tags || '') + const url = getDocsLink(language, id) + + // Only include queries that have categories + if (categories.length) { + queries[id] = { url, name, categories, severity: severity || 'N/A' } + } else { + if (options.verbose) { + console.log(chalk.dim(`Skipping ${id} because it has no categories`)) + } + } + } + } + } + + function decorate(query: Query): QueryExtended { + // Determine primary category for sorting + // Prefer 'maintainability' over 'reliability' + const primaryCategory = query.categories.includes('maintainability') + ? 'maintainability' + : query.categories.includes('reliability') + ? 'reliability' + : query.categories[0] || '' + + return { + ...query, + primaryCategory, + } + } + + const entries = Object.values(queries).map(decorate) + + // Sort by primary category (maintainability first), then alphabetically by name + entries.sort((a, b) => { + if (a.primaryCategory === 'maintainability' && b.primaryCategory !== 'maintainability') + return -1 + else if (a.primaryCategory !== 'maintainability' && b.primaryCategory === 'maintainability') + return 1 + + if (a.primaryCategory === 'reliability' && b.primaryCategory !== 'reliability') return -1 + else if (a.primaryCategory !== 'reliability' && b.primaryCategory === 'reliability') return 1 + + return a.name.localeCompare(b.name) + }) + + printQueries(options, entries) +} + +function printQueries(options: Options, queries: QueryExtended[]) { + const markdown: string[] = [] + markdown.push('{% rowheaders %}') + markdown.push('') // blank line + const header = ['Query name', 'Category', 'Severity'] + markdown.push(`| ${header.join(' | ')} |`) + markdown.push(`| ${header.map(() => '---').join(' | ')} |`) + + for (const query of queries) { + const markdownLink = `[${query.name}](${query.url})` + // Capitalize first letter of category for display + const categoryDisplay = query.categories + .map((cat) => cat.charAt(0).toUpperCase() + cat.slice(1)) + .join(', ') + // Capitalize first letter of severity for display + const severityDisplay = query.severity.charAt(0).toUpperCase() + query.severity.slice(1) + const row = [markdownLink, categoryDisplay, severityDisplay] + markdown.push(`| ${row.join(' | ')} |`) + } + markdown.push('') // blank line + markdown.push('{% endrowheaders %}') + markdown.push('') // always end with a blank line + + if (options.outputFile === 'stdout') { + console.log(markdown.join('\n')) + } else { + fs.writeFileSync(options.outputFile, markdown.join('\n'), 'utf-8') + } +} + +function getMetadata(options: Options, queryFile: string): QueryMetadata { + const metadataJson = execFileSync(options.codeqlPath, ['resolve', 'metadata', queryFile], { + encoding: 'utf-8', + }) + const parsed = JSON.parse(metadataJson) + + // Extract severity from various possible locations in the metadata + // CodeQL metadata can have @problem.severity in the query file, which may be + // represented in different ways in the JSON output from `codeql resolve metadata` + const severity = + parsed.problem?.severity || // Nested: { problem: { severity: "error" } } + parsed['@problem']?.severity || // Nested with @: { "@problem": { severity: "error" } } + parsed['@problem.severity'] || // Direct key: { "@problem.severity": "error" } + parsed['problem.severity'] || // Direct key without @: { "problem.severity": "error" } + parsed.severity || // Simple: { severity: "error" } + parsed['@severity'] // With @: { "@severity": "error" } + + if (options.verbose) { + // On first query only, show all available keys to help debug + if (!getMetadata.shownKeys) { + console.log(chalk.yellow('Available metadata keys:'), Object.keys(parsed)) + if (parsed.problem) { + console.log(chalk.yellow('Available problem keys:'), Object.keys(parsed.problem)) + } + if (parsed['@problem']) { + console.log(chalk.yellow('Available @problem keys:'), Object.keys(parsed['@problem'])) + } + getMetadata.shownKeys = true + } + if (severity) { + console.log(chalk.dim(`Query ${parsed.id} has severity: ${severity}`)) + } else { + console.log(chalk.red(`Query ${parsed.id} has NO severity found`)) + console.log(chalk.red('Available keys for this query:'), Object.keys(parsed)) + } + } + + return { + ...parsed, + severity, + } +} + +// Add a property to track if we've shown keys +getMetadata.shownKeys = false + +/** + * + * @param language 'cpp' + * @param queryId 'external-entity-expansion' + * @returns https://codeql.github.com/codeql-query-help/cpp/cpp-external-entity-expansion/ + */ +function getDocsLink(language: string, queryId: string) { + return `https://codeql.github.com/codeql-query-help/${language}/${queryId.replaceAll('/', '-')}/` +} + +/** + * + * @param tags 'maintainability readability reliability external/cwe/cwe-1078 external/cwe/cwe-670 security' + * @returns ['maintainability', 'reliability'] + */ +function getCategories(tags: string) { + const categories: string[] = [] + for (const tag of tags.split(/\s+/g)) { + if (tag === 'maintainability' || tag === 'reliability') { + categories.push(tag) + } + } + return categories +} + +function testCodeQLPath(options: Options) { + try { + const output = execFileSync(options.codeqlPath, ['--version'], { encoding: 'utf-8' }) + if (options.verbose) { + const matched = output.match(/CodeQL command-line toolchain release ([\d.+]+)/) + if (matched) { + console.log('codeql version', chalk.green(matched[0])) + return true + } + } + return true + } catch (error) { + console.error('Could not find codeql executable at', options.codeqlPath) + if (options.verbose) { + throw error + } else { + console.log(chalk.yellow(`${options.codeqlPath} --version`), 'failed') + return false + } + } +} diff --git a/src/code-scanning/scripts/generate-code-scanning-query-list.ts b/src/codeql-queries/scripts/generate-code-scanning-query-list.ts similarity index 98% rename from src/code-scanning/scripts/generate-code-scanning-query-list.ts rename to src/codeql-queries/scripts/generate-code-scanning-query-list.ts index d02e6e3114..8dfa75149b 100644 --- a/src/code-scanning/scripts/generate-code-scanning-query-list.ts +++ b/src/codeql-queries/scripts/generate-code-scanning-query-list.ts @@ -53,7 +53,8 @@ import chalk from 'chalk' import { program } from 'commander' // We don't want to introduce a global dependency on @github/cocofix, so we install it by hand // as described above and suppress the import warning. -import { getSupportedQueries } from '@github/cocofix/dist/querySuites' /* eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved */ +// eslint-disable-next-line import/no-unresolved -- @github/cocofix is installed manually +import { getSupportedQueries } from '@github/cocofix/dist/querySuites' import type { Language } from 'codeql-ts' program diff --git a/src/codeql-queries/scripts/tsconfig.json b/src/codeql-queries/scripts/tsconfig.json new file mode 100644 index 0000000000..ebbc6a4ae1 --- /dev/null +++ b/src/codeql-queries/scripts/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../../tsconfig.json", + "include": ["generate-code-scanning-query-list.ts", "generate-code-quality-query-list.ts"], + "exclude": ["node_modules"] +} diff --git a/tsconfig.json b/tsconfig.json index d6800988c9..5da89e0e02 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,7 +35,8 @@ "exclude": [ "node_modules", "docs-internal-data", - "src/code-scanning/scripts/generate-code-scanning-query-list.ts" + "src/codeql-queries/scripts/generate-code-scanning-query-list.ts", + "src/codeql-queries/scripts/generate-code-quality-query-list.ts" ], "include": [ "**/*.ts",