Merge branch 'rep_quality' of https://git.trustie.net/jacknudt/trustieforge into rep_quality

This commit is contained in:
huang 2016-08-24 17:38:40 +08:00
commit 7493de1334
4 changed files with 2 additions and 14 deletions

View File

@ -237,11 +237,6 @@ class QualityAnalysisController < ApplicationController
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"] arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)} @quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
else else
languate_arr = ['ruby', 'c#', 'c++', 'c']
qa_language = QualityAnalysis.where(:sonar_name => @resource_id).first.try(:language)
if !qa_language.blank? && languate_arr.include?(qa_language)
@language_flag = true
end
filter = "sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,files,functions,classes,directories,blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations" filter = "sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,files,functions,classes,directories,blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations"
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read
@complexity =JSON.parse(complexity_date).first @complexity =JSON.parse(complexity_date).first

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="mb10"> <div class="mb10">
<div> <div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %> <%= select_tag :language, options_for_select(["java","python","c#"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
</div> </div>
</div> </div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div> <div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div>

View File

@ -3,13 +3,6 @@
<h2 class="project_h2" style="width:180px;">质量分析</h2> <h2 class="project_h2" style="width:180px;">质量分析</h2>
</div> </div>
<% if @language_flag %>
<div class="flash warning">
本平台使用的代码质量分析工具是sonar开源质量数据报告工具目前ruby、c++、c#语言的分析结果可能存在一定的偏差,
建议结合其他数据质量分析工具进行综合判断。
</div>
<% end %>
<div class="button-rep">当前分支:<%= params[:branch] %></div> <div class="button-rep">当前分支:<%= params[:branch] %></div>
<div class="cl"></div> <div class="cl"></div>
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div> <div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>

View File

@ -12,7 +12,7 @@
</div> </div>
<div class="mb10"> <div class="mb10">
<div> <div>
<%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %> <%= select_tag :language, options_for_select(["java","python","c#"]), :id => 'branch', :class => "analysis-option-box" %>
</div> </div>
</div> </div>
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').css('opacity','0.8').text('正在分析中…………(大概需要30分钟请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div> <div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-indicator').css('opacity','0.8').text('正在分析中…………(大概需要30分钟请耐心等待)').show();$('#quality_analyses_form').submit();hideModal()">提交</a></div>