-
Notifications
You must be signed in to change notification settings - Fork 4
refactor : main build #300
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
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
Oops, something went wrong.
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.
코드 리뷰를 통해 몇 가지 개선 사항과 잠재적인 버그 위험 요소를 제안하겠습니다.
Null 체크:
company가 null일 가능성에 대한 검증이 없습니다.companyService.getCompany(companyId)가 null을 반환하면 이후의 코드에서 NPE(Null Pointer Exception)가 발생할 수 있습니다. 회사가 존재하지 않는 경우에 대한 예외 처리를 추가하는 것이 좋습니다.filter 유효성 검사:
filter파라미터에 대한 유효성 검사가 필요합니다. 전달된filter값이 비어있거나 유효하지 않은 경우에 대한 검증 로직을 추가하는 것이 좋습니다.메소드 분리: 코드 가독성을 높이기 위해
findProjects와companyProjects를 생성하는 부분을 별도의 메소드로 분리할 수 있습니다. 이는 코드의 재사용성을 높이고 단위를 분리하는 데 도움이 됩니다.Stream API 성능 고려: 프로젝트 태그를 가져오는
projectService.getProjectTags(project.getId())가 각각의 프로젝트에 대해 호출됩니다. 만약findProjects에 프로젝트 수가 많다면 성능 이슈가 발생할 수 있습니다. 필요한 태그를 한 번에 가져오고 이를 매핑하는 방식으로 개선할 수 있습니다.예외 처리:
projectService.getProjectTags에서 발생할 수 있는 예외에 대한 처리를 고려해야 합니다. 외부 호출에 대해 예외 처리를 하지 않으면 시스템의 안정성에 영향을 줄 수 있습니다.주석 추가: 코드의 각 부분이 어떤 역할을 하는지를 설명하는 주석을 추가하는 것이 좋습니다. 다른 개발자가 코드를 이해하는 데 도움이 됩니다.
위의 사항들을 고려하여 코드를 수정하면 더욱 견고하고 유지보수하기 쉬운 코드가 될 것입니다.