Merge branch 'rep_quality' into develop

This commit is contained in:
huang 2016-07-01 21:34:49 +08:00
commit d346679eaf
3 changed files with 6 additions and 5 deletions

View File

@ -165,6 +165,7 @@ class QualityAnalysisController < ApplicationController
# resource_id: login + @repository.id
def index
begin
@branch = params[:branch]
@resource_id = params[:resource_id]
@sonar_address = Redmine::Configuration['sonar_address']
@jenkins_address = Redmine::Configuration['jenkins_address']
@ -177,7 +178,7 @@ class QualityAnalysisController < ApplicationController
else
if params[:current_build_status] == "failure"
job_name = params[:job_name]
@console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')
@console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
end
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,file_line,files,functions,classes,directories").read
@complexity =JSON.parse(complexity_date).first

View File

@ -2,7 +2,7 @@
<div class="project_r_h">
<h2 class="project_h2" style="width:180px;">质量分析</h2>
</div>
<p>
<%= h @console_build.to_json.html_safe %>
</p>
<div>
<%=h @console_build %>
</div>

View File

@ -2,7 +2,7 @@
<%= render :partial => "result_list" %>
<% else %>
<% if params[:current_build_status].nil? || params[:current_build_status] == "success" %>
<%= render :partial => "show", :locals => {:branch => params[:branch]} %>
<%= render :partial => "show", :locals => {:branch => @branch} %>
<% else %>
<% if params[:build_console_result] %>
运行结果超时