css for sqale_index

This commit is contained in:
huang 2016-07-11 10:57:46 +08:00
parent cb148c3b9c
commit 831006f3c6
2 changed files with 6 additions and 7 deletions

View File

@ -213,8 +213,7 @@ class QualityAnalysisController < ApplicationController
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
else
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("http://sonar.trustie.net" + "/api/resources/index?resource=947&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
# 按名称转换成hash键值对

View File

@ -58,17 +58,17 @@
<span class="fontGrey2">可定性评价为:<span class="c_red">质量<%= @ha["sqale_rating"].nil? ? "很好" : sqale_rating_status(@ha["sqale_rating"].to_i)[0] %></span></span></div>
<div class="analysis-block mt10 mb40 f14">
<div><span class="fontGrey3 mr30">技术债务</span>
<span class="w70 pInline">
<span class="w100 pInline">
<% if @ha["sqale_index"].to_i == 0 %>
0
0
<% else %>
<%= /[0-9]*/.match(@ha["sqale_index"])[0] %>天
<%= / [0-9]*/.match(@ha["sqale_index"]).nil? ? 0 : / [0-9]*/.match(@ha["sqale_index"]) %>小时
<%= / [0-9]*/.match(@ha["sqale_index"]).nil? ? "" : / [0-9]*/.match(@ha["sqale_index"])+"小时" %>
<% end %>
</span>
<span class="fontGrey2"><a class="linkBlue2" target="_blank" href="<%= @sonar_address %>/drilldown/measures/<%= @resource_id %>?metric=sqale_index">查看详情</a></span></div>
<div><span class="fontGrey3 mr30 fl">质量问题</span>
<span class="fontBlue2 w70 pInline">
<div><span class="fontGrey3 mr30 fl">&nbsp;质量问题</span>
<span class="fontBlue2 w100 pInline">
<a class="fontBlue2 w70 pInline" target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false">
<%= @ha["violations"].nil? ? 0 : @ha["violations"] %>
</a>