change sonar reuslts

This commit is contained in:
huang 2016-09-09 09:00:21 +08:00
parent 6dbb2e4e94
commit 8bb2b5e8d9
1 changed files with 1 additions and 1 deletions

View File

@ -252,7 +252,7 @@ class QualityAnalysisController < ApplicationController
unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i unresolved_issue_count = JSON.parse(unresolved_issues)["total"].to_i
all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read all_issues = open(@sonar_address + "/api/issues/search?projectKeys=#{@resource_id}&authors=#{email}").read
all_issue_count = JSON.parse(all_issues)["total"].to_i all_issue_count = JSON.parse(all_issues)["total"].to_i
ratio = (changes == 0 ? 0 : format("%0.4f",unresolved_issue_count.to_f/changes.to_f)) ratio = ((changes == 0 || all_issue_count == 0) ? 0 : format("%0.4f",all_issue_count.to_f/changes.to_f))
@user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count} @user_quality_infos << {:email => email, :changes => changes, :unresolved_issue_count => unresolved_issue_count, :ratio => ratio, :all_issue_count => all_issue_count}
end end