-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: Fix some Ql4Ql violations. #20328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes various Ql4Ql violations across Java CodeQL files, focusing on code quality improvements based on specific checks like field usage optimization, casting opportunities, parameter naming consistency, and documentation accuracy.
- Updates code patterns to use more efficient constructs (e.g.,
not exists()
instead ofcount() = 0
) - Corrects spelling errors and improves parameter documentation consistency
- Refactors conditional logic to eliminate unnecessary if-then-else patterns
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
java/ql/src/utils/flowtestcasegenerator/FlowTestCase.qll | Updates parameter names in documentation comments for clarity |
java/ql/src/experimental/quantum/Examples/BrokenCrypto.ql | Fixes spelling from "MODELLING" to "MODELING" |
java/ql/src/experimental/quantum/Analysis/ArtifactReuse.qll | Simplifies exists pattern by removing unnecessary variable |
java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql | Corrects parameter name in documentation |
java/ql/src/Violations of Best Practice/Magic Constants/MagicConstants.qll | Fixes spelling of "occurrence" in predicate names |
java/ql/src/Likely Bugs/Termination/SpinOnField.ql | Replaces count-based checks with more efficient exists patterns |
java/ql/src/Likely Bugs/Concurrency/NotifyWithoutSynch.ql | Adds missing parameter documentation |
java/ql/src/Likely Bugs/Comparison/HashedButNoHash.ql | Updates predicate documentation format |
java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll | Corrects parameter name in documentation |
java/ql/lib/semmle/code/java/security/TempDirUtils.qll | Improves parameter documentation clarity |
java/ql/lib/semmle/code/java/security/FileWritable.qll | Fixes parameter name in documentation |
java/ql/lib/semmle/code/java/security/CleartextStorageAndroidFilesystemQuery.qll | Corrects parameter name in documentation |
java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll | Replaces count-based logic with exists patterns |
java/ql/lib/semmle/code/java/frameworks/Mockito.qll | Simplifies if-then-else logic and removes unnecessary field |
java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll | Adds missing parameter names in documentation |
java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll | Updates parameter names in location documentation |
java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll | Enhances documentation with missing parameter details |
java/ql/lib/semmle/code/java/Statement.qll | Adds missing parameter names in documentation |
java/ql/lib/semmle/code/java/Conversions.qll | Removes unused field and moves logic into constructor |
java/ql/lib/semmle/code/java/Concurrency.qll | Adds missing parameter documentation |
java/ql/lib/printAst.ql | Adds missing parameter names in documentation |
java/ql/lib/experimental/quantum/Language.qll | Fixes spelling from "modelled" to "modeled" |
java/ql/lib/experimental/quantum/JCA.qll | Fixes spelling, removes unused fields, and simplifies expressions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One inline comment, otherwise LGTM.
Co-authored-by: Anders Schack-Mulligen <[email protected]>
Fix some Ql4Ql violations based on the following checks
ql/field-only-used-in-charpred
ql/could-be-cast
ql/counting-to-zero
ql/dataflow-module-naming-convention
ql/if-with-none
ql/missing-parameter-qldoc
ql/misspelling
DCA looks good.