Bound.qll - Replace utility for range analysis duplicate across java and cs with shared file#21900
Open
BazookaMusic wants to merge 9 commits into
Open
Bound.qll - Replace utility for range analysis duplicate across java and cs with shared file#21900BazookaMusic wants to merge 9 commits into
BazookaMusic wants to merge 9 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces Java/C# duplication in range analysis by introducing a shared Bound library under codeql/rangeanalysis and switching the language-specific libraries to instantiate it via per-language definition modules.
Changes:
- Added
shared/rangeanalysis/codeql/rangeanalysis/Bound.qllas the shared implementation. - Updated Java and C# bound libraries to use the shared implementation via
BoundSpecific::BoundDefs. - Updated packaging/config to support the new shared dependency and removed the now-obsolete “identical files” entry.
Show a summary per file
| File | Description |
|---|---|
| shared/rangeanalysis/codeql/rangeanalysis/Bound.qll | Introduces shared bound abstractions and a parameterized Bound module. |
| java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/BoundSpecific.qll | Defines Java bindings (BoundDefs) implementing the shared bound signature. |
| java/ql/lib/semmle/code/java/dataflow/Bound.qll | Replaces the Java-specific bound implementation with an instantiation of the shared module. |
| csharp/ql/lib/semmle/code/csharp/dataflow/internal/rangeanalysis/BoundSpecific.qll | Defines C# bindings (BoundDefs) implementing the shared bound signature. |
| csharp/ql/lib/semmle/code/csharp/dataflow/Bound.qll | Replaces the C#-specific bound implementation with an instantiation of the shared module. |
| csharp/ql/lib/qlpack.yml | Adds the codeql/rangeanalysis dependency required by the new shared import. |
| config/identical-files.json | Removes the Java/C# “Bound” identical-files entry since the code is now shared. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 2
| predicate interestingExprBound(Expr e); | ||
| } | ||
|
|
||
| /** Provides classes for representing abstract bounds for use in, for example, range analysis. */ |
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.
We have this doc of identical files across languages: https://github.com/github/codeql/blob/main/config/identical-files.json
As an exercise, I created a shared library and removed the duplication between CS and Java.