diff options
4 files changed, 0 insertions, 147 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java index 114597c0ae4..22e37e6bf34 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java @@ -250,7 +250,6 @@ public final class CorePlugin extends SonarPlugin { CountFalsePositivesDecorator.class, InitialOpenIssuesSensor.class, InitialOpenIssuesStack.class, - HotspotMostViolatedResourcesWidget.class, HotspotMostViolatedRulesWidget.class, MyUnresolvedIssuesWidget.class, FalsePositiveIssuesWidget.class, diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java deleted file mode 100644 index 2d4be9cb073..00000000000 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/HotspotMostViolatedResourcesWidget.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.plugins.core.widgets; - -import org.sonar.api.web.WidgetCategory; -import org.sonar.api.web.WidgetProperties; -import org.sonar.api.web.WidgetProperty; -import org.sonar.api.web.WidgetPropertyType; - -@WidgetCategory({"Hotspots"}) -@WidgetProperties({ - @WidgetProperty(key = "numberOfLines", type = WidgetPropertyType.INTEGER, defaultValue = "5") -}) -public class HotspotMostViolatedResourcesWidget extends CoreWidget { - - public HotspotMostViolatedResourcesWidget() { - super("hotspot_most_violated_resources", "Most violated resources", "/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb"); - } -} diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb deleted file mode 100644 index ca1664a30e9..00000000000 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/hotspots/hotspot_most_violated_resources.html.erb +++ /dev/null @@ -1,105 +0,0 @@ -<% - limit = widget_properties["numberOfLines"] - metric = Metric.by_key('weighted_violations') - - snapshots_conditions=["snapshots.qualifier in (:qualifiers)", "snapshots.islast=:islast", "snapshots.status = 'P'"] - snapshots_values={:qualifiers => @snapshot.leaves_qualifiers, :islast => true} - snapshots_conditions << '(snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path)' - snapshots_values[:root_sid] = (@snapshot.root_snapshot_id || @snapshot.id) - snapshots_values[:path]="#{@snapshot.path}#{@snapshot.id}.%" - - measures_conditions = ["project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL"] - measures_values = {} - measures_conditions << "project_measures.metric_id = :m_id" - measures_values[:m_id] = metric.id - - measures=ProjectMeasure.find(:all, - :joins => :snapshot, - :conditions => [(snapshots_conditions + measures_conditions).join(' AND '), snapshots_values.merge(measures_values)], - :order => "project_measures.value #{'DESC' if metric.direction<0}", - :limit => limit) - measures=measures.select{|m| m.text_value.present?} - - snapshots=Snapshot.find(measures.map { |m| m.snapshot_id }, :include => 'project') - snapshots_by_id = {} - snapshots.each do |s| - snapshots_by_id[s.id]=s - end - - title = message('widget.hotspot_most_violated_resources.name') - - if measures.empty? -%> - -<h3><%= title -%></h3> -<span class="empty_widget"><%= message('widget.hotspot_most_violated_resources.no_resource') -%></span> - -<% - else -%> - -<div class="line-block"> - <div style="float:right"> - <a class="underlined-link" href="<%= url_for_drilldown(metric) -%>"><%= message('widget.hotspot_metric.more') -%></a> - </div> - <h3><%= title -%></h3> -</div> - -<table id="most-violated-resources-<%= widget.id -%>" class="data"> - <thead> - <tr> - <th colspan="11"></th> - </tr> - </thead> - <tbody> - <% - measures.each do |measure| - resource = snapshots_by_id[measure.snapshot_id].resource - violations_per_severity={} - measure.text_value.split(';').each do |part| - fields=part.split('=') - violations_per_severity[fields[0]]=fields[1] - end - %> - <tr class="<%= cycle 'even', 'odd', :name => ('hotspot_most_violated_resources' + widget.id.to_s) -%>"> - <td> - <%= link_to_resource(resource, h(resource.name), {:metric => 'violations', :class => 'underlined-link'}) -%> - </td> - <td class="small right"> - <i class="icon-severity-blocker"></i> - </td> - <td class="small left"> - <%= violations_per_severity["BLOCKER"] ? violations_per_severity["BLOCKER"].to_s : "0" -%> - </td> - <td class="small right"> - <i class="icon-severity-critical"></i> - </td> - <td class="small left"> - <%= violations_per_severity["CRITICAL"] ? violations_per_severity["CRITICAL"].to_s : "0" -%> - </td> - <td class="small right"> - <i class="icon-severity-major"></i> - </td> - <td class="small left"> - <%= violations_per_severity["MAJOR"] ? violations_per_severity["MAJOR"].to_s : "0" -%> - </td> - <td class="small right"> - <i class="icon-severity-minor"></i> - </td> - <td class="small left"> - <%= violations_per_severity["MINOR"] ? violations_per_severity["MINOR"].to_s : "0" -%> - </td> - <td class="small right"> - <i class="icon-severity-info"></i> - </td> - <td class="small left"> - <%= violations_per_severity["INFO"] ? violations_per_severity["INFO"].to_s : "0" -%> - </td> - </tr> - <% - end - %> - </tbody> -</table> - -<% end %> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 367e8181bfc..35a26c262a7 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1205,11 +1205,6 @@ widget.hotspot_most_violated_rules.property.numberOfLines.name=Number of lines widget.hotspot_most_violated_rules.property.defaultSeverity.name=Default severity widget.hotspot_most_violated_rules.property.defaultSeverity.desc=If selected, severity used to initialize the dropdown list of widget -widget.hotspot_most_violated_resources.name=Most Violated Components -widget.hotspot_most_violated_resources.description=Shows the components that have the most issues. -widget.hotspot_most_violated_resources.no_resource=No result -widget.hotspot_most_violated_resources.property.numberOfLines.name=Number of lines - widget.my_reviews.name=My Unresolved Issues widget.my_reviews.description=Shows unresolved issues assigned to the current user. widget.my_reviews.property.numberOfLines.name=Number of lines |