fix: code quality improvements#2502
Conversation
- Fix bug: return err instead of closeErr in DecodeData error path (httpx.go) - Improve error handling for strconv.Atoi calls in multiple locations - Change hammingDistanceThreshold from var to const since it's never modified - Fix redundant return statement in ListFilesWithPattern - Improve port parsing to handle empty port strings explicitly
Revert the defensive strconv.Atoi guard around the SkipDedupe branches: values stored in r.hm are always integer strings written by this same code path, so the parseErr/cnt>0 check is unreachable in practice, and when taken literally it skipped the numHosts/numTargets increment for duplicate inputs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR improves error handling and parsing robustness across four modules. File glob operations now correctly return success without propagating errors. HTTP response handling validates decode errors and Content-Length header parsing explicitly. Port parsing in both JARM and runner now defensively checks for non-empty input and validates conversion success. Runner's hashing threshold becomes a compile-time constant. ChangesDefensive error handling and parsing improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Code quality improvements for httpx.
Summary by CodeRabbit
Bug Fixes