Skip to content
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

refactor(AnnotationService): Move getAllLatestScoreAnnotations() to MilestoneReportService #1497

Conversation

hirokiterashima
Copy link
Member

Changes

  • Move AnnotationService.getAllLatestScoreAnnotations() to MilestoneReportService, the only place it's used
  • Rewrite the function using filter() and reduceRight()
  • Add function param and return types and make function private

Test

  • Milestone TAP report chooses and displays the correct report template as before

MilestoneReportService

Also rewrite function using filter() and reduceRight()
@hirokiterashima hirokiterashima added this to the Tech Debt 19 -> 18 milestone Oct 27, 2023
@hirokiterashima hirokiterashima self-assigned this Oct 27, 2023
@hirokiterashima hirokiterashima marked this pull request as ready for review October 27, 2023 00:37
Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reduce the complexity of the function some more?

You can also probably call AnnotationService.isScoreOrAutoScore(annotation) or AnnotationService.matchesScoreType(annotation, 'any') to check if it's a score annotation.

Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hirokiterashima hirokiterashima merged commit 939c837 into develop Oct 27, 2023
2 checks passed
@hirokiterashima hirokiterashima deleted the refactor-annotationService-move-getAllLatestScoreAnnotations branch October 27, 2023 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants