-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a speed segment map to speed page #1045
base: main
Are you sure you want to change the base?
Conversation
export const filterActiveElements = <T extends Record<string, unknown>>( | ||
records: T[], | ||
targetLine: LineShort, | ||
targetDate: Date, | ||
getRecordDateRange: (t: T) => [Date, Date], | ||
getRecordLine: (t: T) => LineShort | ||
) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ Code Quality Violation
Too many parameters (5). Maximum allowed is 4. (...read more)
Having too many parameters can make your code hard to read. The parameters must be used in appropriate order. Forgetting the order of parameters can cause mistakes.
Too many parameters is a code smell. You should refactor your code in smaller reusable bits. While it may be valid to require more than four parameters, you should use object destructuring.
// TODO: Pull from dynamo calculated hourly in data-ingestion | ||
const speedData = TEST_DATA.map((data) => { | ||
const intervalDistance = getStationDistance(data.from_id, data.to_id); | ||
|
||
return { | ||
...data, | ||
speed: convertSecondsToMph(data.travel_time, intervalDistance), | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not merge until this is pulling from real data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real data relies on https://github.com/transitmatters/slow-zones/pull/65 first getting merged
Motivation
Changes
Testing Instructions