Keeping code clean...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Keeping code clean...

Post 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??? :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If memory serves Xdebug provides call counts and various other bits of information.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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 :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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 :(
Post Reply