-
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
[MRI Violated scans] Have the minc file linked to brainbrowser (Redmine 10928) #2219
[MRI Violated scans] Have the minc file linked to brainbrowser (Redmine 10928) #2219
Conversation
Current coverage is 13.80% (diff: 0.00%)@@ 17.0-dev #2219 diff @@
==========================================
Files 121 121
Lines 20191 20196 +5
Methods 1133 1133
Messages 0 0
Branches 0 0
==========================================
+ Hits 2787 2788 +1
- Misses 17404 17408 +4
Partials 0 0
|
Tested on IBIS production |
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.
Some of the functions in the select statements seem overly complex. They could use proper quoting and comments.
@@ -171,6 +174,7 @@ class NDB_Menu_Filter_Form_mri_violations extends NDB_Menu_Filter_Form | |||
c.ProjectID as Project, | |||
s.SubprojectID as Subproject, | |||
minc_location as MincFile, | |||
CONCAT_WS('','" . $dir_path . "','trashbin/',SUBSTRING_INDEX(minc_location, '/', -2)) as MincFileViolated, |
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.
this should use the $DB->quote function
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.
Done
@@ -195,6 +199,7 @@ class NDB_Menu_Filter_Form_mri_violations extends NDB_Menu_Filter_Form | |||
c.ProjectID as Project, | |||
s.SubprojectID as Subproject, | |||
MincFile, | |||
IF(INSTR(`MincFile`, 'assembly'), IF(LEFT(`MincFile`, 8) = 'assembly',CONCAT_WS('','" . $dir_path . "',`MincFile`),`MincFile`), CONCAT_WS('','" . $dir_path . "','trashbin/',SUBSTRING_INDEX(MincFile, '/', -2))) as MincFileViolated, |
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.
This line seems really complex and hard to understand. Does whatever it's doing need to be in SQL or can it be done in code?
Either way, it should at least have a comment explaining it. (dir_path should also be quoted using the db quote function)
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.
Comments added.
remove extra lines
The MRI Violated Scans now has a new column named MincFileViolated with a link that opens the scan in Brain Browser even if it is in the trashbin directory.