logo       
Google Custom Search
    AddThis Social Bookmark Button

cvs: pearweb /include/bugs pear-bugs.php /public_html/bugs stats.php: msg#00076

Subject: cvs: pearweb /include/bugs pear-bugs.php /public_html/bugs stats.php
cellog          Thu Apr 12 03:15:55 2007 UTC

  Modified files:              
    /pearweb/include/bugs       pear-bugs.php 
    /pearweb/public_html/bugs   stats.php 
  Log:
  implement Request #10359      Developer bugfix stats for last month
  implement Request #10368      Bug reporting stats
  
http://cvs.php.net/viewvc.cgi/pearweb/include/bugs/pear-bugs.php?r1=1.8&r2=1.9&diff_format=u
Index: pearweb/include/bugs/pear-bugs.php
diff -u pearweb/include/bugs/pear-bugs.php:1.8 
pearweb/include/bugs/pear-bugs.php:1.9
--- pearweb/include/bugs/pear-bugs.php:1.8      Mon Mar  5 04:32:29 2007
+++ pearweb/include/bugs/pear-bugs.php  Thu Apr 12 03:15:55 2007
@@ -166,5 +166,62 @@
                  GROUP BY u.handle
                  ORDER BY c DESC, b.ts2 DESC', array(), DB_FETCHMODE_ASSOC);
     }
+
+    function lastMonthStats()
+    {
+        return $this->_dbh->getAll('SELECT COUNT(*) as c, u.handle
+                 FROM bugdb b, users u
+                 WHERE
+                  TO_DAYS(NOW()) - TO_DAYS(b.ts2) <= 30 AND
+                  b.bug_type != "Feature/Change Request" AND
+                  b.assign = u.handle AND
+                  b.status = "Closed"
+                 GROUP BY u.handle
+                 ORDER BY c DESC, b.ts2 DESC', array(), DB_FETCHMODE_ASSOC);
+    }
+
+    function reporterStats()
+    {
+        $bugs = $this->_dbh->getAssoc('SELECT u.handle, COUNT(*) as c
+                 FROM bugdb b, users u
+                 WHERE
+                  b.handle = u.handle AND
+                  u.registered = 1 AND
+                  b.status NOT IN ("Spam", "Bogus")
+                 GROUP BY u.handle
+                 ORDER BY u.handle', false, array(), DB_FETCHMODE_ASSOC);
+        $comments = $this->_dbh->getAssoc('SELECT u.handle, COUNT(*) as c
+                 FROM bugdb_comments b, bugdb d, users u
+                 WHERE
+                  b.handle = u.handle AND
+                  u.registered = 1 AND
+                  d.id = b.bug AND
+                  d.status NOT IN ("Spam", "Bogus")
+                 GROUP BY u.handle
+                 ORDER BY u.handle', false, array(), DB_FETCHMODE_ASSOC);
+        $patches = $this->_dbh->getAssoc('SELECT u.handle, COUNT(*) as c
+                 FROM bugdb_patchtracker p, bugdb b, users u
+                 WHERE
+                  b.handle = u.handle AND
+                  u.registered = 1 AND
+                  b.id = p.bugdb_id AND
+                  b.status NOT IN ("Spam", "Bogus")
+                 GROUP BY u.handle
+                 ORDER BY u.handle', false, array(), DB_FETCHMODE_ASSOC);
+        foreach ($comments as $handle => $count) {
+            if (!isset($bugs[$handle])) {
+                $bugs[$handle] = 0;
+            }
+            $bugs[$handle] += $count;
+        }
+        foreach ($patches as $handle => $count) {
+            if (!isset($bugs[$handle])) {
+                $bugs[$handle] = 0;
+            }
+            $bugs[$handle] += $count;
+        }
+        arsort($bugs);
+        return $bugs;
+    }
 }
 ?>
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/stats.php?r1=1.49&r2=1.50&diff_format=u
Index: pearweb/public_html/bugs/stats.php
diff -u pearweb/public_html/bugs/stats.php:1.49 
pearweb/public_html/bugs/stats.php:1.50
--- pearweb/public_html/bugs/stats.php:1.49     Sat Dec 16 05:54:28 2006
+++ pearweb/public_html/bugs/stats.php  Thu Apr 12 03:15:55 2007
@@ -15,7 +15,7 @@
  * @package   Bugs
  * @copyright Copyright (c) 1997-2005 The PHP Group
  * @license   http://www.php.net/license/3_0.txt  PHP License
- * @version   $Id: stats.php,v 1.49 2006/12/16 05:54:28 cellog Exp $
+ * @version   $Id: stats.php,v 1.50 2007/04/12 03:15:55 cellog Exp $
  */
 
 /**
@@ -277,10 +277,16 @@
 echo "</table>\n";
 echo '<a name="devs">&nbsp;</a>';
 echo "<h1>Most Active Bug-fixing Developers</h1>";
-echo "<p>The following is a list of developers who have bugs marked 
<strong>Closed</strong> and assigned to them ranked by the number of closed 
bugs.</p>";
+echo "<p>The following is some informational statistics on bug fixing and 
reporting.
+Developers are considered to have fixed a bug if the bug is marked 
<strong>Closed</strong> and is assigned to the developer.</p>";
+echo '<table>';
+echo '<tr><th>All Time</th><th>Past Month</th><th>Bug Reporting</th></tr>';
+echo '<tr><td valign="top">';
 require_once 'bugs/pear-bugs.php';
 $bugs = new PEAR_Bugs;
 $develstats = $bugs->allDevelStats();
+$lastmonth = $bugs->lastMonthStats();
+$reporters = $bugs->reporterStats();
 echo '<table>'; ?>
  <tr>
   <th class="bug_head">Closed Bugs</th>
@@ -296,6 +302,40 @@
 }
 echo "</table>\n";
 
+echo '</td><td valign="top">';
+echo '<table>'; ?>
+ <tr>
+  <th class="bug_head">Closed Bugs</th>
+  <th class="bug_head">Developer</th>
+ </tr>
+<?php
+foreach ($lastmonth as $stat) {
+    echo " <tr>\n";
+    echo '  <td class="bug_bg0">' . $stat['c'] . "</td>\n";
+    echo '  <td class="bug_bg0"><a href="/user/' . $stat['handle'] . '">' .
+        $stat['handle'] . "</a></td>\n";
+    echo " </tr>\n";
+}
+echo "</table>\n";
+echo '</td><td valign="top">';
+echo '<table>'; ?>
+ <tr>
+  <th class="bug_head">Bugs + Comments + Patches</th>
+  <th class="bug_head">Developer</th>
+ </tr>
+<?php
+foreach ($reporters as $dev => $stat) {
+    echo " <tr>\n";
+    echo '  <td class="bug_bg0">' . $stat . "</td>\n";
+    echo '  <td class="bug_bg0"><a href="/user/' . $dev . '">' .
+        $dev . "</a></td>\n";
+    echo " </tr>\n";
+}
+echo "</table>\n";
+echo '</td>';
+echo '</tr>';
+echo '</table>';
+
 response_footer();
 
 




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>