widget.time_machine.name=History Table
widget.time_machine.description=Displays up to 10 metrics in a table, showing their value for a specified number of past snapshots.
-widget.ckjm.name=Chidamber & Kemerer
-widget.ckjm.description=Reports on LCOM4 and RFC average and distribution.
-widget.ckjm.lcom4=LCOM4
-widget.ckjm.per_class.suffix=\ /class
-widget.ckjm.files_having_lcom_greater_than_one=\ files having LCOM4>1
-widget.ckjm.rfc=Response for Class
-
widget.file_design.name=File design
widget.file_design.description=Reports on files dependency cycles and tangle index.
widget.file_design.file_tangle_index=File tangle index
widget.filter.description=Shows a pre-configured filter
widget.filter.edit=Edit my filters
+widget.lcom4.name=LCOM4
+widget.lcom4.description=Reports on LCOM4 average and distribution.
+widget.lcom4.title=LCOM4
+widget.lcom4.per_class.suffix=\ /class
+widget.lcom4.files_having_lcom_greater_than_one=\ files having LCOM4>1
+
+widget.rfc.name=Response for class
+widget.rfc.description=Reports on RFC average and distribution.
+widget.rfc.title=Response for Class
+widget.rfc.per_class.suffix=\ /class
+
widget.resource_id=project
#------------------------------------------------------------------------------
import org.sonar.plugins.design.ui.dependencies.DependenciesViewer;
import org.sonar.plugins.design.ui.libraries.GwtLibrariesPage;
import org.sonar.plugins.design.ui.page.GwtDesignPage;
-import org.sonar.plugins.design.ui.widgets.ChidamberKemererWidget;
import org.sonar.plugins.design.ui.widgets.FileDesignWidget;
+import org.sonar.plugins.design.ui.widgets.LCOM4Widget;
import org.sonar.plugins.design.ui.widgets.PackageDesignWidget;
+import org.sonar.plugins.design.ui.widgets.ResponseForClassWidget;
import java.util.List;
public class DesignPlugin extends SonarPlugin {
+ @SuppressWarnings("unchecked")
public List<Class<? extends Extension>> getExtensions() {
return ImmutableList.of(
// Batch
DependenciesViewer.class,
FileDesignWidget.class,
PackageDesignWidget.class,
- ChidamberKemererWidget.class);
+ LCOM4Widget.class,
+ ResponseForClassWidget.class);
}
}
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.plugins.design.ui.widgets;
-
-import org.sonar.api.web.AbstractRubyTemplate;
-import org.sonar.api.web.RubyRailsWidget;
-import org.sonar.api.web.UserRole;
-import org.sonar.api.web.WidgetCategory;
-
-@UserRole(UserRole.USER)
-@WidgetCategory({ "Design" })
-public final class ChidamberKemererWidget extends AbstractRubyTemplate implements RubyRailsWidget {
-
- public String getId() {
- return "ckjm";
- }
-
- public String getTitle() {
- return "Chidamber & Kemerer";
- }
-
- @Override
- protected String getTemplatePath() {
- return "/org/sonar/plugins/design/ui/widgets/chidamber_kemerer.html.erb";
- }
-}
\ No newline at end of file
--- /dev/null
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.design.ui.widgets;
+
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.RubyRailsWidget;
+import org.sonar.api.web.UserRole;
+import org.sonar.api.web.WidgetCategory;
+
+@UserRole(UserRole.USER)
+@WidgetCategory({"Design"})
+public final class LCOM4Widget extends AbstractRubyTemplate implements RubyRailsWidget {
+
+ public String getId() {
+ return "lcom4";
+ }
+
+ public String getTitle() {
+ return "LCOM4";
+ }
+
+ @Override
+ protected String getTemplatePath() {
+ return "/org/sonar/plugins/design/ui/widgets/lcom4.html.erb";
+ }
+}
--- /dev/null
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar 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.
+ *
+ * Sonar 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 Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.plugins.design.ui.widgets;
+
+import org.sonar.api.web.AbstractRubyTemplate;
+import org.sonar.api.web.RubyRailsWidget;
+import org.sonar.api.web.UserRole;
+import org.sonar.api.web.WidgetCategory;
+
+@UserRole(UserRole.USER)
+@WidgetCategory({"Design"})
+public final class ResponseForClassWidget extends AbstractRubyTemplate implements RubyRailsWidget {
+
+ public String getId() {
+ return "rfc";
+ }
+
+ public String getTitle() {
+ return "Response for class";
+ }
+
+ @Override
+ protected String getTemplatePath() {
+ return "/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb";
+ }
+}
+++ /dev/null
-<%
-lcom=measure('lcom4')
-rfc=measure('rfc')
-if lcom || rfc
- lcom_distribution=measure('lcom4_distribution')
- rfc_distribution=measure('rfc_distribution')
- suspect_lcom4_density=measure('suspect_lcom4_density')
- %>
-<table width="100%">
- <tbody>
- <tr>
- <% if lcom %>
- <td width="50%" valign="top">
- <div class="dashbox">
- <h3><%= message('widget.ckjm.lcom4') -%></h3>
- <p>
- <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%>
- </p>
- <p>
- <%= format_measure(suspect_lcom4_density, :suffix => message('widget.ckjm.files_having_lcom_greater_than_one'), :url => url_for_drilldown('lcom4')) %> <%= dashboard_configuration.selected_period? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%>
- </p>
- </div>
- </td>
- <% end %>
- <% if rfc %>
- <td width="50%" valign="top">
- <div class="dashbox">
- <h3><%= message('widget.ckjm.rfc') -%></h3>
- <p><span class="big">
- <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%></span><%= message('widget.ckjm.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%>
- </p>
- </div>
- </td>
- <% end %>
- </tr>
- <tr>
- <td>
- <%
- if suspect_lcom4_density && suspect_lcom4_density.value>1.0 && lcom_distribution && !lcom_distribution.data.blank?
- query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(lcom_distribution.data)
- %>
- <a href="<%= url_for_drilldown('lcom4') -%>"><%= chart(query, :id => 'lcom4_distribution', :alt => '') -%></a>
- <% end %>
- </td>
- <td>
- <%
- if rfc_distribution && !rfc_distribution.data.blank?
- query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(rfc_distribution.data)
- %>
- <a href="<%= url_for_drilldown('rfc') -%>"><%= chart(query, :id => 'rfc_distribution', :alt => '') -%></a>
- <% end %>
- </td>
- </tr>
- </tbody>
-</table>
-<% end %>
--- /dev/null
+<%
+ lcom=measure('lcom4')
+ if lcom
+ lcom_distribution=measure('lcom4_distribution')
+ suspect_lcom4_density=measure('suspect_lcom4_density')
+%>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td valign="top">
+ <div class="dashbox">
+ <h3><%= message('widget.lcom4.title') -%></h3>
+ <p>
+ <span class="big"><%= format_measure(lcom, :suffix => '', :default => '-', :url => url_for_drilldown('lcom4')) -%></span><%= message('widget.lcom4.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(lcom) : trend_icon(lcom, :big => true) -%>
+ </p>
+ <p>
+ <%= format_measure(suspect_lcom4_density, :suffix => message('widget.lcom4.files_having_lcom_greater_than_one'), :url => url_for_drilldown('lcom4')) %> <%= dashboard_configuration.selected_period? ? format_variation(suspect_lcom4_density) : trend_icon(suspect_lcom4_density) -%>
+ </p>
+ </div>
+ </td>
+
+ <%
+ if suspect_lcom4_density && suspect_lcom4_density.value>1.0 && lcom_distribution && !lcom_distribution.data.blank?
+ query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(lcom_distribution.data)
+ %>
+ <td>
+ <a href="<%= url_for_drilldown('lcom4') -%>"><%= chart(query, :id => 'lcom4_distribution', :alt => '') -%></a>
+ </td>
+ <% end %>
+
+ </tr>
+ </tbody>
+</table>
+<% end %>
--- /dev/null
+<%
+ rfc=measure('rfc')
+ if rfc
+ rfc_distribution=measure('rfc_distribution')
+%>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td valign="top">
+ <div class="dashbox">
+ <h3><%= message('widget.rfc.title') -%></h3>
+ <p><span class="big">
+ <%= format_measure(rfc, :suffix => '', :default => '-', :url => url_for_drilldown('rfc')) -%></span><%= message('widget.rfc.per_class.suffix') -%> <%= dashboard_configuration.selected_period? ? format_variation(rfc) : trend_icon(rfc, :big => true) -%>
+ </p>
+ </div>
+ </td>
+
+ <%
+ if rfc_distribution && !rfc_distribution.data.blank?
+ query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(rfc_distribution.data)
+ %>
+ <td>
+ <a href="<%= url_for_drilldown('rfc') -%>"><%= chart(query, :id => 'rfc_distribution', :alt => '') -%></a>
+ </td>
+ <% end %>
+
+ </tr>
+ </tbody>
+</table>
+<% end %>