diff --git a/app/controllers/api/v1/projects/portrait_controller.rb b/app/controllers/api/v1/projects/portrait_controller.rb index f37e30a2a..9cf3259bc 100644 --- a/app/controllers/api/v1/projects/portrait_controller.rb +++ b/app/controllers/api/v1/projects/portrait_controller.rb @@ -135,7 +135,7 @@ class Api::V1::Projects::PortraitController < Api::V1::BaseController pullrequest_count = PullRequest.where(project_id: @project.id).count issue_count = Issue.issue_issue.where(project_id: @project.id).count health_code1 = max_member_count.to_i == 0 ? 0 : 0.3*(member_count.to_f/max_member_count) - health_code2 = last_commit_day.to_i == 0 ? 0 : 0.7*(1.to_f/(1+last_commit_day)) + health_code2 = last_commit_day.to_i == 0 ? 0 : 0.7*(1.to_f/(1+last_commit_day*0.1)) health_code = 10 * (health_code1 + health_code2) health_license = 10 * has_license health_pullrequest = pullrequest_count <= 1 ? 0 : 40 * (closed_pullrequest_count.to_f/pullrequest_count)*(1-1/Math.sqrt(pullrequest_count+1))