diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index a6b5f09cf..fa2c87f8c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -18,6 +18,8 @@ class AttachmentsController < ApplicationController layout "users_base" + before_filter :verify_authenticity_token, only: [:uploa] + before_filter :find_project, :only => [:show, :download, :thumbnail, :destroy, :delete_homework]#, :except => [:upload, :autocomplete] before_filter :file_readable, :read_authorize, :only => [:show, :thumbnail]#Modified by young before_filter :delete_authorize, :only => [:destroy] diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index 0f5aebc2d..b364f5f89 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -21,7 +21,7 @@

复杂度

-

<%= @ha["function_complexity"].nil? ? 0 : @ha["function_complexity"] %> +

<%= @ha["function_complexity"].to_i == 0 ? 0 : @ha["function_complexity"] %> borderRadius"> <%= @ha["function_complexity"].nil? ? "良好" : complexity_status(@ha["function_complexity"].to_i)[0] %> @@ -32,7 +32,7 @@

代码重复度

-

<%= @ha["duplicated_lines_density"].nil? ? 0 : @ha["duplicated_lines_density"] %> +

<%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %> borderRadius"> <%= @ha["duplicated_lines_density"].nil? ? 0 : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %> @@ -41,7 +41,7 @@

注释率

-

<%= @ha["comment_lines_density"].nil? ? 0 : @ha["comment_lines_density"] %> +

<%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %> borderRadius"> <%= @ha["comment_lines_density"].nil? ? 0 : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %> @@ -70,33 +70,33 @@

 质量问题 - <%= @ha["violations"].nil? ? 0 : @ha["violations"] %> + <%= @ha["violations"].to_i %>  问题分类如下:
@@ -107,23 +107,23 @@

代码行数

-

<%= @ha["lines"].nil? ? 0 : @ha["lines"] %>

+

<%= @ha["lines"].to_i %>

文件

-

<%= @ha["lines"].nil? ? 0 : @ha["lines"] %>

+

<%= @ha["files"].to_i %>

目录

-

<%= @ha["directories"].nil? ? 0 : @ha["directories"] %>

+

<%= @ha["directories"].to_i %>

-

<%= @ha["classes"].nil? ? 0 : @ha["classes"] %>

+

<%= @ha["classes"].to_i %>

方法

-

<%=@ha["functions"].nil? ? 0 : @ha["functions"] %>

+

<%= @ha["functions"].to_i %>