Merge branch 'rep_quality' of https://git.trustie.net/jacknudt/trustieforge into rep_quality
This commit is contained in:
commit
7493de1334
|
@ -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"]
|
||||
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
|
||||
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"
|
||||
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read
|
||||
@complexity =JSON.parse(complexity_date).first
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
<div class="mb10">
|
||||
<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 class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="$('#quality_analyses_edit_form').submit();hideModal()">提交</a></div>
|
||||
|
|
|
@ -3,13 +3,6 @@
|
|||
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
||||
</div>
|
||||
|
||||
<% if @language_flag %>
|
||||
<div class="flash warning">
|
||||
本平台使用的代码质量分析工具是sonar开源质量数据报告工具,目前ruby、c++、c#语言的分析结果可能存在一定的偏差,
|
||||
建议结合其他数据质量分析工具进行综合判断。
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="button-rep">当前分支:<%= params[:branch] %></div>
|
||||
<div class="cl"></div>
|
||||
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
<div class="mb10">
|
||||
<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 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>
|
||||
|
|
Loading…
Reference in New Issue