Shared: update code comments explaining models-as-data format to include barriers and barrier guards#21584
Open
owen-mc wants to merge 7 commits intogithub:mainfrom
Open
Shared: update code comments explaining models-as-data format to include barriers and barrier guards#21584owen-mc wants to merge 7 commits intogithub:mainfrom
owen-mc wants to merge 7 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Models-as-Data / API-graph model documentation comments across several languages to describe barrier and barrier-guard model formats, and to refine the description of neutral models.
Changes:
- Document Barriers and BarrierGuards row formats in multiple MaD / ApiGraph model comment blocks.
- Add/expand documentation for barrier-guard condition columns (
branch/acceptingvalue). - Adjust neutral-model description text in ExternalFlow docs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll | Updates MaD format comment to include barriers/guards and neutrals. |
| ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll | Documents Barriers/BarrierGuards rows and branch meaning for API-graph models. |
| python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModels.qll | Documents Barriers/BarrierGuards rows and branch meaning for API-graph models. |
| javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll | Documents Barriers/BarrierGuards rows and branch meaning for API-graph models. |
| java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll | Documents Barriers/BarrierGuards and adjusts neutral-model description. |
| go/ql/lib/semmle/go/dataflow/ExternalFlow.qll | Documents Barriers/BarrierGuards and provenance; adjusts neutral-model description. |
| csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll | Documents Barriers/BarrierGuards and adjusts neutral-model description. |
| cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll | Documents Barriers/BarrierGuards, acceptingvalue, and provenance. |
Comments suppressed due to low confidence (3)
cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll:96
- Minor grammar: "In future" should be "In the future," (or similar) in this sentence.
* "false". In future "no-exception", "not-zero", "null", "not-null" may be
* supported.
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:18
- The Neutrals row/description here doesn't match the rest of this module: the file defines
neutralModel(string path, string kind, string provenance, ...)and later stateskindcan besource,sink, orsummary. Please align the Neutrals row columns and the neutral explanation with theneutralModelpredicate and its documented effect below.
* - Neutrals:
* `package; type; name; signature; kind; provenance`
* A neutral is used to indicate that a callable is neutral with respect to flow (no summary).
rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll:46
- This description says the barrier-guard
branchcolumn may support values like "no-exception"/"not-zero" in the future, but thebarrierGuardModeldocumentation below statesbranchis eithertrueorfalse(a branch selector). To avoid conflicting documentation, either keepbranchrestricted to true/false here or update the laterbarrierGuardModeldocs to match the intended semantics.
* 3. The `branch` column of barrier guard models specifies which branch of the
* guard is blocking flow. It can be "true" or "false". In future
* "no-exception", "not-zero", "null", "not-null" may be supported.
a782c0f to
1d0e402
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have also copied some sections that were missing for some languages and corrected the explanation of neutral models. These changes have been done in separate commits.