refactor: extract helpers to reduce pylint complexity - #834
Open
renansuaris wants to merge 2 commits into
Open
Conversation
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b80c1a6. Configure here.
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 change do?
Refactors the
too-many-statementsviolations reported by Pylint in large methods across the codebase by extracting parts of the logic into smaller private helpers.Why is this needed?
The affected methods were handling too many responsibilities in a single block, which made them harder to read, test, and maintain. Splitting the logic into smaller helpers reduces complexity while keeping the external behavior unchanged.
What changed?
How was it tested?
Notes for reviewers
Note
Low Risk
Mechanical refactors with no intended behavior change; the only new contract assertion is dry-run monitoring keys, while query and schema logic was moved without API changes.
Overview
Splits oversized methods into private helpers to satisfy Pylint complexity limits while keeping behavior the same.
Datetime hash migration (
datetime_migration.py): per-key hash scanning, byte normalization, and datetime field updates move into_collect_hash_keys,_normalize_hash_data, and_process_hash_key;_process_hash_modelonly batches and delegates.Data migrator monitoring (
migrator.py): pending-migration logging, result dict assembly, and verbose summary printing move to_log_pending_migrations,_build_monitoring_result, and_log_monitoring_summary. Dry-run results still omitsuccess_rateand setdry_run: True—covered by a new test intests/test_data_migrator.py.Core model (
model.py): RediSearch query value resolution is decomposed by field type (_resolve_text_value,_resolve_numeric_value,_resolve_tag_value, etc.); queryexecuteis split into build-args, run command, and parse results;ModelMeta.__new__and JSON indexschema_for_typerecursion are broken into smaller static/class methods with the same orchestration flow.Reviewed by Cursor Bugbot for commit 3abe023. Bugbot is set up for automated code reviews on this repo. Configure here.