Re: Maintainer, check your code
| From: | Gregory Beaver | Date: | Sun, 25 Feb 2007 15:51:34 +0000 |
| Subject: | Re: Maintainer, check your code | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-45751@lists.php.net to get a copy of this message | ||
Sebastian Ebling wrote:
> Am Samstag, den 24.02.2007, 20:12 +0100 schrieb Christophe Gesché:
>
> Hi Christophe,
>
>> I make again an call to test my check code tool based on zend Analyzer
>>
>> 2 things to do
>> - validate your pear code to grown pear quality
>> - give me a feed back on my tool : moosh@php.net
>>
>> How to use it ?
>>
>> Go to
>> http://130.104.58.207/~moosh/checkcode/?list=/cvs.php.net/pear¼y«ë”ppoRú
>> Οß
>>
>> On left you view cvs directory of pear.
>> Choose your package.
>
> is this tool for php5 only?
>
> If I check my Net_IMAP, there are a lot of errors.
>
> Some are very clear and the tool is right. I have a lot of variables
> that are used before they are assigned. Is this a problem regarding
> coding rules of pear?
>
> There are also errors, with arguments passed by reference that are used
> inside this method to pass to another method by reference. I see no real
> error here. As example you can have a look at IMAPProtocol.php (goto
> line 2022).
>
> I'm a little bit confused.
Zend Analyzer is a machine. Use your judgement. It is not smart
enough, for instance, to recognize that preg_match() can take an
uninitialized variable and create it, or that in many cases one uses
foreach() just for the keys.
However, it helps to call unused variables "$unused" or something like
that, and the analyzer does catch a lot of true problems. Just fix what
is possible to fix and makes sense to fix.
Greg