Page 1 of 1
Code Info
Posted: Fri Jul 11, 2008 10:32 am
by dajawu
Is there an easy way, a function perhaps that will list lines of code on a PHP file and maybee even list lines of code through out your whole website? Like it could list that there are 13PHP file totaling 2500 lines of code?
Re: Code Info
Posted: Fri Jul 11, 2008 12:56 pm
by jaoudestudios
You could scan through the directory and then read every php file into a string or array, then keep appending a variable until the loop is finished then display to screen or output to a file.
Re: Code Info
Posted: Fri Jul 11, 2008 6:15 pm
by Benjamin
I was going to write one of these when I got bored enough, but it appears someone already did.
http://webmaster-forums.code-head.com/s ... .php?t=363
Re: Code Info
Posted: Sat Jul 12, 2008 5:34 pm
by dajawu
Awsome thanks!
Re: Code Info
Posted: Sat Jul 12, 2008 6:42 pm
by alex.barylski
I wrote such a utility...however I had intentions on making it a framework for more advanced metrics calculations...
It doesn't just count physical lines but SLOC instead. I use it to keep track of files which grow wildly large so I can quickly pickout which files are in need of a refactoring.
One day I plan to extend it into a full blown metrics tool...one day.
