style(SAPEREGradient): simplify gradient processing and enhance readability#5313
style(SAPEREGradient): simplify gradient processing and enhance readability#5313
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the neighborhood gradient discovery logic in SAPEREGradient to make gradient processing more readable by extracting helper methods from a large procedural block.
Changes:
- Refactored
GradientSearch.executeby extracting match preparation, variable binding, compatibility checks, and candidate update logic into dedicated private methods. - Simplified control flow with early exits and helper predicates for threshold/compatibility checks.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5313 +/- ##
=========================================
Coverage 61.53% 61.53%
Complexity 14 14
=========================================
Files 2 2
Lines 78 78
Branches 4 4
=========================================
Hits 48 48
Misses 24 24
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
c459ab4 to
9bfc521
Compare
…model/sapere/reactions/SAPEREGradient.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
9bfc521 to
94d9a0b
Compare
|
## [43.0.43](43.0.42...43.0.43) (2026-04-29) ### Dependency updates * **core-deps:** update protelis to v18.8.1 (patch) ([#5310](#5310)) ([3e92b8a](3e92b8a)) * **core-deps:** update react to v2026.4.14-19.2.5 (patch) ([#5322](#5322)) ([59cf000](59cf000)) * **deps:** update dependency org.danilopianini.gradle-java-qa:org.danilopianini.gradle-java-qa.gradle.plugin to v1.175.0 ([#5309](#5309)) ([b7c3933](b7c3933)) * **deps:** update gradle to v9.5.0 ([#5315](#5315)) ([72ef7c4](72ef7c4)) * **deps:** update plugin gitsemver to v7.0.18 ([#5314](#5314)) ([886c6c2](886c6c2)) * **deps:** update plugin org.danilopianini.gradle-pre-commit-git-hooks to v2.1.16 ([#5320](#5320)) ([3d6385b](3d6385b)) * **deps:** update plugin publishoncentral to v9.2.2 ([#5321](#5321)) ([3a5c02a](3a5c02a)) ### Documentation * **deps:** update gohugoio/hugo action to v0.161.0 ([#5316](#5316)) ([c38e869](c38e869)) ### General maintenance * **build:** update the javadoc.io cache ([1cdef2b](1cdef2b)) * **build:** update the javadoc.io cache ([cd476f3](cd476f3)) ### Style improvements * **cognitive-agents:** drop useless parenthesis in `TestSteeringBehaviors` ([#5319](#5319)) ([4333dec](4333dec)) * **SAPEREGradient:** simplify gradient processing and enhance readability ([#5313](#5313)) ([7e1cc10](7e1cc10))
|
🎉 This PR is included in version 43.0.43 🎉 The release is available on:
Your semantic-release bot 📦🚀 |



No description provided.