Quantcast

[sonar-dev] --> [sonar-scm] sonar-plugins[5710] trunk/widget-lab/src: Add new widget that reports on Documentation and Comments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] --> [sonar-scm] sonar-plugins[5710] trunk/widget-lab/src: Add new widget that reports on Documentation and Comments

Evgeny Mandrikov
Hi Patroklos,

Almost all of your commit messages contain duplicate lines, which are completely useless. Please read http://docs.codehaus.org/display/SONAR/Git+Guide#GitGuide-Commitmessages Even if originally it was written for Git, it makes sense to follow same rules for Subversion commit messages.


---------- Forwarded message ----------
From: <[hidden email]>
Date: Tue, Jun 5, 2012 at 5:48 PM
Subject: [sonar-scm] sonar-plugins[5710] trunk/widget-lab/src: Add new widget that reports on Documentation and Comments
To: [hidden email]


Revision
5710
Author
ppapapetrou
Date
2012-06-05 06:48:58 -0500 (Tue, 05 Jun 2012)

Log Message

Add  new widget that reports on Documentation and Comments
Issue #SONARPLUGINS-1930 - Add new widget to report only on Documentation and Comments

Added Paths

Diff

Copied: trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java (from rev 5686, trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/ManualSeverityWidget.java) (0 => 5710)


--- trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java	                        (rev 0)
+++ trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,45 @@
+/*
+ * Widget Lab
+ * Copyright (C) 2012 Shaw Industries
+ * [hidden email]
+ *
+ * This program 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.
+ *
+ * This program 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  02
+ */
+package org.codehaus.sonar.plugins.widgetlab;
+
+/**
+ * @version 1.0
+ * @author Patroklos PAPAPETROU
+ */
+import org.sonar.api.web.*;
+
+@UserRole(UserRole.USER)
+@WidgetCategory({"Documentation"})
+public class DocumentationWidget extends AbstractRubyTemplate implements RubyRailsWidget {
+
+  public String getId() {
+    return "documentation";
+  }
+
+  public String getTitle() {
+    return "Documentation Metrics";
+  }
+
+  @Override
+  protected String getTemplatePath() {
+    return "/documentation_widget.html.erb";
+  }
+
+}

Copied: trunk/widget-lab/src/main/resources/documentation_widget.html.erb (from rev 5686, trunk/thucydides/src/main/resources/org/sonar/plugins/thucydides/thucydides_widget.html.erb) (0 => 5710)


