public PullRequestKnowledgeDistribution( IEnumerable <DeveloperKnowledge> reviewers, PullRequestContext pullRequestContext, Func <PullRequestContext, PullRequestKnowledgeDistributionFactors, double> scoreComputerFunc) { PullRequestKnowledgeDistributionFactors = new PullRequestKnowledgeDistributionFactors(reviewers, pullRequestContext, scoreComputerFunc); }
internal abstract double ComputeScore(PullRequestContext pullRequestContext, PullRequestKnowledgeDistributionFactors pullRequestKnowledgeDistributionFactors);
internal override sealed double ComputeScore(PullRequestContext pullRequestContext, PullRequestKnowledgeDistributionFactors pullRequestKnowledgeDistributionFactors) { var scores = new List <double>(); foreach (var reviewer in pullRequestKnowledgeDistributionFactors.Reviewers) { double score = reviewer.Score == 0 ? ComputeReviewerScore(pullRequestContext, reviewer) : reviewer.Score; scores.Add(score); } return(scores.Aggregate((a, b) => a + b)); }
public int CompareTo(PullRequestKnowledgeDistribution other) { return(PullRequestKnowledgeDistributionFactors.CompareTo(other.PullRequestKnowledgeDistributionFactors)); }