We have a large application and we have added the TODO
rule to SonarQube quality gates that throws errors when TODO
comments are found.
This encourages developers to remove TODO
comments, which is scary, as the whole purpose of adding the TODO
comment is lost.
Is there a way to keep the TODO
comments by adding some sort of override or ignore comment similar to ESLint? We would like to defer dealing with the TODO
s but still be notified of the TODO
tasks left by developers when they do not fit the scope of a current ticket without blocking a build.
Remove the TODO, stop using them for anything that's not short term (for the length of a ticket or fork) and move them into tickets on your ticket tracking system.
TODO comments have multiple problems:-
they can be hard to find if you are using an IDE which doesn't auto locate them. (I know Devs who use sublime or even Emacs so a specific search would be needed)
whose job is it to find and fix these?
how is time spend on them tracked?
they can get out of date, like most comments. If someone fixes the problem without reading the TODO and leaves it there, it causes confusion. If another fix inadvertently fixes it, the comment is unknowingly left there.
You now have two issue tracking systems, one of internal documentation and one in whatever issue tracking system you use.
If you are writing TODOs then you are the very person with the knowledge to fix it. Someone coming along later will have to fix it based on a very short comment without description.
There's nothing more irritating than a piece of code by a developer who was too lazy to do a good job, so left it for the next guy
or one who wasn't lazy but was too scared to break something and just ended up making the problem more complex with minimal comments suggesting there's a problem