config
This commit is contained in:
parent
537f152562
commit
c658296e2b
|
@ -56,27 +56,28 @@ class QualityAnalysisController < ApplicationController
|
|||
|
||||
def index
|
||||
@sonar_address = Redmine::Configuration['sonar_address']
|
||||
if params[:resource_id].nil?
|
||||
@name_flag = true
|
||||
@quality_analyses = QualityAnalysis.where(:project_id => @project.id)
|
||||
# @quality_analyses.map {|qa| qa.}
|
||||
# if @quality_analyses.count > 0
|
||||
# @quality_analyses.each do |qa|
|
||||
# ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
||||
#
|
||||
# end
|
||||
# end
|
||||
# projects_date = open(@sonar_address + "/api/projects/index").read
|
||||
# arr = JSON.parse(projects_date).map {|m| m["nm"]}
|
||||
# arr.map
|
||||
else
|
||||
@name_flag = false
|
||||
@resource_id = params[:resource_id]
|
||||
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
|
||||
issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read
|
||||
@sonar_issues = JSON.parse(issue_date).first
|
||||
end
|
||||
# if params[:resource_id].nil?
|
||||
# @name_flag = true
|
||||
# @quality_analyses = QualityAnalysis.where(:project_id => @project.id)
|
||||
# # @quality_analyses.map {|qa| qa.}
|
||||
# # if @quality_analyses.count > 0
|
||||
# # @quality_analyses.each do |qa|
|
||||
# # ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
||||
# #
|
||||
# # end
|
||||
# # end
|
||||
# # projects_date = open(@sonar_address + "/api/projects/index").read
|
||||
# # arr = JSON.parse(projects_date).map {|m| m["nm"]}
|
||||
# # arr.map
|
||||
# else
|
||||
qa = QualityAnalysis.where(:project_id => @project.id).first
|
||||
@resource_id = qa.author_login+":"+qa.rep_identifier
|
||||
@name_flag = false
|
||||
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
|
||||
issue_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations").read
|
||||
@sonar_issues = JSON.parse(issue_date).first
|
||||
# end
|
||||
end
|
||||
|
||||
# Find project of id params[:project_id]
|
||||
|
|
|
@ -56,10 +56,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!--quality_analysis-->
|
||||
<div class="subNav">
|
||||
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "f14 c_blue02" %>
|
||||
</div>
|
||||
<!-- more -->
|
||||
<div class="subNav subNav_jiantou" id="expand_tools_expand"><%= l(:label_project_more) %></div>
|
||||
<ul class="navContent" id="navContent">
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<div class="project_r_h">
|
||||
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
|
||||
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
|
||||
<%# if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
|
||||
<% if User.current.member_of?(@project) %>
|
||||
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier), :remote => true, :class => "btn_zipdown fr" %>
|
||||
<% end %>
|
||||
<%# else %>
|
||||
<%#= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
|
||||
<% if is_project_manager?(User.current, @project.id) && QualityAnalysis.where(:project_id => @project.id).first.nil? %>
|
||||
<%# if User.current.member_of?(@project) %>
|
||||
<%= link_to "质量分析", quality_analysis_path(:id => @project.id), :remote => true, :class => "btn_zipdown fr" %>
|
||||
<%# end %>
|
||||
<% else %>
|
||||
<%= link_to "质量分析", project_quality_analysis_path(:project_id => @project.id, :resource_id => @proje), :class => "btn_zipdown fr" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
<% if @entries.nil? %>
|
||||
|
|
Loading…
Reference in New Issue