2016-06-23 17:21:18 +08:00
|
|
|
<%= javascript_include_tag 'highcharts','highcharts-more' %>
|
2016-06-27 18:13:46 +08:00
|
|
|
<div class="project_r_h">
|
|
|
|
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
|
|
|
</div>
|
2016-06-24 17:39:10 +08:00
|
|
|
<div class="button-rep">当前分支:<%= params[:branch] %></div>
|
2016-06-22 17:40:13 +08:00
|
|
|
<div class="cl"></div>
|
|
|
|
<div class="tac f20 fb mt35 mb30">项目代码质量分析报告</div>
|
|
|
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">概要信息</span></div>
|
2016-06-29 09:10:47 +08:00
|
|
|
<% if @complexity["msr"].count > 3 %>
|
|
|
|
<%= render :partial => "hightchars" %>
|
|
|
|
<div class="analysis-block mt10 mb40 f14">
|
|
|
|
<div class="flex">
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p id="container_sqale_rating" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
|
|
|
<p class="fontGrey3">质量等级</p>
|
|
|
|
<p class="fontBlue2 pr"><%= @complexity["msr"][9].nil? ? 0 : @complexity["msr"][9]["frmt_val"] %>
|
|
|
|
<span class="f10 c_white analysis-genral-icon <%=@complexity["msr"][9].nil? ? "" : sqale_rating_status(@complexity["msr"][9]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][9].nil? ? 0 : sqale_rating_status(@complexity["msr"][9]["val"].to_i)[0] %></span></p>
|
|
|
|
</div>
|
|
|
|
<div class="analysis-genral" >
|
|
|
|
<p id="container_function_complexity" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
|
|
|
<p class="fontGrey3">复杂度</p>
|
|
|
|
<p class="fontBlue2 pr"><%= @complexity["msr"][6].nil? ? 0 : @complexity["msr"][6]["val"] %>
|
|
|
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][6].nil? ? "" : complexity_status(@complexity["msr"][6]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][6].nil? ? 0 : complexity_status(@complexity["msr"][6]["val"].to_i)[0] %></span></p>
|
|
|
|
</div>
|
2016-06-23 17:21:18 +08:00
|
|
|
</div>
|
2016-06-29 09:10:47 +08:00
|
|
|
<div class="flex">
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p id="container_duplicated_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
|
|
|
<p class="fontGrey3">代码重复度</p>
|
|
|
|
<p class="fontBlue2 pr"><%= @complexity["msr"][7].nil? ? 0 : @complexity["msr"][7]["frmt_val"] %>
|
|
|
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][7].nil? ? "" : duplicated_lines_density_status(@complexity["msr"][7]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][7].nil? ? 0 : duplicated_lines_density_status(@complexity["msr"][7]["val"].to_i)[0] %></span></p>
|
|
|
|
</div>
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p id="container_comment_lines_density" style="max-width:200px;min-height:200px;width:200px; margin:0 auto;"></p>
|
|
|
|
<p class="fontGrey3">注释率</p>
|
|
|
|
<p class="fontBlue2 pr"><%= @complexity["msr"][5].nil? ? 0 : @complexity["msr"][5]["frmt_val"] %>
|
|
|
|
<span class="f10 c_white analysis-genral-icon <%= @complexity["msr"][5].nil? ? "" : comment_lines_density_status(@complexity["msr"][5]["val"].to_i)[1] %> borderRadius"><%= @complexity["msr"][5].nil? ? 0 : comment_lines_density_status(@complexity["msr"][5]["val"].to_i)[0] %></span></p>
|
|
|
|
</div>
|
2016-06-23 17:21:18 +08:00
|
|
|
</div>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
2016-06-29 09:10:47 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">质量等级</span><span class="mr10 fontGrey2"><span class="c_red f18" style="margin-top:-5px; display:inline-block;"><%=@complexity["msr"][9].nil? ? 0 : score_sqale_rating(@complexity["msr"][9]["val"].to_i) %></span>/5分</span>
|
|
|
|
<span class="fontGrey2">可定性评价为:<span class="c_red">质量<%=@complexity["msr"][9].nil? ? 0 : sqale_rating_status(@complexity["msr"][9]["val"])[0] %></span></span></div>
|
2016-06-22 17:40:13 +08:00
|
|
|
<div class="analysis-block mt10 mb40 f14">
|
2016-06-29 09:10:47 +08:00
|
|
|
<div><span class="fontGrey3 mr30">技术债务</span><span class="fontBlue2 w70 pInline"><%=@complexity["msr"][8].nil? ? 0 : @complexity["msr"][8]["frmt_val"] %></span>
|
|
|
|
<span class="fontGrey2"><a target="_blank" href="<%= @sonar_address %>/drilldown/measures/<%= @resource_id %>?metric=sqale_index">查看详情</a></span></div>
|
2016-06-28 17:18:50 +08:00
|
|
|
<div><span class="fontGrey3 mr30 fl">质量问题</span>
|
2016-06-29 09:10:47 +08:00
|
|
|
<span class="fontBlue2 w70 pInline"><a class="fontBlue2 w70 pInline" target="_blank" href="<%= @sonar_address %>/component_issues?id=<%= @resource_id %>#resolved=false"><%=@sonar_issues["msr"][0].nil? ? 0 : @sonar_issues["msr"][0]["frmt_val"] %></a></span><span class="fontGrey2">问题分类如下:</span></div>
|
2016-06-22 17:40:13 +08:00
|
|
|
<div class="ml90 mt15">
|
2016-06-29 09:10:47 +08:00
|
|
|
<div class="mb10"><span class="analysis-block-icon mr5"></span><span class="fontGrey3 mr45">阻断</span>
|
|
|
|
<span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][1].nil? ? 0 : @sonar_issues["msr"][1]["frmt_val"] %></span>
|
|
|
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][1].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][1]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
|
|
|
<div class="mb10"><span class="analysis-serious-icon mr5"></span><span class="fontGrey3 mr45">严重</span>
|
|
|
|
<span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][2].nil? ? 0 : @sonar_issues["msr"][2]["frmt_val"] %></span>
|
|
|
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][2].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][2]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
|
|
|
<div class="mb10"><span class="analysis-main-icon mr5"></span><span class="fontGrey3 mr45">主要</span>
|
|
|
|
<span class="fontBlue2 w70 pInline"><%= @sonar_issues["msr"][3].nil? ? 0 : @sonar_issues["msr"][3]["frmt_val"] %></span>
|
|
|
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][3].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][3]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
|
|
|
<div class="mb10"><span class="analysis-secondary-icon mr5"></span><span class="fontGrey3 mr45">次要</span>
|
|
|
|
<span class="fontBlue2 w70 pInline"><%=@sonar_issues["msr"][4].nil? ? 0 : @sonar_issues["msr"][4]["frmt_val"] %></span>
|
|
|
|
<span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][4].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][4]["frmt_val"].to_i, 1000) %>%;"></span></span></div>
|
|
|
|
<div><span class="analysis-info-icon mr5"></span><span class="fontGrey3 mr45">信息</span>
|
|
|
|
<span class="fontBlue2 w70 pInline"><%=@sonar_issues["msr"][5].nil? ? 0 : @sonar_issues["msr"][5]["frmt_val"] %></span><span class="quality-percentage"><span class="quality-percentage-rate" style="width:<%=@sonar_issues["msr"][5].nil? ? 0 : statistics_result_percentage(@sonar_issues["msr"][5]["frmt_val"].to_i, 200) %>%;"></span></span></div>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-06-29 09:10:47 +08:00
|
|
|
<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl mr10">代码规模</span><span class="fontGrey2">可定性评价为:<span class="c_red"><%=@complexity["msr"][0].nil? ? 0 : lines_scale(@complexity["msr"][0]["frmt_val"].to_i) %></span></span></div>
|
2016-06-22 17:40:13 +08:00
|
|
|
<div class="analysis-block mt10 mb40 flex f14">
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p class="fontGrey3">代码行数</p>
|
2016-06-29 09:10:47 +08:00
|
|
|
<p class="fontBlue2"><%= @complexity["msr"][0].nil? ? 0 : @complexity["msr"][0]["frmt_val"] %></p>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p class="fontGrey3">文件</p>
|
2016-06-29 09:10:47 +08:00
|
|
|
<p class="fontBlue2"><%= @complexity["msr"][2].nil? ? 0 : @complexity["msr"][2]["frmt_val"] %></p>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p class="fontGrey3">目录</p>
|
2016-06-29 09:10:47 +08:00
|
|
|
<p class="fontBlue2"><%= @complexity["msr"][3].nil? ? 0 : @complexity["msr"][3]["frmt_val"] %></p>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p class="fontGrey3">类</p>
|
2016-06-29 09:10:47 +08:00
|
|
|
<p class="fontBlue2"><%= @complexity["msr"][1].nil? ? 0 : @complexity["msr"][1]["frmt_val"] %></p>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
<div class="analysis-genral">
|
|
|
|
<p class="fontGrey3">方法</p>
|
2016-06-29 09:10:47 +08:00
|
|
|
<p class="fontBlue2"><%=@complexity["msr"][4].nil? ? 0 : @complexity["msr"][4]["frmt_val"] %></p>
|
2016-06-22 17:40:13 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-06-24 13:00:02 +08:00
|
|
|
<!--<div class="analysis-tag-wrap f16"> <span class="analysis-tag fl mr15"></span> <span class="fb fl">贡献统计</span></div>-->
|
|
|
|
<!--<div class="analysis-block mt10 f12">-->
|
|
|
|
<!--<ul class="contribute-list">-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-avatar"> </li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-code">代码行数</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-problem">引入质量问题数</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-rate">引入质量问题数/代码行数</li>-->
|
|
|
|
<!--<div class="cl"></div>-->
|
|
|
|
<!--</ul>-->
|
|
|
|
<!--<ul class="contribute-list">-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
|
|
|
|
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
|
|
|
|
<!--<p class="fontGrey2 hidden">小明</p>-->
|
|
|
|
<!--</div>-->
|
|
|
|
<!--</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">18340</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">230</li>-->
|
|
|
|
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.012540</li>-->
|
|
|
|
<!--<div class="cl"></div>-->
|
|
|
|
<!--</ul>-->
|
|
|
|
<!--<ul class="contribute-list">-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
|
|
|
|
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
|
|
|
|
<!--<p class="fontGrey2 hidden">小王</p>-->
|
|
|
|
<!--</div>-->
|
|
|
|
<!--</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">834</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">34</li>-->
|
|
|
|
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.04077</li>-->
|
|
|
|
<!--<div class="cl"></div>-->
|
|
|
|
<!--</ul>-->
|
|
|
|
<!--<ul class="contribute-list">-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-avatar contribute-list-height">-->
|
|
|
|
<!--<div class="mt8"><img src="images/homepageImage.jpg" width="50" class="image-cir" />-->
|
|
|
|
<!--<p class="fontGrey2 hidden">小亮</p>-->
|
|
|
|
<!--</div>-->
|
|
|
|
<!--</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-code contribute-list-height contribute-list-line-height">134</li>-->
|
|
|
|
<!--<li class="fl fontGrey2 contribute-list-problem contribute-list-height contribute-list-line-height">10</li>-->
|
|
|
|
<!--<li class="fl contribute-list-rate fontBlue2 contribute-list-height contribute-list-line-height">.07462</li>-->
|
|
|
|
<!--<div class="cl"></div>-->
|
|
|
|
<!--</ul>-->
|
|
|
|
<!--</div>-->
|