Browse Source

修复:项目健康度代码维度分母变小

pull/348/head^2^2
yystopf 1 year ago
parent
commit
7067c7d190
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/api/v1/projects/portrait_controller.rb

+ 1
- 1
app/controllers/api/v1/projects/portrait_controller.rb View File

@@ -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))


Loading…
Cancel
Save