Skip to content

refactor(review): remove rating model use weighted random instead #34

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 2 commits into from
Jul 24, 2023

Conversation

fabienzucchet
Copy link
Collaborator

Fixes #32

@github-actions
Copy link
Contributor

github-actions bot commented Jul 24, 2023

LOGAF Level 2 - /home/runner/work/code-review-gpt/code-review-gpt/src/review/llm/feedbackProcessor.ts

  1. The collectAndLogFeedback function is a bit redundant. It's essentially just awaiting a promise and returning the result. This could be done directly where the function is called.

  2. The pickBestFeedbacks function could be simplified. Instead of using a priority queue, you could simply sort the feedbacks by logafScore and slice the first limit items.

Example:

const pickBestFeedbacks = async (feedbacks: IFeedback[], limit: number): Promise<IFeedback[]> => {
  return feedbacks.sort((a, b) => a.logafScore - b.logafScore).slice(0, limit);
};

🔄📊✂️


Powered by Code Review GPT

@fabienzucchet fabienzucchet force-pushed the refactor/32/pick-comments-based-on-logaf branch from 5d55185 to 4c91628 Compare July 24, 2023 11:55
@fabienzucchet fabienzucchet force-pushed the refactor/32/pick-comments-based-on-logaf branch from 4c91628 to d094307 Compare July 24, 2023 11:59
@fabienzucchet fabienzucchet marked this pull request as ready for review July 24, 2023 12:02
Copy link
Owner

@mattzcarey mattzcarey left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@fabienzucchet fabienzucchet merged commit 96ed993 into main Jul 24, 2023
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.

Only similar comments are displayed
2 participants