Todd Pasley wrote: > > Hi, > > Firstly, please resist the opportunity to flame.... > > I'm looking for a PHP (among other things) Line Of Code counter. Has anyone > used any descent ones? I was thinking of writing one myself, but, if there > are others available, I might as well save the time. > > There is much debate over the appropriateness of LOC as a measurement, I > have chewed up a lot of time with discussion over this so I'm not going to > bite this time :)
I like this quick and dirty solution which doesn't count lines with just braces or just whitespace. nor does it count C++ style comment lines. I have it in my .bashrc file: alias countcode='cat *.inc */*.inc */*/*.inc */*/*/*.inc */*/*/*/*.inc */*/*/*/*/*.inc */*/*/*/*/*/*.inc */*/*/*/*/*/*/*.inc | grep -v '\''^[[:space:]]*$'\'' | grep -v '\''^[[:space:]]*[{}][[:space:]]*$'\'' | grep -v '\''^[[:space:]]*//'\'' | grep -v '\''^<?//'\'' | grep -c '\''.*'\''' Then from my linux command line I just type countcode. And yes I know I could have come up with something better than */*/*/..., but like I said "QUICK AND DIRTY" :) Cheers, Rob. -- .-----------------. | Robert Cummings | :-----------------`----------------------------. | Webdeployer - Chief PHP and Java Programmer | :----------------------------------------------: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :----------------------------------------------: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `----------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php