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

부스트캠프 모바일 6기 코드 리뷰어 지원 #200

Open
wants to merge 418 commits into
base: review
Choose a base branch
from

Conversation

ChocOZerO
Copy link

Issue Number

Close #

변경사항

  • 의존성 목록

새로운 기능

  • 기능 목록

작업 유형

  • 신규 기능 추가
  • 버그 수정
  • 리펙토링
  • 문서 업데이트

체크리스트

  • Merge 하는 브랜치가 올바른가?
  • 코딩컨벤션을 준수하는가?
  • PR과 관련없는 변경사항이 없는가?
  • 내 코드에 대한 자기 검토가 되었는가?
  • 변경사항이 효과적이거나 동작이 작동한다는 것을 보증하는 테스트를 추가하였는가?
  • 새로운 테스트와 기존의 테스트가 변경사항에 대해 만족하는가?

seoulboy and others added 30 commits December 8, 2020 20:39
(boostcamp-2020#91) feat: Location accuracy에 따른 값 전송 유무 로직 추가
(boostcamp-2020#88) Motion Type에 따라 자동으로 러닝을 일시정지 및 재시작한다
SHIVVVPP and others added 29 commits December 20, 2020 01:32
(boostcamp-2020#191) fix: 다크모드 및 라이트모드 toggle시 annotation이 바뀌는 버그 수정
Copy link
Author

@ChocOZerO ChocOZerO left a comment

Choose a reason for hiding this comment

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

PR에 올라온 코드량이 너무 많아서 객체간의 관계를 파악하는데 어려움이 있어서 제대로 확인하지 못하고 한줄한줄 디테일에 주로 신경썼습니다.
커밋과 코드 변경을 잘게 쪼개서 PR을 올리는 습관을 들이는게 작업 의도 단위의 진행과 리뷰에 도움이 됩니다.

}

func showActivityDetailViewController() {
// TODO: detailVM 생성 실패시 처리가 필요함!!!
Copy link
Author

Choose a reason for hiding this comment

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

TODO가 해결된건지 아직 처리해야하는게 남은건지 모르겠네요.
두 경우 다 일단 이 주석이 guard 문 내부에 있는게 좀 더 위치가 정확할거 같아요.
closeSignal.send() 가 처리를 한건지 더 추가로 해야될게 있는지 모르겠어요.

if times > 0 {
return String(format: "%02d:%02d", times, minutes)
}
return String(format: "%02d:%02d", minutes, seconds)
Copy link
Author

Choose a reason for hiding this comment

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

if 문을 사용할때 논리적으로 확실하게 모든 케이스를 커버한다는 생각으로 작성하기위해 항상 else문이 있다고 생각하고 작성하는 것이 좋습니다.
if문만 있는거랑 if {} else {} 가 짝으로 있는건 완전히 다른 의도의 코드입니다.

Comment on lines +35 to +36
guard let image = UIGraphicsGetImageFromCurrentImageContext() else { return UIImage() }
return image
Copy link
Author

Choose a reason for hiding this comment

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

guard문은 보통 메소드 상단에서 메소드 내의 처리를 하기전에 조건을 걸어 탈락시키는 방어코드를 사용할때 활용하는게 좋습니다.
틀린 문법은 아니지만 guard문 위에 너무 많은 코드가 있어서 제가 처음 봤을땐 추후에 에러를 유발할 수 있는 메소드로 보입니다.

Comment on lines +45 to +56
if Date.isSameWeek(date: range.start, dateOfWeek: date) {
return "이번 주"
} else if
let lastWeekDate = Calendar.current.date(byAdding: .day, value: -7, to: date),
Date.isSameWeek(date: range.start, dateOfWeek: lastWeekDate)
{
return "저번 주"
}

if Date.isSameYear(date: range.start, dateOfYear: date) {
return range.start.toMDString + "~" + range.end.toMDString
}
Copy link
Author

Choose a reason for hiding this comment

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

모든 조건을 다 커버하는지 의심이 듭니다.
depth가 깊어지더라도 else문을 명확하게 넣어서 한눈에 모든 조건이 커버되도록 수정하는게 더 좋을 것 같습니다.

Comment on lines +18 to +22
if startIndex < endIndex {
distance = runningStates[endIndex].distance - runningStates[startIndex].distance
} else {
distance = 0
}
Copy link
Author

Choose a reason for hiding this comment

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

3항식을 활용하기에 좋은 자리 같네요.(개인취향)

motion.startDeviceMotionUpdates(using: .xMagneticNorthZVertical)

timer = Timer(fire: Date(), interval: 1.0 / 100.0, repeats: true,
block: { _ in
Copy link
Author

Choose a reason for hiding this comment

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

block 내부의 강한 self 캡처링으로 인해 위험해보이는 코드입니다.
클로저의 캡처링과 순환참조에 대해 확인하고 넘어가시기 바랍니다.

}

func startCountingSteps() {
if isActive { return }
Copy link
Author

Choose a reason for hiding this comment

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

여긴 guard문을 쓰는게 더 의도가 잘 드러날 것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants