Add detekt - #84
Conversation
PR Summary by QodoAdd Detekt static analysis with baseline and code cleanups
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds a Detekt baseline, exposes GTFS time values as public constructor properties, updates related consumers, and applies formatting, naming, exception, and documentation cleanup. ChangesDetekt and Kotlin cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
There was a problem hiding this comment.
Pull request overview
This PR appears intended to support adopting Detekt (per linked issue #226) by adding a Detekt baseline and making a set of Kotlin refactors/formatting changes that look aligned with static-analysis cleanup (line wrapping, unused catch parameter, loop style, naming, and a suppression).
Changes:
- Add
detekt-baseline.xmlto baseline existing Detekt findings. - Apply formatting/naming/style adjustments across parser + GTFS model code (regex builders, loops, variable names, catch parameter).
- Adjust GTFS
GStopTime/GFrequencydata classes to expose time fields directly and update call sites accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/org/mtransit/parser/mt/MDirectionHeadSignFinderTest.kt | Moves an inline comment into KDoc above a test method. |
| src/main/java/org/mtransit/parser/mt/MReader.kt | Reformats regex factory helpers to multi-line Regex(...) calls. |
| src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt | Adds a Detekt suppression and updates GStopTime.copy(...) named args to match renamed fields. |
| src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt | Wraps long calls/log strings onto multiple lines. |
| src/main/java/org/mtransit/parser/mt/data/MSchedule.kt | Renames a local variable to better reflect meaning. |
| src/main/java/org/mtransit/parser/gtfs/data/GStopTime.kt | Renames primary-constructor time fields to arrivalTime/departureTime and updates related methods. |
| src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt | Replaces inline enum comments with KDoc blocks. |
| src/main/java/org/mtransit/parser/gtfs/data/GFrequency.kt | Renames primary-constructor time fields to startTime/endTime and updates related methods. |
| src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt | Replaces forEach with a for loop. |
| src/main/java/org/mtransit/commons/CloseableUtils.kt | Avoids an unused exception variable by renaming it to _. |
| detekt-baseline.xml | Adds a Detekt baseline file for existing issues. |
Suppressed comments (1)
src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt:28
- KDoc typo: "pathways define" should be "pathways defined".
* A location within a station, not matching any other location_type, that may be used to link together pathways define in pathways.txt.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…parser': - commons: Add `detekt` mtransitapps/commons#836 - commons-android: Add `detekt` mtransitapps/commons-android#193 - commons-java: Add `detekt` mtransitapps/commons-java#46 - parser: Add `detekt` mtransitapps/parser#84
detektto validate Kotlin code. mtransit-for-android#226