Steve Grunwell

Open-source contributor, speaker, and coffee snob

Someone writing a to-do list in a notebook

Steal This Idea: Extract TODOs from a Codebase

This post is part of my “Steal This Idea” series: free ideas for anyone to take and run with. Learn more about #StealThisIdea.

As a software developer, it’s incredibly common to browse a codebase and find that the functionality that was advertised doesn’t really exist.

Maybe the function or class method is there, but where there should be some brilliant logic, instead there’s a comment to the effect of “TODO: actually implement this.”

It’s frustrating, especially if you know that the developer who wrote that comment is long-gone, but what can you do? The nature of the industry is that we’re hopping between projects (or jobs) almost constantly; how can anyone remember all of the “when I get time, I need to get back to that” demands on them?

The Idea

What if there was a language-agnostic parser that could scan a codebase for to-do comments, then create associated tickets in an issue tracker?

The tool could be completely language agnostic, too: if it finds anything that looks like a to-do that doesn’t have a ticket URL associated with it, compile a list and either create the tickets or notify the development team.

It could even go a step further and, when available, perform a git blame to see how long the to-do has existed in the codebase.

This could be extremely useful as a GitHub bot, much like Dependabot.

To-Do patterns

When I originally wrote down this idea, I also captured a list of common to-do patterns I’ve seen in codebases; if you run with this idea, you’d probably want to capture all of the following:

  • TODO
  • @todo
  • @TODO
  • TO-DO
  • TODO:
  • TO-DO:
  • TO DO
  • TO DO:
  • TO DO –

Overall, this seems like something that may very well exist, but if it doesn’t it would be great to incorporate it into a continuous integration pipeline.

Previous

Steal This Idea: Campaign Contribution Visualizer

Next

Travis CI for WordPress Plugins

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Be excellent to each other.