Needs work
Project:
Coder Tough Love
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2011 at 01:22 UTC
Updated:
27 Apr 2012 at 21:28 UTC
Jump to comment: Most recent file
Comments
Comment #1
hass commentedComment #2
xjmLooks like the additional bug @Dane Powell found in #1361528-4: Remove "@param and @return syntax does not indicate the data type" rule.
Comment #3
xjmI believe the attached patch should resolve this.
Comment #4
tim.plunkettThis looks fine to me. Just give it a better commit message than the issue title please :)
Comment #6
xjmComment #7
xjmFixed in 6.x-1.x and 7.x-1.x:
http://drupal.org/commitlog/commit/7948/effe57f9246e9a5c19043d03d2e7bda0...
http://drupal.org/commitlog/commit/7948/8abe413d36cd7a4bf950e1a371ae36aa...
Comment #8
aspilicious commentedWe alse need to add: bool, float, double, real
Comment #9
hass commentednullis missing, see http://drupal.org/node/1354#functions and piped types also...Comment #10
hass commentedComment #11
xjm@aspilicious and I talked about this a bit in IRC. We need to match:
NULL, TRUE, and FALSE.Sorry, they need to be lowercase. null, true, false. That always trips me up.So, I'm wondering if we should rewrite the rule to simply skip the whitelist and instead match the line. Split it into two rules, one for param and one for return. The param rule allows:
@param $var@param foo $var@param foo|bar $varThe return rule allows:
@return@return foo@return foo|barAnd we change the message text a little to not have the somewhat confusing text about description.
Separate rules would do some checking on the datatypes and make sure that the true, false, and null are lowercase; that true and false are not piped together; etc. (See specifics in http://drupal.org/node/1354#functions).
The above rules are also candidates for inclusion in Coder.
For now, though, I'm going to commit #8 to reduce false positive noise on the bots.
P.S. A potential CTL rule might flag the code smell from having too many different datatypes piped together.
Comment #12
aspilicious commentedThe docs say you should only pipe once.
And mixed should be replaced with pipes
Comment #13
xjmAh, want to reroll to take out mixed, then?
Comment #14
xjmHmm, I saw mixed used in the CMI patch. Maybe taking that out needs more discussion.
For now I committed #8:
http://drupal.org/commitlog/commit/7948/0e7162622da464473382d58418e16c1c...
http://drupal.org/commitlog/commit/7948/a5779aa98478d3d894b543a891880ee0...
Leaving this issue open to look at a better solution like the one outlined above.
Comment #15
jhodgdonFYI, probably covered by above comments, but I'm seeing this false positive on the first line here: