From 47a72fc9d958007555240e92be4cd84fa8e56dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 14:17:26 -0400 Subject: [PATCH 1/6] Add `detekt` - https://github.com/mtransitapps/mtransit-for-android/issues/226 --- detekt-baseline.xml | 6 ++++ .../parser/gtfs/data/GLocationType.kt | 36 ++++++++++++++++--- .../mtransit/parser/mt/MDataChangedManager.kt | 14 ++++++-- .../parser/mt/MDirectionHeadSignFinder.kt | 1 + .../java/org/mtransit/parser/mt/MReader.kt | 15 ++++---- .../org/mtransit/parser/mt/data/MSchedule.kt | 6 ++-- .../parser/mt/MDirectionHeadSignFinderTest.kt | 5 ++- 7 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 detekt-baseline.xml diff --git a/detekt-baseline.xml b/detekt-baseline.xml new file mode 100644 index 00000000..4d1a6d7d --- /dev/null +++ b/detekt-baseline.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt b/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt index debaccc7..ee65b260 100644 --- a/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt +++ b/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt @@ -3,11 +3,37 @@ package org.mtransit.parser.gtfs.data // https://gtfs.org/schedule/reference/#stopstxt enum class GLocationType(val id: Int) { - STOP_PLATFORM(0), // Stop (or Platform). A location where passengers board or disembark from a transit vehicle. Is called a platform when defined within a parent_station. - STATION(1), // Station. A physical structure or area that contains one or more platform. - ENTRANCE_EXIT(2), // Entrance/Exit. A location where passengers can enter or exit a station from the street. If an entrance/exit belongs to multiple stations, it may be linked by pathways to both, but the data provider must pick one of them as parent. - GENERIC_NODE(3), // Generic Node. A location within a station, not matching any other location_type, that may be used to link together pathways define in pathways.txt. - BOARDING_AREA(4) // Boarding Area. A specific location on a platform, where passengers can board and/or alight vehicles. + /** + * Stop (or Platform). + * A location where passengers board or disembark from a transit vehicle. + * Is called a platform when defined within a parent_station. + */ + STOP_PLATFORM(0), + + /** + * Station. + * A physical structure or area that contains one or more platform. + */ + STATION(1), + + /** + * Entrance/Exit. + * A location where passengers can enter or exit a station from the street. + * If an entrance/exit belongs to multiple stations, it may be linked by pathways to both, but the data provider must pick one of them as parent. + */ + ENTRANCE_EXIT(2), + + /** + * Generic Node. + * A location within a station, not matching any other location_type, that may be used to link together pathways define in pathways.txt. + */ + GENERIC_NODE(3), + + /** + * Boarding Area. + * A specific location on a platform, where passengers can board and/or alight vehicles. + */ + BOARDING_AREA(4) ; companion object { diff --git a/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt b/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt index 8babd1ac..52c1ecf6 100644 --- a/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt +++ b/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt @@ -40,7 +40,9 @@ object MDataChangedManager { if (gCalendarDateToAdd.date in lastStartDate..lastEndDate) { return false // same date range } - val diffInMs = DefaultAgencyTools.diffInMs(GFieldTypes.makeDateFormat(), Calendar.getInstance(), p.todayStringInt, gCalendarDateToAdd.date).absoluteValue + val diffInMs = DefaultAgencyTools.diffInMs( + GFieldTypes.makeDateFormat(), Calendar.getInstance(), p.todayStringInt, gCalendarDateToAdd.date + ).absoluteValue if (diffInMs < MIN_NOT_IGNORED_IN_DAYS.days.inWholeMilliseconds) { return false // too soon to ignore } @@ -203,7 +205,10 @@ object MDataChangedManager { } val updatedCalendar = originalCalendar.copy(startDate = removedServiceDate.calendarDate) if (updatedCalendar.dates.size - originalCalendar.dates.size != 1) { - MTLog.log("> Cannot re-add removed dates because of wrong number of added dates (${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})") + MTLog.log( + "> Cannot re-add removed dates because of wrong number of added dates " + + "(${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})" + ) return } newGCalendars.remove(originalCalendar) @@ -304,7 +309,10 @@ object MDataChangedManager { } val updatedCalendar = originalCalendar.copy(endDate = dayBeforeRemovedDate) if (originalCalendar.dates.size - updatedCalendar.dates.size != 1) { - MTLog.log("> Cannot remove added dates because of wrong number of added dates (${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})") + MTLog.log( + "> Cannot remove added dates because of wrong number of added dates " + + "(${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})" + ) return } newGCalendars.remove(originalCalendar) diff --git a/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt b/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt index db1a144e..5693e673 100644 --- a/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt +++ b/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt @@ -32,6 +32,7 @@ object MDirectionHeadSignFinder { private const val MIN_HEAD_SIGN_COUNT_PERCENT = .67f + @Suppress("DestructuringDeclarationWithTooManyEntries") @JvmStatic fun findDirectionHeadSigns(routeId: Long, gRouteTrips: List, routeGTFS: GSpec, agencyTools: GAgencyTools): Map { val directionHeadSigns = mutableMapOf() diff --git a/src/main/java/org/mtransit/parser/mt/MReader.kt b/src/main/java/org/mtransit/parser/mt/MReader.kt index 39dd4655..c4be8b61 100644 --- a/src/main/java/org/mtransit/parser/mt/MReader.kt +++ b/src/main/java/org/mtransit/parser/mt/MReader.kt @@ -47,14 +47,17 @@ object MReader { // region first/last departures - private fun makeFirstDepartureRegex(fileBase: String) = - Regex(any(WHITESPACE_CAR) + "${group(oneOrMore(DIGIT_CAR))}" + any(ANY)) + private fun makeFirstDepartureRegex(fileBase: String) = Regex( + any(WHITESPACE_CAR) + "${group(oneOrMore(DIGIT_CAR))}" + any(ANY) + ) - private fun makeLastDepartureRegex(fileBase: String) = - Regex(any(WHITESPACE_CAR) + "${group(oneOrMore(DIGIT_CAR))}" + any(ANY)) + private fun makeLastDepartureRegex(fileBase: String) = Regex( + any(WHITESPACE_CAR) + "${group(oneOrMore(DIGIT_CAR))}" + any(ANY) + ) - private fun makeTimeZoneRegex() = - Regex(any(WHITESPACE_CAR) + "${group(oneOrMore(ALPHA_NUM_CAR) + "/" + oneOrMore(ALPHA_NUM_CAR))}") + private fun makeTimeZoneRegex() = Regex( + any(WHITESPACE_CAR) + "${group(oneOrMore(ALPHA_NUM_CAR) + "/" + oneOrMore(ALPHA_NUM_CAR))}" + ) @Suppress("unused") // TODO removed @JvmStatic diff --git a/src/main/java/org/mtransit/parser/mt/data/MSchedule.kt b/src/main/java/org/mtransit/parser/mt/data/MSchedule.kt index ea22632d..d1551e86 100644 --- a/src/main/java/org/mtransit/parser/mt/data/MSchedule.kt +++ b/src/main/java/org/mtransit/parser/mt/data/MSchedule.kt @@ -122,11 +122,11 @@ data class MSchedule( // MStopTime } if (FeatureFlags.F_EXPORT_TRIP_ID) { if (FeatureFlags.F_EXPORT_ARRIVAL_W_TRIP_ID) { - var arrivalDiff = (departure - arrival).takeIf { it > MIN_ARRIVAL_DIFF_IN_HH_MM_SS } + var departureArrivalDiff = (departure - arrival).takeIf { it > MIN_ARRIVAL_DIFF_IN_HH_MM_SS } if (FeatureFlags.F_SCHEDULE_IN_MINUTES) { - arrivalDiff = arrivalDiff?.div(100) // truncates the time to a minute that is closer to 0 + departureArrivalDiff = departureArrivalDiff?.div(100) // truncates the time to a minute that is closer to 0 } - add(arrivalDiff?.toString().orEmpty()) + add(departureArrivalDiff?.toString().orEmpty()) } add(_tripId.convertTripId(quotesString = true)) } diff --git a/src/test/java/org/mtransit/parser/mt/MDirectionHeadSignFinderTest.kt b/src/test/java/org/mtransit/parser/mt/MDirectionHeadSignFinderTest.kt index 32555a4e..460a04ed 100644 --- a/src/test/java/org/mtransit/parser/mt/MDirectionHeadSignFinderTest.kt +++ b/src/test/java/org/mtransit/parser/mt/MDirectionHeadSignFinderTest.kt @@ -453,8 +453,11 @@ class MDirectionHeadSignFinderTest { assertEquals("foo foo/trip head-sign", result?.headSign) } + /** + * should be same head-sign for same last stop, probably wrong data, use most popular / last stops + */ @Test - fun testFindDirectionHeadSign_TripsWithMoreStopsMultipleHeadSignInclShorterTrips() { // should be same head-sign for same last stop, probably wrong data, use most popular / last stops + fun testFindDirectionHeadSign_TripsWithMoreStopsMultipleHeadSignInclShorterTrips() { // Arrange val directionId = GDirectionId.NONE.id val tripId1 = "trip_id_1" From 0e5ac3df41d897e672e61c410f7a3271829dac61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 14:39:45 -0400 Subject: [PATCH 2/6] buildUponDefaultConfig = true --- detekt-baseline.xml | 208 ++++++++++++++++++ .../org/mtransit/commons/CloseableUtils.kt | 2 +- .../mtransit/parser/gtfs/data/GFrequency.kt | 20 +- .../mtransit/parser/gtfs/data/GStopTime.kt | 44 ++-- 4 files changed, 237 insertions(+), 37 deletions(-) diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 4d1a6d7d..04ee715e 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -2,5 +2,213 @@ + ComplexCondition:GRouteType.kt:GRouteType.Companion$routeType == EX_BUS_SERVICE.id || routeType == EX_DEMAND_AND_RESPONSE_BUS_SERVICE.id || routeType == EX_SHARE_TAXI_SERVICE.id || routeType == EX_COMMUNAL_TAXI_SERVICE.id + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$(stopIdIntsAfterCommonCount2 == 0 && stopIdIntsAfterCommonCount1 == 0) // #1 & #2 have same last stop || (dataLossAuthorized && (stopIdIntsAfterCommonCount2 > 0 && stopIdIntsAfterCommonCount1 > 0)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$(stopNameList1First == stopNameList2First || (prefix1First2First.length >= minFixLength1First2First && prefix1First2First.length > suffix1First2First.length) || (suffix1First2First.length >= minFixLength1First2First && suffix1First2First.length > prefix1First2First.length)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$(stopNameList1First == stopNameList2First || (prefix1First2First.length >= minFixLength1First2First && prefix1First2First.length > suffix1First2First.length) || (suffix1First2First.length >= minFixLength1First2First && suffix1First2First.length > prefix1First2First.length)) && (stopNameList1Last == stopNameList2Last || (prefix1Last2Last.length >= minFixLength1Last2Last && prefix1Last2Last.length > suffix1First2Last.length) || (suffix1Last2Last.length >= minFixLength1Last2Last && suffix1Last2Last.length > prefix1First2Last.length)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$(stopNameList1Last == stopNameList2Last || (prefix1Last2Last.length >= minFixLength1Last2Last && prefix1Last2Last.length > suffix1First2Last.length) || (suffix1Last2Last.length >= minFixLength1Last2Last && suffix1Last2Last.length > prefix1First2Last.length)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$directionHeadSigns.size == 2 // AM/PM only if 2 directions && (!agencyTools.directionHeadSignsDescriptive(directionHeadSigns) || directionHeadSigns.filterValues { it == "AM" || it == "PM" }.isNotEmpty()) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$distance1First2Last < distance2First1Last && (distance1First2Last < MAX_DISTANCE_TO_BE_SAME_TRANSIT_HUB_IN_METERS || (dataLossAuthorized && distance1First2Last < MAX_DISTANCE_TO_BE_SAME_TRANSIT_HUB_IN_METERS * 2f)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$distance2First1Last < distance1First2Last && (distance2First1Last < MAX_DISTANCE_TO_BE_SAME_TRANSIT_HUB_IN_METERS || (dataLossAuthorized && distance2First1Last < MAX_DISTANCE_TO_BE_SAME_TRANSIT_HUB_IN_METERS * 2f)) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$firstCommonStopIdInt != null // has a common stop && (forceMerge // force merge || (stopIdIntsBeforeCommon.isEmpty() // has stops before common && stopIdIntsBeforeCommonPrepend.isNotEmpty())) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$stopNameList1First == stopNameList2Last || (prefix1First2Last.length >= minFixLength1First2Last && prefix1First2Last.length > suffix1First2Last.length) || (suffix1First2Last.length >= minFixLength1First2Last && suffix1First2Last.length > prefix1First2Last.length) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$stopNameList1Last == stopNameList2First || (prefix2First1Last.length >= minFixLength2First1Last && prefix2First1Last.length > suffix2First1Last.length) || (suffix2First1Last.length >= minFixLength2First1Last && suffix2First1Last.length > prefix2First1Last.length) + ComplexCondition:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$stopTimesList1FirstStop != null && stopTimesList1LastStop != null && stopTimesList2FirstStop != null && stopTimesList2LastStop != null + CyclomaticComplexMethod:CollectionsExt.kt:fun <T> Iterable<T>.overlap: Boolean + CyclomaticComplexMethod:DBUtils.kt:DBUtils$@Suppress("AssignedValueIsNeverRead") @JvmStatic fun selectSchedules: List<MSchedule> + CyclomaticComplexMethod:GCalendar.kt:GCalendar.Companion$private fun initAllDates + CyclomaticComplexMethod:GRoute.kt:GRoute.Companion$@JvmOverloads @JvmStatic fun fromLine + CyclomaticComplexMethod:MDataChangedManager.kt:MDataChangedManager$@Suppress("DiscouragedApi") @JvmStatic fun avoidCalendarDatesDataChanged + CyclomaticComplexMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$@Suppress("DestructuringDeclarationWithTooManyEntries") @JvmStatic fun findDirectionHeadSigns: Map<Int, String> + CyclomaticComplexMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$@VisibleForTesting internal fun findDirectionHeadSign: DirectionResult? + CyclomaticComplexMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$private fun mergeTrips: MergedTrip? + CyclomaticComplexMethod:MDirectionSplitter.kt:MDirectionSplitter$@JvmStatic fun splitDirection + CyclomaticComplexMethod:MDirectionSplitter.kt:MDirectionSplitter$fun splitDirections: MutableList<DirectionTripsStops> + CyclomaticComplexMethod:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$@JvmOverloads @JvmStatic fun convert: Long + CyclomaticComplexMethod:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$@JvmStatic fun endsWithLetter + CyclomaticComplexMethod:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$@JvmStatic fun startsWithLetter + CyclomaticComplexMethod:MSchedule.kt:MSchedule$fun toFile + CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@JvmStatic fun endsWithLetter + CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@JvmStatic fun startsWithLetter + CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@Throws(RuntimeException::class) @JvmOverloads @JvmStatic fun convert: Int + ForEachOnRange:GCalendarDate.kt:GCalendarDate.Companion$startDateToCheck..endDateToCheck + LargeClass:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder + LargeClass:MDirectionHeadSignFinderTest.kt:MDirectionHeadSignFinderTest + LongMethod:CollectionsExt.kt:fun <T> Iterable<T>.overlap: Boolean + LongMethod:DBUtils.kt:DBUtils$@Suppress("AssignedValueIsNeverRead") @JvmStatic fun selectSchedules: List<MSchedule> + LongMethod:LocationUtils.kt:LocationUtils$private fun computeDistanceAndBearing + LongMethod:MDataChangedManager.kt:MDataChangedManager$@Suppress("DiscouragedApi") @JvmStatic fun avoidCalendarDatesDataChanged + LongMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$@Suppress("DestructuringDeclarationWithTooManyEntries") @JvmStatic fun findDirectionHeadSigns: Map<Int, String> + LongMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$@VisibleForTesting internal fun findDirectionHeadSign: DirectionResult? + LongMethod:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$private fun mergeTrips: MergedTrip? + LongMethod:MDirectionHeadSignFinderTest.kt:MDirectionHeadSignFinderTest$@Test fun testFindDirectionHeadSign_DistinctLastStopNoClearWinnerMerge + LongMethod:MDirectionSplitter.kt:MDirectionSplitter$@JvmStatic fun splitDirection + LongMethod:MDirectionSplitter.kt:MDirectionSplitter$fun splitDirections: MutableList<DirectionTripsStops> + LoopWithTooManyJumpStatements:CollectionsExt.kt:while + LoopWithTooManyJumpStatements:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$for + LoopWithTooManyJumpStatements:MDirectionSplitter.kt:MDirectionSplitter$for + MagicNumber:DateUtils.kt:DateUtils$23 + MagicNumber:DateUtils.kt:DateUtils$59 + MagicNumber:DateUtils.kt:DateUtils$999 + MagicNumber:GDirectionId.kt:GDirectionId.NEW_1$19 + MagicNumber:GDirectionId.kt:GDirectionId.NEW_2$29 + MagicNumber:GDirectionId.kt:GDirectionId.NONE$9 + MagicNumber:GDropOffType.kt:GDropOffType.MUST_COORDINATE_WITH_DRIVER$3 + MagicNumber:GFieldTypes.kt:GFieldTypes$6 + MagicNumber:GLocationType.kt:GLocationType.BOARDING_AREA$4 + MagicNumber:GLocationType.kt:GLocationType.GENERIC_NODE$3 + MagicNumber:GPickupType.kt:GPickupType.MUST_COORDINATE_WITH_DRIVER$3 + MagicNumber:GRouteType.kt:GRouteType.BUS$3 + MagicNumber:GRouteType.kt:GRouteType.EX_BUS_SERVICE$700 + MagicNumber:GRouteType.kt:GRouteType.EX_COMMUNAL_TAXI_SERVICE$1501 + MagicNumber:GRouteType.kt:GRouteType.EX_DEMAND_AND_RESPONSE_BUS_SERVICE$715 + MagicNumber:GRouteType.kt:GRouteType.EX_SHARE_TAXI_SERVICE$717 + MagicNumber:GRouteType.kt:GRouteType.EX_TRAM_SERVICE$900 + MagicNumber:GRouteType.kt:GRouteType.EX_URBAN_RAILWAY_SERVICE$400 + MagicNumber:GRouteType.kt:GRouteType.FERRY$4 + MagicNumber:GTime.kt:GTime$12_00_00 + MagicNumber:GTime.kt:GTime$12_99_99 + MagicNumber:GTime.kt:GTime$24_00_00 + MagicNumber:GTime.kt:GTime$6 + MagicNumber:LocationUtils.kt:LocationUtils$1.0e-12 + MagicNumber:LocationUtils.kt:LocationUtils$16384.0 + MagicNumber:LocationUtils.kt:LocationUtils$175.0 + MagicNumber:LocationUtils.kt:LocationUtils$180.0 + MagicNumber:LocationUtils.kt:LocationUtils$3.0 + MagicNumber:LocationUtils.kt:LocationUtils$320.0 + MagicNumber:LocationUtils.kt:LocationUtils$4.0 + MagicNumber:LocationUtils.kt:LocationUtils$4096.0 + MagicNumber:LocationUtils.kt:LocationUtils$6.0 + MagicNumber:LocationUtils.kt:LocationUtils$768 + MagicNumber:MDataChangedManager.kt:MDataChangedManager$7 + MagicNumber:MDirectionCardinalType.kt:MDirectionCardinalType$3 + MagicNumber:MDirectionCardinalType.kt:MDirectionCardinalType$4 + MagicNumber:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$0.5f + MagicNumber:MDirectionSplitter.kt:MDirectionSplitter$.33f + MagicNumber:MDirectionSplitter.kt:MDirectionSplitter$0.50f + MagicNumber:MDirectionSplitter.kt:MDirectionSplitter$100f + MagicNumber:MDropOffType.kt:MDropOffType.MUST_COORDINATE_WITH_DRIVER$3 + MagicNumber:MPickupType.kt:MPickupType.MUST_COORDINATE_WITH_DRIVER$3 + MagicNumber:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$3 + MagicNumber:MSchedule.kt:MSchedule$100 + MagicNumber:MServiceDate.kt:MServiceDate.Companion$3 + MaxLineLength:MDataChangedManager.kt:MDataChangedManager$MTLog.log("> Cannot remove added dates because of wrong number of added dates (${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})") + NewLineAtEndOfFile:CharUtils.kt:org.mtransit.parser.CharUtils.kt + NewLineAtEndOfFile:CloseableUtils.kt:org.mtransit.commons.CloseableUtils.kt + NewLineAtEndOfFile:CollectionsExt.kt:org.mtransit.commons.CollectionsExt.kt + NewLineAtEndOfFile:CollectionsExtTest.kt:org.mtransit.commons.CollectionsExtTest.kt + NewLineAtEndOfFile:DBUtils.kt:org.mtransit.parser.db.DBUtils.kt + NewLineAtEndOfFile:DirectionResult.kt:org.mtransit.parser.mt.DirectionResult.kt + NewLineAtEndOfFile:DirectionTripsStops.kt:org.mtransit.parser.mt.DirectionTripsStops.kt + NewLineAtEndOfFile:DumpDbUtils.kt:org.mtransit.parser.db.DumpDbUtils.kt + NewLineAtEndOfFile:GAgency.kt:org.mtransit.parser.gtfs.data.GAgency.kt + NewLineAtEndOfFile:GCalendar.kt:org.mtransit.parser.gtfs.data.GCalendar.kt + NewLineAtEndOfFile:GCalendarDate.kt:org.mtransit.parser.gtfs.data.GCalendarDate.kt + NewLineAtEndOfFile:GCalendarDatesExceptionType.kt:org.mtransit.parser.gtfs.data.GCalendarDatesExceptionType.kt + NewLineAtEndOfFile:GDirection.kt:org.mtransit.parser.gtfs.data.GDirection.kt + NewLineAtEndOfFile:GDirectionId.kt:org.mtransit.parser.gtfs.data.GDirectionId.kt + NewLineAtEndOfFile:GDirectionType.kt:org.mtransit.parser.gtfs.data.GDirectionType.kt + NewLineAtEndOfFile:GDropOffType.kt:org.mtransit.parser.gtfs.data.GDropOffType.kt + NewLineAtEndOfFile:GFieldTypes.kt:org.mtransit.parser.gtfs.data.GFieldTypes.kt + NewLineAtEndOfFile:GFrequency.kt:org.mtransit.parser.gtfs.data.GFrequency.kt + NewLineAtEndOfFile:GIDs.kt:org.mtransit.parser.gtfs.data.GIDs.kt + NewLineAtEndOfFile:GPickupType.kt:org.mtransit.parser.gtfs.data.GPickupType.kt + NewLineAtEndOfFile:GRouteType.kt:org.mtransit.parser.gtfs.data.GRouteType.kt + NewLineAtEndOfFile:GStop.kt:org.mtransit.parser.gtfs.data.GStop.kt + NewLineAtEndOfFile:GStopTime.kt:org.mtransit.parser.gtfs.data.GStopTime.kt + NewLineAtEndOfFile:GTFSDataBase.kt:org.mtransit.parser.db.GTFSDataBase.kt + NewLineAtEndOfFile:GTime.kt:org.mtransit.parser.gtfs.data.GTime.kt + NewLineAtEndOfFile:GTimePoint.kt:org.mtransit.parser.gtfs.data.GTimePoint.kt + NewLineAtEndOfFile:GTrip.kt:org.mtransit.parser.gtfs.data.GTrip.kt + NewLineAtEndOfFile:GTripStop.kt:org.mtransit.parser.gtfs.data.GTripStop.kt + NewLineAtEndOfFile:GWheelchairBoardingType.kt:org.mtransit.parser.gtfs.data.GWheelchairBoardingType.kt + NewLineAtEndOfFile:HtmlSymbols.kt:org.mtransit.commons.HtmlSymbols.kt + NewLineAtEndOfFile:IntExt.kt:org.mtransit.commons.IntExt.kt + NewLineAtEndOfFile:Letters.kt:org.mtransit.commons.Letters.kt + NewLineAtEndOfFile:LocationUtils.kt:org.mtransit.parser.LocationUtils.kt + NewLineAtEndOfFile:MAgency.kt:org.mtransit.parser.mt.data.MAgency.kt + NewLineAtEndOfFile:MAgencyTests.kt:org.mtransit.parser.mt.data.MAgencyTests.kt + NewLineAtEndOfFile:MDataChangedManager.kt:org.mtransit.parser.mt.MDataChangedManager.kt + NewLineAtEndOfFile:MDirection.kt:org.mtransit.parser.mt.data.MDirection.kt + NewLineAtEndOfFile:MDirectionCardinalType.kt:org.mtransit.parser.mt.data.MDirectionCardinalType.kt + NewLineAtEndOfFile:MDirectionHeadSignFinder.kt:org.mtransit.parser.mt.MDirectionHeadSignFinder.kt + NewLineAtEndOfFile:MDirectionHeadSignFinderTest.kt:org.mtransit.parser.mt.MDirectionHeadSignFinderTest.kt + NewLineAtEndOfFile:MDirectionInboundType.kt:org.mtransit.parser.mt.data.MDirectionInboundType.kt + NewLineAtEndOfFile:MDirectionSplitter.kt:org.mtransit.parser.mt.MDirectionSplitter.kt + NewLineAtEndOfFile:MDirectionSplitterTest.kt:org.mtransit.parser.mt.MDirectionSplitterTest.kt + NewLineAtEndOfFile:MDirectionStop.kt:org.mtransit.parser.mt.data.MDirectionStop.kt + NewLineAtEndOfFile:MDirectionType.kt:org.mtransit.parser.mt.data.MDirectionType.kt + NewLineAtEndOfFile:MDropOffType.kt:org.mtransit.parser.mt.data.MDropOffType.kt + NewLineAtEndOfFile:MFrequency.kt:org.mtransit.parser.mt.data.MFrequency.kt + NewLineAtEndOfFile:MGeneratorTest.kt:org.mtransit.parser.mt.MGeneratorTest.kt + NewLineAtEndOfFile:MPickupType.kt:org.mtransit.parser.mt.data.MPickupType.kt + NewLineAtEndOfFile:MReader.kt:org.mtransit.parser.mt.MReader.kt + NewLineAtEndOfFile:MRouteSNToIDConverterTest.kt:org.mtransit.parser.mt.data.MRouteSNToIDConverterTest.kt + NewLineAtEndOfFile:MServiceDate.kt:org.mtransit.parser.mt.data.MServiceDate.kt + NewLineAtEndOfFile:MServiceDateTest.kt:org.mtransit.parser.mt.data.MServiceDateTest.kt + NewLineAtEndOfFile:MSpec.kt:org.mtransit.parser.mt.data.MSpec.kt + NewLineAtEndOfFile:MStop.kt:org.mtransit.parser.mt.data.MStop.kt + NewLineAtEndOfFile:MStrings.kt:org.mtransit.parser.mt.data.MStrings.kt + NewLineAtEndOfFile:MergedTrip.kt:org.mtransit.parser.mt.MergedTrip.kt + NewLineAtEndOfFile:ParserMain.kt:org.mtransit.parser.scratch.ParserMain.kt + NewLineAtEndOfFile:SQLUtils.kt:org.mtransit.parser.db.SQLUtils.kt + NewLineAtEndOfFile:StringUtils.kt:org.mtransit.parser.StringUtils.kt + NewLineAtEndOfFile:TimeUtilsTest.kt:org.mtransit.parser.TimeUtilsTest.kt + NewLineAtEndOfFile:TorontoTTCCommons.kt:org.mtransit.commons.TorontoTTCCommons.kt + ReturnCount:AgencyConfig.kt:AgencyConfig$fun getAllLanguages: List<Locale>? + ReturnCount:CollectionsExt.kt:fun <T> Iterable<T>.intersectWithOrder: Set<T> + ReturnCount:CollectionsExt.kt:fun <T> Iterable<T>.overlap: Boolean + ReturnCount:GCalendar.kt:GCalendar$@Suppress("unused") fun isInside: Boolean + ReturnCount:GCalendar.kt:GCalendar$@Suppress("unused") fun isOverlapping: Boolean + ReturnCount:GCalendarDate.kt:GCalendarDate.Companion$@JvmStatic fun isServiceEntirelyRemoved: Boolean + ReturnCount:GDropOffType.kt:GDropOffType.Companion$fun parse: GDropOffType + ReturnCount:GFieldTypes.kt:GFieldTypes$fun Int.isBetween: Boolean + ReturnCount:GPickupType.kt:GPickupType.Companion$fun parse: GPickupType + ReturnCount:GRoute.kt:GRoute.Companion$@JvmStatic fun mergeRouteColors: String? + ReturnCount:GRoute.kt:GRoute.Companion$@JvmStatic fun mergeRouteLongNames: String? + ReturnCount:GRoute.kt:GRoute.Companion$@JvmStatic fun mergeRouteSortOrders: Int? + ReturnCount:GRouteType.kt:GRouteType.Companion$@JvmStatic fun isSameType: Boolean + ReturnCount:GSpecExt.kt:fun GSpec.isInsideGCalendars: Boolean? + ReturnCount:GStopTime.kt:GStopTime$fun isRegular: Boolean + ReturnCount:GStopTime.kt:GStopTime$override fun compareTo: Int + ReturnCount:MAgency.kt:MAgency.Companion$@JvmStatic fun pickColorFromRoutes: String? + ReturnCount:MDataChangedManager.kt:MDataChangedManager$@Suppress("DiscouragedApi") @JvmStatic fun avoidCalendarDatesDataChanged + ReturnCount:MDataChangedManager.kt:MDataChangedManager$@Suppress("unused") // TODO remove @JvmStatic fun addMissingDateToAvoidDataChanged + ReturnCount:MDataChangedManager.kt:MDataChangedManager$@Suppress("unused") // TODO remove @JvmStatic fun ignoreCalendarDateToAvoidDataChanged: Boolean + ReturnCount:MDirection.kt:MDirection.Companion$@JvmStatic fun mergeHeadsignValue: String? + ReturnCount:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$@VisibleForTesting internal fun findDirectionHeadSign: DirectionResult? + ReturnCount:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder$private fun mergeTrips: MergedTrip? + ReturnCount:MDirectionStop.kt:MDirectionStop$fun equalsDirectionAndStop: Boolean + ReturnCount:MReader.kt:MReader$@Suppress("unused") // TODO removed @JvmStatic fun readFirstLastDepartures: Pair<Int?, Int?>? + ReturnCount:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$@JvmOverloads @JvmStatic fun convert: Long + ReturnCount:MSchedule.kt:MSchedule$@Suppress("unused") fun hasHeadsign: Boolean + ReturnCount:MSchedule.kt:MSchedule$fun isSameServiceRDSDeparture: Boolean + ReturnCount:MStopIDConverter.kt:MStopIDConverter$@Throws(RuntimeException::class) @JvmOverloads @JvmStatic fun convert: Int + ReturnCount:MStrings.kt:MStrings$@JvmStatic fun convert: String + ReturnCount:RouteConfig.kt:RouteConfig$fun cleanStopHeadsign: String + ReturnCount:RouteConfig.kt:RouteConfig$fun excludeStopTime: Boolean + ReturnCount:RouteConfig.kt:RouteConfig$fun excludeTrip: Boolean + ThrowsCount:DBUtils.kt:DBUtils$@Suppress("unused") @Deprecated("Use GTFSDataBase instead.") @JvmStatic fun insertStopTime + ThrowsCount:GCalendar.kt:GCalendar.Companion$@JvmStatic fun fromLine: GCalendar + ThrowsCount:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$@JvmOverloads @JvmStatic fun convert: Long + ThrowsCount:MStopIDConverter.kt:MStopIDConverter$@Throws(RuntimeException::class) @JvmOverloads @JvmStatic fun convert: Int + TooGenericExceptionCaught:Configs.kt:Configs$e: Exception + TooGenericExceptionCaught:DBUtils.kt:DBUtils$e: Exception + TooGenericExceptionCaught:GCalendar.kt:GCalendar.Companion$e: Exception + TooGenericExceptionCaught:GTrip.kt:GTrip.Companion$e: Exception + TooGenericExceptionCaught:MReader.kt:MReader$e: Exception + TooGenericExceptionCaught:MStoreListingGenerator.kt:MStoreListingGenerator$ioe: Exception + TooGenericExceptionThrown:MStopIDConverter.kt:MStopIDConverter$throw RuntimeException("Unexpected digits '$digits' in stop ID '$stopIdS' to convert to integer!") + TooGenericExceptionThrown:MStopIDConverter.kt:MStopIDConverter$throw RuntimeException("Unexpected next characters '$nextChars' in stop ID '$stopIdS'!") + TooGenericExceptionThrown:MStopIDConverter.kt:MStopIDConverter$throw RuntimeException("Unexpected previous characters '$previousChars' in stop ID '$stopIdS'!") + TooGenericExceptionThrown:MStopIDConverter.kt:MStopIDConverter$throw RuntimeException("Unexpected stop ID '$stopIdS' can not be parsed by regex!") + TooGenericExceptionThrown:MStopIDConverter.kt:MStopIDConverter$throw RuntimeException("Unexpected stop ID '$stopIdS' to convert to integer!") + TooManyFunctions:DBUtils.kt:DBUtils + TooManyFunctions:GCalendar.kt:GCalendar + TooManyFunctions:GFieldTypes.kt:GFieldTypes + TooManyFunctions:GTFSDataBase.kt:GTFSDataBase + TooManyFunctions:GTime.kt:GTime + TooManyFunctions:RouteConfig.kt:RouteConfig + TooManyFunctions:SQLUtils.kt:SQLUtils diff --git a/src/main/java/org/mtransit/commons/CloseableUtils.kt b/src/main/java/org/mtransit/commons/CloseableUtils.kt index 1ecc57b2..7d986e70 100644 --- a/src/main/java/org/mtransit/commons/CloseableUtils.kt +++ b/src/main/java/org/mtransit/commons/CloseableUtils.kt @@ -15,7 +15,7 @@ object CloseableUtils { fun closeQuietly(closeable: Closeable?) { try { closeable?.close() - } catch (ioe: IOException) { + } catch (_: IOException) { // ignore } } diff --git a/src/main/java/org/mtransit/parser/gtfs/data/GFrequency.kt b/src/main/java/org/mtransit/parser/gtfs/data/GFrequency.kt index 86a4f60d..abfb7311 100644 --- a/src/main/java/org/mtransit/parser/gtfs/data/GFrequency.kt +++ b/src/main/java/org/mtransit/parser/gtfs/data/GFrequency.kt @@ -10,8 +10,8 @@ import java.util.concurrent.TimeUnit // https://gtfs.org/reference/static/#frequenciestxt data class GFrequency( val tripIdInt: Int, - private val _startTime: Int, - private val _endTime: Int, + val startTime: Int, + val endTime: Int, val headwaySecs: Int, val exactTimes: Int?, ) { @@ -38,23 +38,19 @@ data class GFrequency( private val _tripId: String get() = GIDs.getString(tripIdInt) - val startTime: Int = _startTime - @Suppress("unused") val startTimeDate: Date - get() = GTime.toDate(_startTime) + get() = GTime.toDate(startTime) val startTimeMs: Long - get() = GTime.toMs(_startTime) - - val endTime: Int = _endTime + get() = GTime.toMs(startTime) @Suppress("unused") val endTimeDate: Date - get() = GTime.toDate(_endTime) + get() = GTime.toDate(endTime) val endTimeMs: Long - get() = GTime.toMs(_endTime) + get() = GTime.toMs(endTime) val headwayMs: Long get() = TimeUnit.SECONDS.toMillis(headwaySecs.toLong()) @@ -67,8 +63,8 @@ data class GFrequency( fun to() = Frequency( tripId = _tripId, - startTime = GTime.toString(_startTime), - endTime = GTime.toString(_endTime), + startTime = GTime.toString(startTime), + endTime = GTime.toString(endTime), headwaySecs = headwaySecs, exactTimes = exactTimes ) diff --git a/src/main/java/org/mtransit/parser/gtfs/data/GStopTime.kt b/src/main/java/org/mtransit/parser/gtfs/data/GStopTime.kt index e6341c14..e184a511 100644 --- a/src/main/java/org/mtransit/parser/gtfs/data/GStopTime.kt +++ b/src/main/java/org/mtransit/parser/gtfs/data/GStopTime.kt @@ -11,8 +11,8 @@ import java.util.Date // https://gtfs.org/schedule/reference/#stop_timestxt data class GStopTime( val tripIdInt: Int, - private val _arrivalTime: Int, // HHmmss - private val _departureTime: Int, // HHmmss + val arrivalTime: Int, // HHmmss + val departureTime: Int, // HHmmss val stopIdInt: Int, val stopSequence: Int, val stopHeadsign: String?, @@ -33,8 +33,8 @@ data class GStopTime( timePointInt: Int, ) : this( tripIdInt = tripIdInt, - _arrivalTime = arrivalTime, - _departureTime = departureTime, + arrivalTime = arrivalTime, + departureTime = departureTime, stopIdInt = stopIdInt, stopSequence = stopSequence, stopHeadsign = stopHeadsign, @@ -55,8 +55,8 @@ data class GStopTime( timePoint: GTimePoint, ) : this( tripIdInt = GIDs.getInt(tripId), - _arrivalTime = arrivalTime, - _departureTime = departureTime, + arrivalTime = arrivalTime, + departureTime = departureTime, stopIdInt = stopIdInt, stopSequence = stopSequence, stopHeadsign = stopHeadsign, @@ -77,8 +77,8 @@ data class GStopTime( timePoint: GTimePoint, ) : this( tripIdInt = GIDs.getInt(tripId), - _arrivalTime = GTime.fromString(arrivalTime), - _departureTime = GTime.fromString(departureTime), + arrivalTime = GTime.fromString(arrivalTime), + departureTime = GTime.fromString(departureTime), stopIdInt = GIDs.getInt(stopId), stopSequence = stopSequence, stopHeadsign = stopHeadsign, @@ -101,28 +101,24 @@ data class GStopTime( private val _stopId: String get() = GIDs.getString(stopIdInt) - val arrivalTime: Int = _arrivalTime - - fun hasArrivalTime() = _arrivalTime >= 0 + fun hasArrivalTime() = arrivalTime >= 0 @Suppress("unused") val arrivalTimeMs: Long - get() = GTime.toMs(_arrivalTime) + get() = GTime.toMs(arrivalTime) @Suppress("unused") val arrivalTimeDate: Date - get() = GTime.toDate(_arrivalTime) - - val departureTime: Int = _departureTime + get() = GTime.toDate(arrivalTime) - fun hasDepartureTime() = _departureTime >= 0 + fun hasDepartureTime() = departureTime >= 0 val departureTimeMs: Long - get() = GTime.toMs(_departureTime) + get() = GTime.toMs(departureTime) @Suppress("unused") val departureTimeDate: Date - get() = GTime.toDate(_departureTime) + get() = GTime.toDate(departureTime) val uID by lazy { getNewUID(tripIdInt, stopIdInt, stopSequence) } @@ -149,8 +145,8 @@ data class GStopTime( if (this.stopSequence != other.stopSequence) { return this.stopSequence.compareTo(other.stopSequence) } - if (this._departureTime != other._departureTime) { - return this._departureTime.compareTo(other._departureTime) + if (this.departureTime != other.departureTime) { + return this.departureTime.compareTo(other.departureTime) } throw MTLog.Fatal("Unexpected stop times to compare: '$this' & '$other'!") } @@ -167,9 +163,9 @@ data class GStopTime( add("s:$_stopId") add("#:$stopSequence") if (hasDepartureTime()) { - add("d:${GTime.toString(_departureTime)}") + add("d:${GTime.toString(departureTime)}") } else if (hasArrivalTime()) { - add("a:${GTime.toString(_arrivalTime)}") + add("a:${GTime.toString(arrivalTime)}") } if (pickupType != GPickupType.REGULAR) { add("$pickupType") @@ -184,8 +180,8 @@ data class GStopTime( tripId = _tripId, stopId = _stopId, stopSequence = stopSequence, - arrivalTime = GTime.toString(_arrivalTime), - departureTime = GTime.toString(_departureTime), + arrivalTime = GTime.toString(arrivalTime), + departureTime = GTime.toString(departureTime), stopHeadsign = stopHeadsign, pickupType = pickupType.id, dropOffType = dropOffType.id, From 28de886612208a3eecb570906778325a637a96be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 14:53:23 -0400 Subject: [PATCH 3/6] fix --- .../java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt b/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt index 5693e673..b238d8d7 100644 --- a/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt +++ b/src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt @@ -1035,11 +1035,11 @@ object MDirectionHeadSignFinder { // cheating, just changing first arrival time / last departure time for AM/PM val firstIdx = 0 if (mergedStopTimes[firstIdx].departureTime < otherStopTimesList.first().departureTime) { - mergedStopTimes[firstIdx] = mergedStopTimes[firstIdx].copy(_departureTime = otherStopTimesList.first().departureTime) + mergedStopTimes[firstIdx] = mergedStopTimes[firstIdx].copy(departureTime = otherStopTimesList.first().departureTime) } val lastIdx = mergedStopTimes.size - 1 if (mergedStopTimes[lastIdx].arrivalTime > otherStopTimesList.last().arrivalTime) { - mergedStopTimes[lastIdx] = mergedStopTimes[lastIdx].copy(_arrivalTime = otherStopTimesList.last().arrivalTime) + mergedStopTimes[lastIdx] = mergedStopTimes[lastIdx].copy(arrivalTime = otherStopTimesList.last().arrivalTime) } return mergedStopTimes } From 2ca649da2828d6b0c2c5cff9751cd1661e7657bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 15:30:09 -0400 Subject: [PATCH 4/6] wip --- detekt-baseline.xml | 1 - src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 04ee715e..bbc0a643 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -92,7 +92,6 @@ MagicNumber:MRouteSNToIDConverter.kt:MRouteSNToIDConverter$3 MagicNumber:MSchedule.kt:MSchedule$100 MagicNumber:MServiceDate.kt:MServiceDate.Companion$3 - MaxLineLength:MDataChangedManager.kt:MDataChangedManager$MTLog.log("> Cannot remove added dates because of wrong number of added dates (${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})") NewLineAtEndOfFile:CharUtils.kt:org.mtransit.parser.CharUtils.kt NewLineAtEndOfFile:CloseableUtils.kt:org.mtransit.commons.CloseableUtils.kt NewLineAtEndOfFile:CollectionsExt.kt:org.mtransit.commons.CollectionsExt.kt diff --git a/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt b/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt index 52c1ecf6..6df9a0f5 100644 --- a/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt +++ b/src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt @@ -268,7 +268,10 @@ object MDataChangedManager { } val updatedCalendar = originalCalendar.copy(startDate = dayAfterRemovedDate) if (originalCalendar.dates.size - updatedCalendar.dates.size != 1) { - MTLog.log("> Cannot remove added dates because of wrong number of added dates (${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})") + MTLog.log( + "> Cannot remove added dates because of wrong number of added dates " + + "(${updatedCalendar.dates.size} vs ${originalCalendar.dates.size})" + ) return } newGCalendars.remove(originalCalendar) From dd7697a66beb930dac33a7e8bece01b355b6b2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 15:39:31 -0400 Subject: [PATCH 5/6] wip --- detekt-baseline.xml | 1 - src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/detekt-baseline.xml b/detekt-baseline.xml index bbc0a643..c3704cf5 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -31,7 +31,6 @@ CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@JvmStatic fun endsWithLetter CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@JvmStatic fun startsWithLetter CyclomaticComplexMethod:MStopIDConverter.kt:MStopIDConverter$@Throws(RuntimeException::class) @JvmOverloads @JvmStatic fun convert: Int - ForEachOnRange:GCalendarDate.kt:GCalendarDate.Companion$startDateToCheck..endDateToCheck LargeClass:MDirectionHeadSignFinder.kt:MDirectionHeadSignFinder LargeClass:MDirectionHeadSignFinderTest.kt:MDirectionHeadSignFinderTest LongMethod:CollectionsExt.kt:fun <T> Iterable<T>.overlap: Boolean diff --git a/src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt b/src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt index e36f7b48..727f28d4 100644 --- a/src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt +++ b/src/main/java/org/mtransit/parser/gtfs/data/GCalendarDate.kt @@ -143,7 +143,7 @@ data class GCalendarDate( val startDateToCheck = max(startDate, gCalendar.startDate) val endDateToCheck = min(endDate, gCalendar.endDate) val gCalendarDateServiceId = gCalendarDates?.filter { it.isServiceIdInt(gCalendar.serviceIdInt) } ?: return false // NOT entirely removed - (startDateToCheck..endDateToCheck).forEach { date -> + for (date in startDateToCheck..endDateToCheck) { if (gCalendarDateServiceId.none { it.isDate(date) && it.exceptionType == GCalendarDatesExceptionType.SERVICE_REMOVED }) { return false // NOT entirely removed } From 5f661946a94e130f6ab1ff9a414f727b0753ef7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Fri, 31 Jul 2026 16:02:11 -0400 Subject: [PATCH 6/6] wip --- src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt b/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt index ee65b260..01bcaacf 100644 --- a/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt +++ b/src/main/java/org/mtransit/parser/gtfs/data/GLocationType.kt @@ -12,7 +12,7 @@ enum class GLocationType(val id: Int) { /** * Station. - * A physical structure or area that contains one or more platform. + * A physical structure or area that contains one or more platforms. */ STATION(1),