Friday, 8 January 2016

FIXME and TODO comments in the Linux kernel source

While looking at some code in the Linux Kernel this morning I spotted a few FIXME comments and that got me wondering just how many there are in the source code. After a quick grep I found nearly 4200 in v4.4.0-rc8 and that got me thinking about other similar comment tags such as TODO that are in the source and how this has been changing over time.

So the trends are certainly upwards, but then again, so is the size of the kernel source:

Note: Data gathered using sloccount on the lines of C in the kernel source.

Using the sloccount data I then calculated the number of FIXME and TODOs per 1000 lines of code to see what the underlying trend is:

So FIXMEs are actually dropping in relative terms to the size of the kernel where as TODOs are increasing.

Of course, these statistics are bogus because it is dependent on kernel developers adding and removing FIXMEs and TODOs in a consistent manner, however, it is interesting to see how many comments exist and hence how much work has been tagged in comments as work to be done later. I wonder how this compares to other large open source projects.

I'm not a git expert, so it may not be doable, but it sounds like it is: why not graphing instead how many of the fixme's and todo's get actually fixed and done in each release? I believe git should be able to help, having the commits. Maybe something based on greping the logs?

Pycrastinate (https://github.com/isaacbernat/pycrastinate) greps through the source code (and git blame) to create such reports (on TODOs/FIXMEs and other regexps). It can easily group by metadata (path, author, etc.) filter by age range (checking git commit times), etc. and generate HTML or ascii reports. You may want to check it out.

Pycrastinate (https://github.com/isaacbernat/pycrastinate) greps through the source code (and git blame) to create such reports (on TODOs/FIXMEs and other regexps). It can easily group by metadata (path, author, etc.) filter by age range (checking git commit times), etc. and generate HTML or ascii reports. You may want to check it out.