-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Libraries] Remove unused functions from Utility and update cleanup comments #2913
Conversation
This needs to go to 18.0. There's no way to determine that they're unused by any project overrides or instruments in the wild. |
Note: changes made by @AnyhowStep in #2889 have now been merged into this PR. The other PR will be closed. |
@ridz1208 This PR is an update of #2889 which was opened by @AnyhowStep. You said his PR should go to 17.2. Do you think this should be in 17.2 or 18.0? My vote is 17.2 but @driusan said 18.0. Do you have a preference? |
* @note This is no longer used and should be removed | ||
* @cleanup | ||
*/ | ||
static function getListOfSubjectEthnicities() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed not being used
* by NDB_Form_candidate_parameters and if so, should be moved there. | ||
* @cleanup | ||
*/ | ||
static function explodeEncapsulated($seperator, $delimiter, $string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used in candidate_parameters on IBIS
@sruthymathew123 if you can get rid of it or move it to the class it is used in, then when you confirm we'll be able to remove safely
* @note Function comment written by Dave, not the author of this function. | ||
* @note This function does not appear to be used anymore. | ||
* @cleanup | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed not used
* @return The name from the given array row. | ||
* @note Function should be removed and code using it cleaned up. | ||
* @cleanup | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed not used
* @return The name from the given array row. | ||
* @note Function should be removed and code using it cleaned up. | ||
* @cleanup | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed not used
* | ||
* @cleanup | ||
*/ | ||
static function getColumnThresholdCount() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed not used
* module uses it. (Data team helper?) | ||
* @note Function comment written by Dave, not the author of this function. | ||
* @cleanup | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IBIS redefines this function in its ProjectUtility class but neither functions are used anywhere in the code
@sruthymathew123 potential clean-up for you !
* module uses it. (Data team helper?) | ||
* @note Function comment written by Dave, not the author of this function. | ||
* @cleanup | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same...
IBIS redefines this function in its ProjectUtility class but neither functions are used anywhere in the code
@sruthymathew123 potential clean-up for you !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was used by the really old "quat table" DQT. It's unused, and IBIS ProjectUtility probably just copied the Utility to start with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general the changes are fine, some of the comments are not constructive and should be removed
php/libraries/Utility.class.inc
Outdated
@@ -660,6 +574,10 @@ class Utility | |||
* to null. | |||
* | |||
* @return array The same array passed in, after modifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note should be removed
php/libraries/Utility.class.inc
Outdated
@@ -565,6 +544,8 @@ class Utility | |||
* @return array If $var is an array, var, otherwise an array containing $var | |||
* @cleanup This should be removed and all uses converted to toArray | |||
* (or vice versa, but toArray seems to be more common in the code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note should be removed
php/libraries/Utility.class.inc
Outdated
@@ -546,6 +523,8 @@ class Utility | |||
* @param mixed $var The variable to be converted to an array. | |||
* | |||
* @return array If $var is an array, var, otherwise an array containing $var |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note should be removed
@zaliqarosli let's talk about this one |
/** | ||
* Checks to see if a table contains a specified column | ||
* | ||
* @param string $table_name The table to check for a column. | ||
* @param string $column The column name to check the table for. | ||
* | ||
* @return boolean true if the table has at least one NULL in the column | ||
* @note This should really be in the Database.class.inc file... -anyhowstep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this note in .. @ridz1208 should it be moved to Database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably, but not as part of this PR, and the note is still pointless to have. If anything, there should be a redmine ticket for it (or just a PR that does it and deprecates this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against the notes, i tend to look at code more then redmine myself
* The return value format seems weird. Should possibly be refactored. | ||
* @note Used in: | ||
* - data_team_helper/php/NDB_Form_data_team_helper.class.inc | ||
* - data_team_helper/ajax/GetInstruments.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A redmine ticket saying to move this to the data_team_helper and verify that that's the only place that it's used is better than a comment saying where it's used (which would need to be maintained, and may become outdated..)
@zaliqarosli I will let you attempt a rebase on your local repo. if you encounter any problems let me know |
cleaned up and added some notes gitignore Removed Utility::lookupBattery, There is already a NDB_BVL_Battery::lookupBattery and Utility version is not being used in core Restored Utility::lookupBattery(), tools/fix_timepoint_date_problems uses it Remove unused functions; update cleanup comments Phpcs and formatting update PHP version from 5 to 7 Remove note to self Remove invalid notes Remove notes
@ridz1208 please re-review. thanks! |
@driusan I think this should be merge early if you agree |
Delete functions marked as unused in the function comments (and confirmed by a Github search).
Update function comments to reflect some locations where they are used