Skip to content

refactor: Decompose next_occurrence into per-recurrence functions#135

Merged
2witstudios merged 1 commit intomainfrom
pu/refactor-schedule
Mar 10, 2026
Merged

refactor: Decompose next_occurrence into per-recurrence functions#135
2witstudios merged 1 commit intomainfrom
pu/refactor-schedule

Conversation

@2witstudios
Copy link
Owner

Summary

  • Split monolithic next_occurrence match with 6 inline date-math arms into focused functions (next_daily_occurrence, next_weekly_occurrence, etc.)
  • Extract shared naive_at_base_time helper eliminating 3 identical and_hms_opt blocks
  • next_occurrence is now a 6-line dispatcher

Baseline (from churn analysis)

Metric Before
LoC 658
Cx 51
Density 20%

Test plan

  • Run cargo test — existing schedule tests validate all recurrence types
  • Run npx aidd churn to compare metrics

🤖 Generated with Claude Code

Split monolithic match with 6 inline date-math arms into focused
functions (next_daily_occurrence, next_weekly_occurrence, etc.) and
extract shared naive_at_base_time helper. Reduces per-function Cx
while preserving exact date math behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Warning

Rate limit exceeded

@2witstudios has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b211b69f-ffc0-47f9-a23d-100b883ef0d9

📥 Commits

Reviewing files that changed from the base of the PR and between 9bbaf05 and 184c76b.

📒 Files selected for processing (1)
  • crates/pu-core/src/schedule_def.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pu/refactor-schedule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@2witstudios 2witstudios merged commit 7be0ee4 into main Mar 10, 2026
5 checks passed
@2witstudios 2witstudios deleted the pu/refactor-schedule branch March 10, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant