Skip to content

[FIX] 리뷰 점수 응답 정수 반올림 - #201

Merged
gdbs1107 merged 1 commit into
developfrom
fix/#200/review
Jun 9, 2026
Merged

[FIX] 리뷰 점수 응답 정수 반올림#201
gdbs1107 merged 1 commit into
developfrom
fix/#200/review

Conversation

@gdbs1107

@gdbs1107 gdbs1107 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

📣 Related Issue



📝 Summary

  • 리뷰 점수 응답 정수 반올림



🙏 Details

Summary by CodeRabbit

  • Bug Fixes

    • 평가자 리뷰의 총점 및 평균 점수 표시 방식을 개선했습니다. 소수점 점수를 반올림하여 정수 값으로 표시하도록 변경되었습니다.
  • Tests

    • 평가자 리뷰 점수 반올림 로직에 대한 검증 테스트를 추가했습니다.

@gdbs1107 gdbs1107 self-assigned this Jun 5, 2026
@gdbs1107 gdbs1107 added 🐛 fix 🐛 버그 수정 💪🏼 재연 labels Jun 5, 2026
@gdbs1107 gdbs1107 linked an issue Jun 5, 2026 that may be closed by this pull request
1 task
@gdbs1107

gdbs1107 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

📝 Code Coverage

Overall Project NaN% NaN% 🍏

There is no coverage information present for the Files changed

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

세 개의 평가 응답 레코드에서 소수점 점수 필드를 정수로 변환하고, Math.round()를 사용하는 헬퍼 메서드를 구현하며, 변환 동작을 검증하는 테스트를 추가합니다.

Changes

평가 응답 점수 정수화

Layer / File(s) Summary
Detail 응답 점수 반올림
ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewDetailResponse.java
totalScore 필드를 double에서 int로 변경하고, 팩토리 메서드에서 Math.round()를 사용하는 roundScore() 헬퍼로 소수점을 정수로 변환합니다.
List item 응답 점수 반올림
ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListItemResponse.java
totalScore 필드를 double에서 int로 변경하고, 팩토리 메서드에서 Math.round()를 사용하는 roundScore() 헬퍼로 소수점을 정수로 변환합니다.
List 응답 평균 점수 반올림
ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListResponse.java
averageTotalScore 필드를 double에서 int로 변경하고, 팩토리 메서드에서 Math.round() 기반 roundScore() 헬퍼로 소수점을 정수로 변환한 후 레코드를 구성합니다.
점수 반올림 검증 테스트
ssd-api/src/test/java/or/hyu/ssd/api/document/response/EvaluatorReviewResponseRoundingTest.java
새로운 테스트 클래스는 세 응답 레코드의 팩토리 메서드가 소수점 점수를 Math.round()로 정확히 정수로 변환하는지 검증합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • parkwoongg

Poem

점수를 정수로 정돈하는 토끼,
Math.round()로 소수점을 다듬고,
세 응답이 균형 맞춰 변환되네.
테스트가 검증하니 모두 반올림 완성! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 PR의 주요 변경사항을 명확히 요약하고 있으며, 리뷰 점수를 정수로 반올림 처리하는 핵심 내용을 직접적으로 전달하고 있다.
Linked Issues check ✅ Passed 연결된 이슈 #200의 요구사항인 '리뷰 점수 정수화'가 충분히 충족되었으며, 세 개의 응답 클래스에서 점수를 double에서 int로 변경하고 Math.round를 통해 반올림 처리하였다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #200의 리뷰 점수 정수화 요구사항과 직접적으로 관련되어 있으며, 범위를 벗어난 변경사항이 없다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#200/review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListResponse.java (1)

22-24: 💤 Low value

roundScore 헬퍼 메서드가 3개 파일에 중복됩니다.

EvaluatorReviewDetailResponse, EvaluatorReviewListItemResponse, EvaluatorReviewListResponse 모두 동일한 roundScore 메서드를 포함하고 있습니다. 공통 유틸리티 클래스로 추출하면 유지보수성이 향상됩니다.

♻️ 리팩토링 제안

같은 패키지에 유틸리티 클래스를 생성:

package or.hyu.ssd.api.document.response;

public final class ScoreUtils {
    private ScoreUtils() {}
    
    public static int roundScore(double score) {
        return (int) Math.round(score);
    }
}

각 Response 클래스에서 ScoreUtils.roundScore(...) 호출로 변경할 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListResponse.java`
around lines 22 - 24, The private helper method roundScore(double) is duplicated
across EvaluatorReviewDetailResponse, EvaluatorReviewListItemResponse, and
EvaluatorReviewListResponse; extract it into a shared utility (e.g., ScoreUtils
with a public static roundScore(double)) and replace the three private
implementations with calls to ScoreUtils.roundScore(...) in each response class
to remove duplication and centralize rounding logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListResponse.java`:
- Around line 22-24: The private helper method roundScore(double) is duplicated
across EvaluatorReviewDetailResponse, EvaluatorReviewListItemResponse, and
EvaluatorReviewListResponse; extract it into a shared utility (e.g., ScoreUtils
with a public static roundScore(double)) and replace the three private
implementations with calls to ScoreUtils.roundScore(...) in each response class
to remove duplication and centralize rounding logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 076a542e-31ec-49e9-ac80-cf1de4de5dd5

📥 Commits

Reviewing files that changed from the base of the PR and between 1ece0e0 and 55dcc4b.

📒 Files selected for processing (4)
  • ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewDetailResponse.java
  • ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListItemResponse.java
  • ssd-api/src/main/java/or/hyu/ssd/api/document/response/EvaluatorReviewListResponse.java
  • ssd-api/src/test/java/or/hyu/ssd/api/document/response/EvaluatorReviewResponseRoundingTest.java

@gdbs1107
gdbs1107 merged commit 955e73f into develop Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 fix 🐛 버그 수정 💪🏼 재연

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 리뷰 점수 정수화

1 participant