HTML5 Zone is brought to you in partnership with:

Raymond Camden is a developer evangelist for Adobe. His work focuses on web standards, mobile development and Cold Fusion. He's a published author and presents at conferences and user groups on a variety of topics. He is the happily married proud father of three kids and is somewhat of a Star Wars nut. Raymond can be reached via his blog at www.raymondcamden.com or via email at raymondcamden@gmail.com Raymond is a DZone MVB and is not an employee of DZone and has posted 248 posts at DZone. You can read more from them at their website. View Full User Profile

My ColdFusion Bugs Visualized

03.11.2014
| 3128 views |
  • submit to reddit

One last blog entry before I enter Mardi Gras oblivion. Earlier this week I had logged into the ColdFusion bugbase and noticed that I had over 500 bugs in the system. I thought this was kinda cool and I was wondering if I could see aggregate data about my bug reports.

Knowing that this was an Ajax application, I opened my dev tools and looked at the request. Here is the URL (I added some spaces so it would wrap):

https://bugbase.adobe.com/index.cfm? event=qHome&page=1&pageSize=25&gridsortcolumn=&gridsortdirection=ASC& _cf_nodebug=true&_cf_nocache=true&_cf_clientid=89DF20803129085712725A599228C03B&_cf_rc=0

Notice the page size variable? On a whim I changed that to 600 and it worked. Note to developers: When you let the client specify a page size, you probably want to include a sensible maximum. I took the JSON packet and stored it locally.

The next part was simple. I wrote some quick jQuery to hit the JSON and loop over all the values. For now, I was just curious about the status of my bugs, so my code created a count for each status value.

$.getJSON("./mybugs.json", function(res) {

	var statusStats = {};

	var data = res.QUERY;
	var cols = {};
	for(var i=0;i<data.COLUMNS.length;i++) {
		cols[data.COLUMNS[i]] = i;
	}
	for(var i=0; i<data.DATA.length; i++) {
		var status = data.DATA[i][cols["AD_S_STATUS"]];
		if(statusStats[status]) {
			statusStats[status]++;
		} else {
			statusStats[status]=1;	
			}
	}

 I then decided - let's make it pretty. I added some Highcharts code to display the results in a pie chart. I had to do a minor bit of wrangling with the data, but outside of that I literally just cut and pasted from their sample code. The result:

You can view it (and view the source) here: http://www.raymondcamden.com/demos/2014/feb/28/test2.html

Enjoy. Now I'm off to catch some cheap beads.

Published at DZone with permission of Raymond Camden, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)