Skip to content

Commit

Permalink
refactor: 코드스멜제거
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemo0708 committed Dec 22, 2024
1 parent 7beff95 commit 0dbe1d6
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CalculateGraduationService implements CalculateGraduationUseCase {


@Override
public GraduationResult calculateGraduation(User user) {
public GraduationResult calculateGraduation(User user) {
GraduationRequirement graduationRequirement = determineGraduationRequirement(user);
TakenLectureInventory takenLectureInventory = findTakenLectureUseCase.findTakenLectures(
user.getId()
Expand Down Expand Up @@ -62,7 +62,7 @@ DetailGraduationResult generateTransferChristianDetailGraduationResult(
TakenLectureInventory takenLectureInventory
) {
double christianCreditRequirement = graduationRequirement.getChristianCredit();
double totalTakenCredits = (int) calculateChristianTakenCredits(user, takenLectureInventory) +
double totalTakenCredits = calculateChristianTakenCredits(user, takenLectureInventory) +
user.getTransferCredit().getChristianLecture();

Check warning on line 66 in src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java#L64-L66

Added lines #L64 - L66 were not covered by tests

if (totalTakenCredits > christianCreditRequirement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static com.plzgraduate.myongjigraduatebe.user.domain.model.EnglishLevel.FREE;

import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailCategoryResult;
import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailGraduationResult;
import com.plzgraduate.myongjigraduatebe.lecture.domain.model.CommonCulture;
import com.plzgraduate.myongjigraduatebe.lecture.domain.model.CommonCultureCategory;
import com.plzgraduate.myongjigraduatebe.lecture.domain.model.Lecture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.HashSet;
import java.util.Set;

import com.plzgraduate.myongjigraduatebe.user.domain.model.User;
import org.springframework.stereotype.Component;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private static ParsingStudentCategoryDto parseStudentCategory(String[] splitText
studentCategory = StudentCategory.from(categories);
String fourthLine = fourthLineText.substring("편입생 인정학점 - ".length());
transferCredit = TransferCredit.from(Arrays.stream(fourthLine.split(","))
.map(s -> s.replaceAll("[^0-9]", ""))
.map(s -> s.replaceAll("\\D", ""))
.collect(Collectors.joining("/")));

return ParsingStudentCategoryDto.of(
Expand Down

This file was deleted.

Loading

0 comments on commit 0dbe1d6

Please sign in to comment.