diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index cb86f1165..f3ba6f76c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -300,8 +300,6 @@ class ProjectsController < ApplicationController return end - logger.debug "111111111"*100 - # over @author = params[:user_id].blank? ? nil : User.active.find(params[:user_id]) @page = params[:page] ? params[:page].to_i + 1 : 0 # 根据私密性,取出符合条件的所有数据 @@ -321,7 +319,7 @@ class ProjectsController < ApplicationController else @events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10); end - logger.debug "2"*100 + # g = Gitlab.client unless @project.gpid.nil? || @project.project_score.changeset_num == 0 # rep_statics_commit = @project.rep_statics.order("commits_num desc") @@ -335,20 +333,14 @@ class ProjectsController < ApplicationController @a_commits_del = rep_statics_code.map {|s| s.del.to_i } @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } g = Gitlab.client - logger.debug "3"*100 begin gid = @project.gpid - logger.debug "31"*100 - g_branch = g.project(gid) - logger.debug "4"*100 - g_branch = g_branch.default_branch.to_s - logger.debug "5"*100 + g_project = g.project(gid) + g_branch = g_project.default_branch.to_s rescue =>e - logger.error("get gitlab project failed: " + e) + logger.error("get default branch failed: " + e) end - logger.debug "6"*100 @rev = g_branch.nil? ? "master" : g_branch - logger.debug "7"*100 end # 根据对应的请求,返回对应的数据 respond_to do |format| diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 6b50c1788..cff255fe6 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -165,7 +165,7 @@ class QualityAnalysisController < ApplicationController logger.info("result: delete job ###################==>#{d_job}") qa.delete respond_to do |format| - format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)} + format.html{redirect_to project_repository_path(@project)} end rescue Exception => e puts e @@ -199,9 +199,6 @@ class QualityAnalysisController < ApplicationController # update成功则返回 ‘200’ jenkins_job = @client.job.update("#{job_name}", @doc.to_xml) - get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280") - logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200' - # 数据更新到Trustie数据 if jenkins_job == '200' logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}") diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index b364f5f89..7901c6be0 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -34,7 +34,7 @@

代码重复度

<%= @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] %> + <%= @ha["duplicated_lines_density"].nil? ? "良好" : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>

@@ -43,7 +43,7 @@

注释率

<%= @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] %> + <%= @ha["comment_lines_density"].nil? ? "较低" : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>