|
From: Martin C. <mrj...@gm...> - 2009-07-16 11:24:50
|
Update on this: I checked in (I think svn:142) last night. As well as
adding diagnostics showing the window around the current token
position, it catches the condition of $myFoo = new Foo() such that
subsequent accesses to $myFoo->methodName() are known to be on object
type Foo.
Martin
Sent from my iPhone
On 2009-07-15, at 4:03 AM, Falko Menge <ma...@fa...> wrote:
> Hi Martin,
>
> first of all, thank you for this awesome contribution!
>
> It is a known issue of phpCallGraph that certain cases are not
> analyzed
> correctly by the currently applied heuristics. I'm currently
> investigating
> possibilities of symbolic execution to get these calls right.
> However, it will
> still take a while until this issue will be solved.
>
> If you need the source code of the function/method, you can extend
> the signature
> of CallgraphDriver::startFunction to include either the line numer
> of the end of
> the function or directly the source code. Both are available when
> this method is
> called in PHPCallGraph::parseMethodBody. Of course, you would have
> to change all
> implementations of the CallgraphDriver interface, but that shouldn't
> be to hard,
> since they could just ignore the additional data.
>
> I wasn't able to actually get output from your driver. Or more
> specifically the
> PNG and HTML output files where empty. I guess, this is due to some
> external
> software missing on my machine. Could you therefore add some hints
> on how to use
> your driver to the readme.txt?
>
> Greetings from Berlin
> Falko
>
>
> Ma...@Cl... wrote:
>> To be clearer, here's a real example:
>>
>> Most of the call arrows for the attached are correct, except for the
>> following two, where the class is unset, meaning my code draws the
>> arrows to :ClassUnknown:
>>
>> $ca->inspectFiles($files);
>> $this->codeSummary = $ca->getCodeSummary();
>>
>> Thanks,
>> Martin.
>>
>> <?php
>> class PHPCallGraph {
>> public function parse(array $filesOrDirs, $recursive = false) {
>> $files = $this->collectFileNames($filesOrDirs, $recursive);
>> $ca = new iscCodeAnalyzer(null);
>> $ca->setDebug($this->debug);
>> $ca->setAutoloadFile($this->autoloadFile);
>> $ca->inspectFiles($files);
>> $this->codeSummary = $ca->getCodeSummary();
>> $this->analyseCodeSummary();
>> }
>> }
>> ?>
>>
>>
>> --
>> Ma...@Cl...
>> http://twitter.com/mrjcleaver
>> +1 416-786-6752 (GMT-5)
>>
>>
>>
>>
>> On Mon, Jul 13, 2009 at 10:26 PM, Ma...@Cl...<Ma...@cl...
>> > wrote:
>>> Sorry about that incomplete email - I was balancing my 8 month old
>>> on my lap!
>>>
>>> This is what it should have said:
>>>
>>>> It works quite well but doesn't seem to always be passed a class,
>>>> leading the call arrows to go to UnknownClass rather than to the
>>>> correct object.
>>> More examples can be seen in
>>> http://phpcallgraph.svn.sourceforge.net/viewvc/phpcallgraph/trunk/examples/output/
>>>
>>>> Is the class=null on addCall() a known issue?
>>> Also, I want to be able to get the source code of the current method
>>> available to the driver. Can we make the codeAnalyzer available to
>>> the
>>> driver, or pass the sourcecode?
>>>
>>> Thanks,
>>> Martin.
>>>
>>>
>>> --
>>> Ma...@Cl...
>>> http://twitter.com/mrjcleaver
>>> +1 416-786-6752 (GMT-5)
>>>
>>>
>>>
>>> On Mon, Jul 13, 2009 at 3:10 PM, Ma...@Cl... <Ma...@cl...
>>> > wrote:
>>>> Hi - so attached is an example output from my driver that outputs
>>>> umlgraph sequence diagrams.
>>>>
>>>> It works quite well but doesn't seem to always be passed a class,
>>>> leading the call arrows to go to UnknownClass rather than to the
>>>> correct object.
>>>> Is this a known issue?
>>>> Thanks, M.
>>>>
>>>>
>>>> --
>>>> Ma...@Cl...
>>>> http://twitter.com/mrjcleaver
>>>> +1 416-786-6752 (GMT-5)
>>>>
>>>
>>> ---
>>> ---
>>> ------------------------------------------------------------------
>>>
>>> ---
>>> ---
>>> ---
>>> ---
>>> ------------------------------------------------------------------
>>> Enter the BlackBerry Developer Challenge
>>> This is your chance to win up to $100,000 in prizes! For a limited
>>> time,
>>> vendors submitting new applications to BlackBerry App World(TM)
>>> will have
>>> the opportunity to enter the BlackBerry Developer Challenge. See
>>> full prize
>>> details at: http://p.sf.net/sfu/Challenge
>>>
>>> ---
>>> ---
>>> ------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> phpCallGraph-general mailing list
>>> php...@li...
>>> https://lists.sourceforge.net/lists/listinfo/phpcallgraph-general
>
|