From 9f15a8aa4e41d0d19f86447be297669d5a08f81e Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 22 Jun 2016 17:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=E5=88=86?= =?UTF-8?q?=E6=9E=90=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quality_analysis/_result_list.html.erb | 0 app/views/quality_analysis/_show.html.erb | 148 ++++++++++++++++++ app/views/quality_analysis/index.html.erb | 2 +- .../repositories/_quality_analysis.html.erb | 32 +++- public/images/code-analysis-icon.png | Bin 0 -> 1682 bytes public/stylesheets/project.css | 22 +++ public/stylesheets/public.css | 3 + 7 files changed, 199 insertions(+), 8 deletions(-) create mode 100644 app/views/quality_analysis/_result_list.html.erb create mode 100644 app/views/quality_analysis/_show.html.erb create mode 100644 public/images/code-analysis-icon.png diff --git a/app/views/quality_analysis/_result_list.html.erb b/app/views/quality_analysis/_result_list.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb new file mode 100644 index 000000000..4cb86f22c --- /dev/null +++ b/app/views/quality_analysis/_show.html.erb @@ -0,0 +1,148 @@ +
+
+

SonarQube质量分析

+
+
+
+ + 分支: + +
+
+ 开始分析 +
+
项目代码质量分析报告
+
概要信息
+
+
+

质量等级

+

A正常

+
+
+

复杂度

+

44正常

+
+
+

重复

+

44%正常

+
+
+

注释率

+

12%偏低

+
+
+
质量等级2/5分可定性评价为:质量中等
+
+
技术债务14天查看详情
+
质量问题130问题分类如下:
+
+
阻断4
+
严重75
+
主要428
+
次要225
+
信息114
+
+
+
代码规模可定性评价为:规模中等
+
+
+

代码行数

+

9,337

+
+
+

文件

+

10

+
+
+

目录

+

6

+
+
+

+

15

+
+
+

方法

+

36

+
+
+
贡献统计
+
+
    +
  •  
  • +
  • 代码行数
  • +
  • 引入质量问题数
  • +
  • 引入质量问题数/代码行数
  • +
    +
+
    +
  • +
    + +
    +
  • +
  • 18340
  • +
  • 230
  • +
  • .012540
  • +
    +
+
    +
  • +
    + +
    +
  • +
  • 834
  • +
  • 34
  • +
  • .04077
  • +
    +
+
    +
  • +
    + +
    +
  • +
  • 134
  • +
  • 10
  • +
  • .07462
  • +
    +
+
+
\ No newline at end of file diff --git a/app/views/quality_analysis/index.html.erb b/app/views/quality_analysis/index.html.erb index 627d33d96..3ce1a8e4a 100644 --- a/app/views/quality_analysis/index.html.erb +++ b/app/views/quality_analysis/index.html.erb @@ -5,6 +5,6 @@

<% end %> <% else %> - <%= @cc %> + <%= render "show" %> <% end %> diff --git a/app/views/repositories/_quality_analysis.html.erb b/app/views/repositories/_quality_analysis.html.erb index 64dd837b7..bf1b9ea41 100644 --- a/app/views/repositories/_quality_analysis.html.erb +++ b/app/views/repositories/_quality_analysis.html.erb @@ -1,7 +1,25 @@ -<%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier), :remote => true , :class => 'resourcesSearchloadBox mt10', :id => 'quality_analyses_form') do %> - - <%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch' %> - <%= select_tag :language, options_for_select(["Java","C","PHP", "Web"]), :id => 'branch' %> -
确定
-
取消
-<% end %> \ No newline at end of file +
+
代码质量分析
+
+ <%= form_tag( url_for(:controller => 'quality_analysis', :action => 'create', :project_id => @project.id, :user_id => User.current.id, :identifier => @repository.identifier), :remote => true, :id => 'quality_analyses_form') do %> +
+
+ +
+
+
+ <%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch', :class => "analysis-option-box" %> +
+
+
+
+ <%= select_tag :language, options_for_select(["Java","C","PHP", "Web"]), :id => 'branch', :class => "analysis-option-box" %> +
+
+ + +
+
+ <% end %> +
+
\ No newline at end of file diff --git a/public/images/code-analysis-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>{}U5njdPTO7qmLzQ7X=Q&FF=ah%$`yBOU7SC#t!u%SlGSbIGwVy0#Qu1@bbtJY zM@!n0yy83e#nh(C!oje(Fxg>Ro#l(7xXvTfoN(d?&nQKe3H;5J*@|-sUeDIkb)2c0 zlp2MVzY(sTMO*23RRsfXyXsZuZi(;3=^0J?X%BQ|qV0EQm zsPu(bS$?@avt^0hsfs+cv3CA+AcNDAtUqSE@0w>TFG{)SGZcJZ;JSC!2`07tu^;M)y!Lw@}fDE#kPopk)<=#%OX}kEu3-S zGL$1J`9`m2XFz4)txmT5N?HnH`E{@4!p;Y2^;MdWzuR3=S#!qOF#EKVcd8${6vo7k z4ecBe)#u*Z6LRzC4fQVJx9e%NDj&s139Z#%ga Tpie)c2mcaMu^c*|lwSBZiC*=^ literal 0 HcmV?d00001 diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 90a94b52f..0774fa892 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1246,3 +1246,25 @@ a.pages-big{ width:50px;} .red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} + +/*20160622质量分析*/ +.analysis-tag-wrap {width:100%; color:#000; height:20px; line-height:20px; vertical-align:middle;} +.analysis-tag {width:10px; height:20px; background-color:#777;} +.analysis-block {padding:15px; border:1px solid #d9d9d9;} +.flex {display:flex;} +.analysis-genral {flex:1; display:block; text-align:center;} +.analysis-block-icon {background:url(../images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-serious-icon {background:url(../images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-main-icon {background:url(../images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-secondary-icon {background:url(../images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-info-icon {background:url(../images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.quality-percentage {width:320px; height:14px; display:inline-block;} +.quality-percentage-rate {width:50%; height:14px; background-color:#0a6c99; display:inline-block;} +.image-cir {border-radius:50%;} +.analysis-genral-icon {position:absolute; padding:1px 5px; display:inline-block; top:5px;} +.contribute-list-avatar {width:80px; vertical-align:middle; text-align:center;} +.contribute-list-code {width:160px; vertical-align:middle; text-align:center;} +.contribute-list-problem {width:170px; vertical-align:middle; text-align:center;} +.contribute-list-rate {width:228px; vertical-align:middle; text-align:center;} +.contribute-list-height {height:80px;} +.contribute-list-line-height {line-height:80px;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d9306fa0b..e33ac601e 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -1161,3 +1161,6 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(.. .shadowbox_news_list li:hover{ background-color:#eee;} span.shadowbox_news_user{ color:#3b94d6;} a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;} + +/*20160622代码分析弹窗*/ +.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}