• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Count lines of code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Count lines of code


  • Subject: Count lines of code
  • From: "Brant Sears" <email@hidden>
  • Date: Tue, 1 Feb 2005 11:51:28 -0800
  • Thread-topic: Count lines of code

Title: Count lines of code

Hi. I'm trying to create a system in xCode that will allow me to keep track of lines of code created/modified/deleted on a regular basis.

One of the tasks is going to be to find a way to count lines of code. I have seen several people suggest the use of wc -l. However, I want to count only non-blank, non-comment lines as actual lines of code. A line of code with an embedded comment should count, however. Such as the following:

void myFunction(int myvariable /*a comment*/) <- should count

// a comment <- should not count

/* a multi <- should not count
line comment <- should not count
*/ <- should not count

Perhaps using grep with some regular _expression_ would be the right way to filter out comments and blank lines? Perhaps a perl script would be better?

The next step might involve using the diff utility to determine lines of code deleted, modified, and added.

Then, I'm thinking my tool would probably take that information, plus perhaps the date/time and append it to a file. I'm thinking this could be added as a script that could be invoked as part of my build on the build machine.

The purpose of this is that we want to be able to use this data to callibrate an estimation tool with data from our project. I think that the more automated this system is, the less bias our data will be and therefore we will have better data to calibrate the estimation tool with.

So the reason why I'm posting this is that I'd like to ask if there is already such a tool in extence that I can buy/use. Does anyone know of such a tool for OS X?

Thanks.

Brant Sears

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Count lines of code
      • From: "Fred W. Bacon" <email@hidden>
  • Prev by Date: Re: GDB error
  • Next by Date: Re: Problem Debugging GNU Make Projects
  • Previous by thread: Re: GDB error
  • Next by thread: Re: Count lines of code
  • Index(es):
    • Date
    • Thread