public PullRequestKnowledgeDistribution(
     IEnumerable <DeveloperKnowledge> reviewers,
     PullRequestContext pullRequestContext,
     Func <PullRequestContext, PullRequestKnowledgeDistributionFactors, double> scoreComputerFunc)
 {
     PullRequestKnowledgeDistributionFactors = new PullRequestKnowledgeDistributionFactors(reviewers, pullRequestContext, scoreComputerFunc);
 }
Exemple #2
0
 internal abstract double ComputeScore(PullRequestContext pullRequestContext, PullRequestKnowledgeDistributionFactors pullRequestKnowledgeDistributionFactors);
Exemple #3
0
        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));
 }