RUM-16478: UnsafeThirdPartyFunctionCall improvements#3557
Open
satween wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3557 +/- ##
===========================================
+ Coverage 72.52% 72.56% +0.04%
===========================================
Files 978 978
Lines 36052 36045 -7
Branches 6038 6040 +2
===========================================
+ Hits 26146 26155 +9
+ Misses 8234 8220 -14
+ Partials 1672 1670 -2
🚀 New features to boost your workflow:
|
hamorillo
reviewed
Jun 19, 2026
hamorillo
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Just leaving a question before approving.
jonathanmos
reviewed
Jun 23, 2026
abrooksv
reviewed
Jun 25, 2026
Add validateSortedWithinClasses to DetektConfigValidator so knownSafeCalls and knownThrowingCalls entries must be in alphabetical order within each class group; sort both YAML config files accordingly. Adds wildcard support and overlap detection to the rule, and splits it into focused modules. Wildcards: YAML entries in knownSafeCalls/knownThrowingCalls now accept per-parameter wildcards — * (any non-nullable type) and ? (any nullable type). Valid only at generic parameter positions; misuse throws IllegalStateException. Overlap detection: Rejects entries that are both safe and throwing, and catches duplicate/overlapping patterns within each list. Removed 17 pre-existing duplicates plus two genuine conflicts (Thread.interrupt(), Array.first(Function1)). Config cleanup: Collapsed repeated generic-parameter entries to wildcards across safe-calls and detekt configs. Refactor: RulesParser (YAML parsing), CodeParser (call-expression extraction), WildcardPattern (matching + validation); the rule now keeps only visitor wiring and the safe/throwing/unknown decision.
af9aead to
19360e7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19360e721c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
What does this PR do?
UnsafeThirdPartyFunctionCalldetekt rule.*means any non-null type,?means any nullable type.UnsafeThirdPartyFunctionCallis now divided into three subclasses:CodeParserfor Kotlin code parsing, andDetektConfigValidatorandDetektConfigParserfor YAML config parsing and validation.detekt_custom_unsafe_calls.ymlanddetekt_custom_safe_calls.ymlhave been cleaned up according to the new rules.Motivation
An approach to reduce time to green build for each ticket. Fewer retries means less time and lower resource consumption.
Review checklist (to be filled by reviewers)