Code Info
Moderator: General Moderators
Code Info
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?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Code Info
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
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
http://webmaster-forums.code-head.com/s ... .php?t=363
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: Code Info
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.
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.
- Attachments
-
- PHP Metrics.zip
- (6.67 KiB) Downloaded 52 times