--- trunk/widget-lab/src/main/resources/documentation_widget.html.erb	                        (rev 0)
+++ trunk/widget-lab/src/main/resources/documentation_widget.html.erb	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,47 @@
+<%
+  comments=measure('comment_lines_density')
+  if comments
+%>
+<table width="100%">
+  <tbody>
+    <tr>
+      <td valign="top" width="50%">
+        <div class="dashbox">
+          <p class="title"><%= message('widget.comments_duplications.comments') -%></p>
+          <p>
+            <span class="big">
+              <%= format_measure('comment_lines_density',:url => url_for_drilldown('comment_lines_density'))%>
+            </span>
+            <%= dashboard_configuration.selected_period? ? format_variation('comment_lines_density') : trend_icon('comment_lines_density') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('comment_lines'),:url => url_for_drilldown('comment_lines'), :suffix =>  ' ' + message('widget.comments_duplications.lines.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('comment_lines') : trend_icon('comment_lines') -%>
+          </p> 
+        </div>
+      </td>
+      <td valign="top" width="50%">
+        <div class="dashbox">
+          <p class="title"><%= message('widget.documentation.doc_title') -%></p>
+          <p>
+            <span class="big">
+              <%= format_measure(measure('public_documented_api_density'),:url => url_for_drilldown('public_documented_api_density'), :suffix =>  ' ' + message('widget.comments_duplications.docu_api.suffix'))%>
+            </span>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_documented_api_density') : trend_icon('public_documented_api_density') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('public_api'),:url => url_for_drilldown('public_api'), :suffix =>  ' ' + message('widget.documentation.public_api.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_api') : trend_icon('public_api') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('public_undocumented_api'),:url => url_for_drilldown('public_undocumented_api'), :suffix => ' ' + message('widget.comments_duplications.undocu_api.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_undocumented_api') : trend_icon('public_undocumented_api') -%>
+          </p>
+        </div>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<%
+  end
+%>
\ No newline at end of file

Copied: trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java (from rev 5686, trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/ManualSeverityWidgetTest.java) (0 => 5710)


--- trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java	                        (rev 0)
+++ trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,36 @@
+/*
+ * Widget Lab
+ * Copyright (C) 2012 Shaw Industries
+ * [hidden email]
+ *
+ * This program 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.
+ *
+ * This program 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  02
+ */
+package org.codehaus.sonar.plugins.widgetlab;
+
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
+
+public class DocumentationWidgetTest {
+  @Test
+  public void testWidgetDefinition() {
+    DocumentationWidget widget = new DocumentationWidget();
+    assertThat(widget.getId(), notNullValue());
+    assertThat(widget.getTitle(), notNullValue());
+    assertThat(getClass().getResource(widget.getTemplatePath()), notNullValue());
+  }
+
+}

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Re: --> [sonar-scm] sonar-plugins[5710] trunk/widget-lab/src: Add new widget that reports on Documentation and Comments

Patroklos Papapetrou
Hi Evgeny

Thanks for the tip. Something went wrong with my IDE... :(
I'll be more careful next time!
Patroklos

2012/6/5 Evgeny Mandrikov <[hidden email]>
Hi Patroklos,

Almost all of your commit messages contain duplicate lines, which are completely useless. Please read http://docs.codehaus.org/display/SONAR/Git+Guide#GitGuide-Commitmessages Even if originally it was written for Git, it makes sense to follow same rules for Subversion commit messages.


---------- Forwarded message ----------
From: <[hidden email]>
Date: Tue, Jun 5, 2012 at 5:48 PM
Subject: [sonar-scm] sonar-plugins[5710] trunk/widget-lab/src: Add new widget that reports on Documentation and Comments
To: [hidden email]


Revision
5710
Author
ppapapetrou
Date
2012-06-05 06:48:58 -0500 (Tue, 05 Jun 2012)

Log Message

Add  new widget that reports on Documentation and Comments
Issue #SONARPLUGINS-1930 - Add new widget to report only on Documentation and Comments

Added Paths

Diff

Copied: trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java (from rev 5686, trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/ManualSeverityWidget.java) (0 => 5710)


--- trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java	                        (rev 0)
+++ trunk/widget-lab/src/main/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidget.java	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,45 @@
+/*
+ * Widget Lab
+ * Copyright (C) 2012 Shaw Industries
+ * [hidden email]
+ *
+ * This program 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.
+ *
+ * This program 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  02
+ */
+package org.codehaus.sonar.plugins.widgetlab;
+
+/**
+ * @version 1.0
+ * @author Patroklos PAPAPETROU
+ */
+import org.sonar.api.web.*;
+
+@UserRole(UserRole.USER)
+@WidgetCategory({"Documentation"})
+public class DocumentationWidget extends AbstractRubyTemplate implements RubyRailsWidget {
+
+  public String getId() {
+    return "documentation";
+  }
+
+  public String getTitle() {
+    return "Documentation Metrics";
+  }
+
+  @Override
+  protected String getTemplatePath() {
+    return "/documentation_widget.html.erb";
+  }
+
+}

Copied: trunk/widget-lab/src/main/resources/documentation_widget.html.erb (from rev 5686, trunk/thucydides/src/main/resources/org/sonar/plugins/thucydides/thucydides_widget.html.erb) (0 => 5710)


--- trunk/widget-lab/src/main/resources/documentation_widget.html.erb	                        (rev 0)
+++ trunk/widget-lab/src/main/resources/documentation_widget.html.erb	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,47 @@
+<%
+  comments=measure('comment_lines_density')
+  if comments
+%>
+<table width="100%">
+  <tbody>
+    <tr>
+      <td valign="top" width="50%">
+        <div class="dashbox">
+          <p class="title"><%= message('widget.comments_duplications.comments') -%></p>
+          <p>
+            <span class="big">
+              <%= format_measure('comment_lines_density',:url => url_for_drilldown('comment_lines_density'))%>
+            </span>
+            <%= dashboard_configuration.selected_period? ? format_variation('comment_lines_density') : trend_icon('comment_lines_density') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('comment_lines'),:url => url_for_drilldown('comment_lines'), :suffix =>  ' ' + message('widget.comments_duplications.lines.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('comment_lines') : trend_icon('comment_lines') -%>
+          </p> 
+        </div>
+      </td>
+      <td valign="top" width="50%">
+        <div class="dashbox">
+          <p class="title"><%= message('widget.documentation.doc_title') -%></p>
+          <p>
+            <span class="big">
+              <%= format_measure(measure('public_documented_api_density'),:url => url_for_drilldown('public_documented_api_density'), :suffix =>  ' ' + message('widget.comments_duplications.docu_api.suffix'))%>
+            </span>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_documented_api_density') : trend_icon('public_documented_api_density') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('public_api'),:url => url_for_drilldown('public_api'), :suffix =>  ' ' + message('widget.documentation.public_api.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_api') : trend_icon('public_api') -%>
+          </p>
+          <p>
+            <%= format_measure(measure('public_undocumented_api'),:url => url_for_drilldown('public_undocumented_api'), :suffix => ' ' + message('widget.comments_duplications.undocu_api.suffix'))%>
+            <%= dashboard_configuration.selected_period? ? format_variation('public_undocumented_api') : trend_icon('public_undocumented_api') -%>
+          </p>
+        </div>
+      </td>
+    </tr>
+  </tbody>
+</table>
+<%
+  end
+%>
\ No newline at end of file

Copied: trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java (from rev 5686, trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/ManualSeverityWidgetTest.java) (0 => 5710)


--- trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java	                        (rev 0)
+++ trunk/widget-lab/src/test/java/org/codehaus/sonar/plugins/widgetlab/DocumentationWidgetTest.java	2012-06-05 11:48:58 UTC (rev 5710)
@@ -0,0 +1,36 @@
+/*
+ * Widget Lab
+ * Copyright (C) 2012 Shaw Industries
+ * [hidden email]
+ *
+ * This program 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.
+ *
+ * This program 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  02
+ */
+package org.codehaus.sonar.plugins.widgetlab;
+
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
+
+public class DocumentationWidgetTest {
+  @Test
+  public void testWidgetDefinition() {
+    DocumentationWidget widget = new DocumentationWidget();
+    assertThat(widget.getId(), notNullValue());
+    assertThat(widget.getTitle(), notNullValue());
+    assertThat(getClass().getResource(widget.getTemplatePath()), notNullValue());
+  }
+
+}

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_

Loading...