Page 1 of 1

Keeping code clean...

Posted: Fri Mar 23, 2007 11:32 am
by alex.barylski
Any large project over a period of time accumulates resources, functions, etc which are never called or used...

In compiled languages such as C++ there are tools which point out or throw warnings when functions are not used or variables as well...but in PHP this is lsightly more difficult as functions like eval() or dynamic function invocation make simply following parse trees next to impossible...

Does PHP have some extensions which log parsed functions and match that against *callled* functions, same applies for variables (globals, members, etc).

feyd, you must know of something??? :)

Posted: Fri Mar 23, 2007 1:00 pm
by feyd
If memory serves Xdebug provides call counts and various other bits of information.

Posted: Fri Mar 23, 2007 1:20 pm
by alex.barylski
hehe...am I physcic or what...I knew you'd be the one to answer this one ;)

Apparently I'm a horrible speller as well? :D

xdebug eh...I'll investigate, thanks :)

Posted: Fri Mar 23, 2007 2:37 pm
by Chris Corbyn
I love Xdebug :D Code Coverage is what feyd's talking about. You can do tracing too which gives you a literal pathway through your code with memory usage and timings.

Posted: Fri Mar 23, 2007 3:19 pm
by alex.barylski
Sweet a profiler would be kind of nice too...execution paths, etc would be awesome too... :)

Hmmmm...I was kind hoping for a tool which I could add to the engine (as an extension) which just logged data which I could later parse and display is pretty formats...

xdebug_ look like functions I need to actually call in my actual source :(