It's rare that code annotated with TODOs, FIXMEs, etc. actually get fixed. Someone has to stumble across them by chance and would have to put what they're doing on pause to fix that issue.
We also have GitHub as a public issue tracker so any refactoring tasks should be tracked here.
Adding the following lines to docs/LorisCS.xml will enable PHPCS to flag TODOs and FIXMEs. (There is no sniff for XXX annotations but these should also be transferred to Issues.)
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.Commenting.Todo"/>
Then run make checkstatic. The PHPCS section of its report should be transcribed into GitHub issues.
Once the issues are created, the modified file docs/LorisCS.xml can be committed to the repo to prevent future TODOs from being committed to the code.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
346 | WARNING | Comment refers to a FIXME task "This should be investigated further but for now
| | it's not"
391 | WARNING | Comment refers to a TODO task "Should test to see if form is valid and if not
83 | WARNING | Comment refers to a FIXME task "This should be private to ensure users go through
| | the getter and setter"
94 | WARNING | Comment refers to a FIXME task "$formname is never used. - Alexandra Livadas"
319 | WARNING | Comment refers to a FIXME task "Should this be "addRadioGroup"? There is no method"
499 | WARNING | Comment refers to a FIXME task "LorisForm::createElement does not use the label
| | parameter when"
589 | WARNING | Comment refers to a FIXME task "$closer is never used or explained. - Alexandra
| | Livadas"
615 | WARNING | Comment refers to a FIXME task "Someone needs to investigate if this can use
| | setTemplateVar, or if"
655 | WARNING | Comment refers to a FIXME task "Someone should investigate if this can use
559 | WARNING | Comment refers to a FIXME task "This clause is kept here so that the ANDs below
| | don't"
807 | WARNING | Comment refers to a FIXME task "I don't think the third parameter is correct, but
58 | WARNING | Comment refers to a FIXME task "This is a temporary hack until the password reset
84 | WARNING | Comment refers to a TODO task "Module search path should be a config option"
314 | WARNING | Comment refers to a FIXME task "Hack required for breadcrumbs. This should be
351 | WARNING | Comment refers to a FIXME task "this check is only here because of a quirk of the"
951 | WARNING | Comment refers to a FIXME task "This function does not have a return type
147 | WARNING | Comment refers to a TODO task "Add not null constraint to the name column of the
| | Project table"
153 | WARNING | Comment refers to a TODO task "Add unique constraint to the name column of the
180 | WARNING | Comment refers to a FIXME task "Ideally the signature of this function should be
83 | WARNING | Comment refers to a TODO task "add validation for email sent/failed"
27 | WARNING | Comment refers to a FIXME task "LINST instruments should parse the full name"
155 | WARNING | Comment refers to a FIXME task "Despite the name, this function does not just
| | return arrays, but"
255 | WARNING | Comment refers to a FIXME task "This function currently returns a string, array, or
24 | WARNING | Comment refers to a FIXME task "Should this be in the main index.php to prevent the
25 | WARNING | Comment refers to a FIXME task "The code in NDB_Client should mostly be replaced by
86 | WARNING | Comment refers to a FIXME task "These error checks are direct ports from when the
116 | WARNING | Comment refers to a FIXME task "The longterm solution is to remove the
1110 | WARNING | Comment refers to a TODO task "This validation should be done on the front-end
400 | WARNING | Comment refers to a TODO task "This validation should be done on the front-end
166 | WARNING | Comment refers to a TODO task "There is no way to validate the the visit_label in
155 | WARNING | Comment refers to a TODO task "Check permissions. How??"
101 | WARNING | Comment refers to a TODO task "This should be replace by
88 | WARNING | Comment refers to a FIXME task "Update the code to add the singleton here, not the
43 | WARNING | Comment refers to a FIXME task "This should be reworked to not silently handle the
84 | WARNING | Comment refers to a TODO task "Creating file-candidate relations"
195 | WARNING | Comment refers to a TODO task "The below does not get printed to the frontend"
231 | WARNING | Comment refers to a TODO task "This should select using date_insert and"
244 | WARNING | Comment refers to a TODO task "The below validation should be done before running
| | the query"
41 | WARNING | Comment refers to a FIXME task "This allows to close any thread as long as the
138 | WARNING | Comment refers to a FIXME task "$visit_label should be set properly. This
78 | WARNING | Comment refers to a TODO task "add similar logic to projects when user-projects
217 | WARNING | Comment refers to a FIXME task "The function _completeCount() seems to be
54 | WARNING | Comment refers to a TODO task "These magic numbers should be changed to constants so
136 | WARNING | Comment refers to a FIXME task "This should negotiate the content type it returns
31 | WARNING | Comment refers to a TODO task "or split it into two files... :P"
41 | WARNING | Comment refers to a TODO task "encapsulate more"
6 | WARNING | Comment refers to a FIXME task "This code should be refactored away from using the
The Stale label is being removed automatically because some activity has occurred or because the developers have decided that this pull request is important and should not continue to be overlooked.
Hello, new contributor here! I will be happy to lend a hand to solve this task, as it will give me a good overview of the project.
Hey, that's great! We appreciate your contribution. let us know if you have any questions. :)
@johnsaigle -- Is this a beginner task truly? I suspect a lot of the fixme and todo comments often need interpretation by an experienced Loris dev to define/create the underlying issue scope.
@laemtl I'll assign this to you for now as we wait for Testing assignments. This should be done on the master branch since discussion may be required - i.e. may take time to resolve.
Is this a beginner task truly?
I think that creating an issue that includes a link to the relevant section of code using a GitHub permalink is a beginner-friendly task. Devs converting TODOs to GitHub Issues aren't expected to necessarily resolve the issue to which the tickets refer. Yes, many will likely need subsequent attention from someone more experienced. This would be a good way to spotlight these problems.
I wrote a small script to automate the creation of the issues.
TODOs should absolutely not be removed from the code. That's like "fixing bugs" by removing assertions. If the author thought it was important enough to note a limitation of the code someone who's reading or debugging it shouldn't need a third party service and access to know what it is.
@johnsaigle - for discussion or close this issue? I think you tried to bring it up at a Loris meeting months ago? I agree with Dave otherwise...
I'll mark it for discussion and add to the agenda.
The result of the discussion was to keep the TODOs in the code but to also track them using GitHub Issues. I'll change the issue title to match.
the next few month could be a good time to really look into these issues and discuss with dave what should be done @laemtl
As I said above, I wrote a script which automate the creation of issues based on keywords found in the codebase. The downside is that more than hundreds of issues will be created at once.
Right, and it was agreed that a huge influx of these issues wasn't desirable. So let's find a way to triage this into manageable parts.
One place to start is by really looking into a few of these issues and discussing with Dave what should be done on a few examples, and then extrapolating from there to triage these comments by what should be prioritized for Issue/code cleanup.
For example, maybe it makes sense to target the core php libraries first -- or maybe it doesn't because (hypothetically) of upcoming architecture changes.
@christinerogers Good idea! Targeting TODO for the Core outputs 18 results:
./tools/exporters/dataExtractor.php: // TODO This should likely be refactored at some point.
./tools/detect_duplicated_commentids.php: * TODO:
./test/unittests/NDB_PageTest.php: * TODO: Update this test once addCheckbox method is fixed.
./test/unittests/BreadcrumbTrailTest.php: * TODO: Add potential edge cases (such as white space)
./test/unittests/UtilityTest.php: * TODO Potential edge cases: test with the study_site and DCC booleans as false
./test/unittests/UtilityTest.php: * TODO Potential edge cases: Set 'Active' to 'N'
./test/unittests/NDB_Menu_Filter_Test.php: * TODO:
./test/unittests/BreadcrumbTest.php: * TODO: Add potential edge cases (such as white space)
./test/unittests/CandidateTest.php: * TODO This function calls Site::singleton() and User::singleton()
./php/libraries/LorisForm.class.inc: * TODO: Implement this in *HTML functions.
./php/libraries/NDB_Notifier.class.inc: * TODO add validation for email sent/failed (#6488)
./php/libraries/NDB_Notifier.class.inc: // TODO send confirmation email instead
./php/libraries/Project.class.inc: // TODO :: Add not null constraint to the name column of the Project table (#6479)
./php/libraries/Project.class.inc: // TODO :: Add unique constraint to the name column of the Project table (#6479)
./php/libraries/Module.class.inc: // TODO: Module search path should be a config option. (#6496)
./php/libraries/File_Upload.class.inc: //@todo Should test to see if form is valid and if not return an error. (#6490)
./php/libraries/NDB_BVL_Battery.class.inc: * @todo make it do something
./test/README.md:## Todo
I suggest to sightly edit all these comments to add a reference to the issue, like this:
// TODO (#7777):
This provides the double benefits of being able to distinguish the ones not entered in the system yet, and to link to the created issue from the code.
We can also remove the keyword TODO (?) from the comment if we want to turn on the rule in PHPCS after this issue has been processed.
@driusan Can it be a good starting point?
Let's pause on this until we're through the current testing cycle. We'll re-discuss in November.