0) { $other = ($phpver == 4 ? 3 : 4); echo '
Currently displaying PHP'. $phpver . ' bugs only. Display all bugs or only PHP' . $other . ' bugs.
' . "\n"; } else { echo 'Currently displaying all bugs. Display only PHP3 bugs or only PHP4 bugs.
' . "\n"; } mysql_connect("localhost","nobody",""); mysql_select_db("php3"); $query = "SELECT *,UNIX_TIMESTAMP(ts2)-UNIX_TIMESTAMP(ts1) AS timetoclose FROM bugdb"; if ($phpver > 0) { $query .= " WHERE SUBSTRING(php_version,1,1) = '$phpver'"; } $query .= " ORDER BY bug_type"; $result = mysql_unbuffered_query($query); while($row=mysql_fetch_array($result)) { $bug_type['all'][$row[bug_type]]++; switch (strtolower($row[status])) { case "closed": if ($row[timetoclose] > 0) { $time_to_close[] = $row[timetoclose]; } /* falls through */ case "bogus": $closed_by[$row[dev_id]]++; break; } $bug_type[strtolower($row[status])][$row[bug_type]]++; $bug_type[strtolower($row[status])]['all']++; $email[$row[email]]++; $php_version[$row[php_version]]++; $php_os[$row[php_os]]++; $status[$row[status]]++; $total++; } function bugstats($status, $type) { global $bug_type, $phpver; if ($bug_type[$status][$type] > 0) { return '' . $bug_type[$status][$type] . "\n"; } } mysql_freeresult($result); echo "| Total bug entries in system: | $total | "; echo "".sort_url('closed')." | "; echo "".sort_url('open')." | "; echo "".sort_url('critical')." | "; echo "".sort_url('analyzed')." | "; echo "".sort_url('suspended')." | "; echo "".sort_url('duplicate')." | "; echo "".sort_url('assigned')." | "; echo "".sort_url('feedback')." | "; echo "".sort_url('bogus')." | "; echo "
|---|---|---|---|---|---|---|---|---|---|---|
| All: | ", "$total | ", "".bugstats('closed','all')." | ", "".bugstats('open', 'all')." | ", "".bugstats('critical', 'all')." | ", "".bugstats('analyzed', 'all')." | ", "".bugstats('suspended','all')." | ", "".bugstats('duplicate', 'all')." | ", "".bugstats('assigned','all')." | ", "".bugstats('feedback','all')." | ", "".bugstats('bogus', 'all')." | ", "
| $type: | ", "".$bug_type['all'][$type]." | ", "".bugstats('closed', $type)." | ", "".bugstats('open', $type)." | ", "".bugstats('critical',$type)." | ", "".bugstats('analyzed', $type)." | ", "".bugstats('suspended',$type)." | ", "".bugstats('duplicate', $type)." | ", "".bugstats('assigned',$type)." | ", "".bugstats('feedback',$type)." | ", "".bugstats('bogus', $type)." | ", "
Bug Report Time to Close Stats\n"; echo "
| Average life of a report: | ".ShowTime((int)($sum/$c))." |
|---|---|
| Median life of a report: | ".ShowTime($median)." |
| Slowest report closure: | ".ShowTime($time_to_close[$c-1])." |
| Quickest report closure: | ".ShowTime($time_to_close[0])." |
Who is closing the bug reports?\n"; echo "
| $who | $value |
|---|