Live data from Hacker News

Plotting the source code “TODO” history of the most popular open source projects

schleiss.io

21–30 of 114 posts

Re: Plotting the source code “TODO” history of the most popular open source projects

#21

The growing number is hardly surprising, yet I don't know exactly what the implications are. There are a lot of different categories of TODOs, ranging from harmless ("it would be nice if this was improved at some point") to critical ("this is a really bad solution that needs to be fixed ASAP"). I wonder if these repos has official definitions of what a TODO entails.

Perhaps we should be including a priority in such comments, eg: TODO: high: don't use bogosort Would only be useful if it became a defacto standard though

Yes, I agree. Priority and some context on what to do instead. Because as soon as it's a standard, big software vendors like Jetbrains could automatically categorize and mark the various lines.

Re: Plotting the source code “TODO” history of the most popular open source projects

#23
post #19

I was just thinking the other day that searching for TODO is probably a very good way to search a project for potential bugs or security issues. E.g; I see a bunch of todos in Firebase iOS SDK that look kind of interesting to an attacker. Without looking into how the methods are called I can't say if they are actually exploitable (and I am sure Firebase is fuzzed to high-hell) but it was a little seed planted in my h…

for a great example of this just have a look at the following macOS privesc the source of which came with the handy comment "deal with OOB".

https://blog.zecops.com/research/from-a-comment-to-a-cve-con...

Re: Plotting the source code “TODO” history of the most popular open source projects

#25

Anyone got a (git-based) one liner to get this info for an arbitrary repo?

I'll throw this into the mix

  git --no-pager grep -I --full-name --line-number 'TODO' |\
   sed 's/\(^[^:]*\):\([0-9]\+\):.*/\1\n\2/' |\
   xargs -d '\n' -n2 sh -c 'git --no-pager blame "$0" -L $1,$1'
Not blazing fast but I think it does okay-ish.

What it does:

1) git-grep for files that are checked in, not "binary" that contain the string 'TODO'

2) sed away the actual line contents (git-grep doesn't seem able to only output file:line-nr)

3) use xargs and sh to call git blame on that file:line-nr

This shows the last time the TODO line was modified, ie: it may have been created 10 years ago but somebody modified the last yesterday

edit: one might want to throw in --cached to git-grep to search the index and not just the current working-tree

Re: Plotting the source code “TODO” history of the most popular open source projects

#26
post #18

Just today I announced a sweep through all of the TODO's and to either turn them into issues, stories or remove them. Biggest problem in Xcode is that it clogs up the warning list and the real warnings get swamped by them. But it's funny to see that Rust has less outstanding TODO's than our brand new 45KLoC project.

Can't you configure Xcode to filter out such warnings?

TODOs offer valuable insight but they may not warrant turning into issues or stories. Removing valuable information because it's cluttering seems like a shame. Better if you can filter it in such a way that it doesn't clutter

Re: Plotting the source code “TODO” history of the most popular open source projects

#27

The growing number is hardly surprising, yet I don't know exactly what the implications are. There are a lot of different categories of TODOs, ranging from harmless ("it would be nice if this was improved at some point") to critical ("this is a really bad solution that needs to be fixed ASAP"). I wonder if these repos has official definitions of what a TODO entails.

Perhaps we should be including a priority in such comments, eg: TODO: high: don't use bogosort Would only be useful if it became a defacto standard though

Back when I used Eclipse there was another level called “FIXME”. Maybe it works in IntelliJ as well.

Re: Plotting the source code “TODO” history of the most popular open source projects

#28

The growing number is hardly surprising, yet I don't know exactly what the implications are. There are a lot of different categories of TODOs, ranging from harmless ("it would be nice if this was improved at some point") to critical ("this is a really bad solution that needs to be fixed ASAP"). I wonder if these repos has official definitions of what a TODO entails.

Some projects use FIXME for things that need more urgent improvement to distinguish them from 'would be nice' TODOs. I wonder how many of these repos that is the case for?

Re: Plotting the source code “TODO” history of the most popular open source projects

#29
post #18

Just today I announced a sweep through all of the TODO's and to either turn them into issues, stories or remove them. Biggest problem in Xcode is that it clogs up the warning list and the real warnings get swamped by them. But it's funny to see that Rust has less outstanding TODO's than our brand new 45KLoC project.

TODOS are great documentation. They often reveal design decisions, suboptimal implementations and the thought process of the creator.

This information is often completely lost in issues that noone will ever look at again.

I also like to do TODO sweeps, but with a bias towards rewriting the into documentation or leaving them in if the are actionable.

Re: Plotting the source code “TODO” history of the most popular open source projects

#30

Cool! That date axis though... PHP's 3 years 2011-2014 are much shorter than 2 years 2014-2016. NodeJS's years 2017-2020 that were ~50% longer than 2013-2017.

I guess that each data point is a commit and they just made more commits in the 2014-2016 period than in 2011-2014. But it's just a guess.
Post reply on HN