Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out how many lines of code there are in an Xcode project?

Is there a way to determine how many lines of code an Xcode project contains? I promise not to use such information for managerial measurement or employee benchmarking purposes. ;)

like image 653
Dave Avatar asked Jan 05 '10 01:01

Dave


People also ask

How do I find strings in Xcode?

Find Text or Patterns in Your Source Code To find text in a file, open the file in the Xcode source editor and choose Find > Find from the menu bar. Xcode displays the Find bar and its search controls at the top of the file. Enter a search term. Xcode searches the file, highlights matches, and notes how many it finds.

How are project lines of code calculated?

To use cloc simply type cloc followed by the file or directory which you wish to examine. Now lets run cloc on it. As you can see it counted the number of files, blank lines, comments and lines of code. Another cool feature of cloc is that can even be used on compressed files.


1 Answers

I see this floating around and use it myself:

find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.swift" ")" -print0 | xargs -0 wc -l 
like image 98
Joshua Nozzi Avatar answered Sep 19 '22 06:09

Joshua Nozzi