Last modified: 2012-10-29 17:24:15 UTC
$ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math,../extensions}/{*,*/*,*/*/*,*/*/*/*}/*.php *.php 2> /dev/null | wc -l 481 That's a lot of == '' and != ''. These should all be examined and fixed to either check strictly (if that's desired) or, I guess, drop the equality check, since that's more explicit. Of course, this doesn't count all the cases where you say !$var and assume strong type checking, but there's not much hope for automatically detecting those. Core looks a little better: $ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math}/{*,*/*,*/*/*}/*.php *.php 2> /dev/null | wc -l 27 I'll get on some of these, maybe, if I have the time.
Of course, my bash globbing was totally off . . . $ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math,../extensions}/{,*/,*/*/,*/*/*/}*.php *.php 2> /dev/null | wc -l 748 $ grep "\([^\!=]==\|\!=\)\s*''" {includes,skins,languages,maintenance,math}/{,*/,*/*/,*/*/*/}*.php *.php 2> /dev/null | wc -l 295 That looks less pleasant.
Score with 1.13alpha (r32654): 790/300
All on one line: find . -name '*php' -exec grep -H "\([^\!=]==\|\!=\)\s*''" {} \;