-
Notifications
You must be signed in to change notification settings - Fork 0
인바디 에러 표시 수정 #140
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
Merged
Merged
인바디 에러 표시 수정 #140
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
코드 패치에 대해 몇 가지 우려 사항이 있습니다:
데이터 검증 로직:
finalWeight,finalBodyFatPercentage,finalSkeletalMuscleMass의 유효성을 검사하는 것에 대한 조건은 적절하지만,finalSkeletalMuscleMass의 값을 확인하는 코드가 없으니 여기에 대한 확인이 필요합니다. 사용자가 해당 값의 тип видуけ, API 호출 시 오류를 방지할 수 있습니다.부적합한 조건 처리:
finalWeight,finalBodyFatPercentage,finalSkeletalMuscleMass는 모두 0으로 초기화될 수 있습니다. 따라서 이 코드에서 이는 유효 응답이 아닐 경우 0인지 확인하는 조건을 다시 생각해 볼 필요가 있습니다.비어있는 범위:
inBodyData가 널이거나,finalWeight,finalBodyFatPercentage,finalSkeletalMuscleMass가 모두 0인 경우에만 API 호출을 하지 않도록 하고 하지만 하드코딩된 값인 0에 대한 설명이 필요할 수 있습니다. 잠재적으로 다른 상황에서 이들 값이 0인 것이 유효한 경우인지에 대한 논의가 필요합니다.로깅 메시지:
console.log는 디버깅을 위한 좋은 도구지만, 프로덕션 환경에서는 로그 레벨을 조정하거나 더 정교한 로깅 시스템을 사용하는 것을 고려할 수 있습니다. 이는 개발, 테스트 및 운영 환경을 구분해야 할 필요가 있을 수 있습니다.타입 안전성:
route,navigation등의 타입을any로 지정하는 것은 프로그램에서 타입 안전성을 떨어뜨릴 수 있습니다. 명확한 인터페이스를 정의하여 작업을 더 안전하게 만들 수 있습니다.이러한 점들을 고려할 때, 현재 상태에서는 코드가 문제가 발생할 가능성이 있으므로 머지하기 전에 수정하는 것이 좋습니다.