emka / openstreetbugs

OpenStreetBugs (deprecated)
http://wiki.openstreetmap.org/wiki/OpenStreetBugs
GNU General Public License v3.0
17 stars 5 forks source link

Bug statistic of closed bugs does not look at the type field #52

Closed werner2101 closed 10 years ago

werner2101 commented 10 years ago

the stats at http://openstreetbugs.schokokeks.org/stats/ didn't match with my own stats at http://www.h-renrew.de/h/osm/osmchecks/09_osb_phaseout/.

The opend bugs are ok, but the closed bug column is much to high.

Looking into the code stats/stats.py, the code for getting the closed bug nummer only looks at the date, not at the type field of the bug:

cursor.execute("""SELECT COUNT(*) as closedbugs FROM bugs WHERE last_changed < DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL """+"%d"%interval+""" MONTH), "%Y-%m-01") AND last_changed >= DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL """+"%d"%(interval+1)+""" MONTH), "%Y-%m-01");""")

The code I've used for my closed bug stats:

curs.execute("SELECT YEAR(last_changed)+MONTH(last_changed)/12,count(distinct id) FROM bugs WHERE type <> 0 GROUP BY YEAR(last_changed)+ MONTH(last_changed)/12;")

Regards Werner