Toxicity reloaded

28 June 2013

At the moment I’m playing with D3.js trying to recreate some of the polymetric diagrams pioneered in CodeCrawler. (You can see my progress on that over here.) In the process it occurred to me that it should be relatively trivial, using the same tools, to recreate the Toxicity charts we did years ago. Having an HTML5 version would be quite welcome, too, because the original implementation uses Excel features that only work on Windows.

Well, turns out it wasn’t too difficult and the result is available in this Github repository. I like the fact that with HTML we can have much richer tooltips compared to the Excel version. What’s even better, though, is that because it is an HTML solution I can inline the fully interactive chart in this post:

At this point I should mention that only “modern” version of Internet Explorer support the required tech, which means that this will not work in IE8 and below. Firefox and WebKit/Blink-based browsers should be fine.

Last but not least, the chart embedded in this page uses the same data file as the chart in the original post. I’ve even approximated the Excel colour palette we used.

Now what’s needed is a tool that produces Toxicity scores for Scala, JavaScript, Ruby, etc.


  1. Fernando Racca

    29 June 2013, 15:28

    Great post ! Looking forward to the Scala version :)

  2. Adam Nowotny

    30 June 2013, 16:51

    I like that you can embed the chart in the page.

    A while ago I needed toxicity charts for .NET code so had a great excuse to play with D3 and HTML5 file reader. The app shows treemap and toxicity charts for metrics produced by Visual Studio Code Metrics PowerTool.

    The source code is at

  3. Jim Bethancort

    30 October 2014, 19:17

    It would be interesting to take the toxicity scores and plot them against the number of issues each class has been involved in, allowing for a cost/benefit analysis to determine where effort would be best spent.

Leave a comment