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

前端 未结 15 1611
闹比i
闹比i 2020-11-30 16:32

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 purp

15条回答
  •  爱一瞬间的悲伤
    2020-11-30 16:40

    I have been using CLOC as mentioned by Nathan Kinsinger and it is fairly easy to use. It is a PERL script that you can add and run from your project directory.

    PERL is already part of Mac OS and you can invoke the script this way to find out your number of lines you have written:

    perl cloc-1.56.pl ./YourDirectoryWhereYourSourcesAre
    

    This is an example of output i got from such command:

       176 text files.
       176 unique files.                                          
         4 files ignored.
    
    http://cloc.sourceforge.net v 1.56  T=2.0 s (86.0 files/s, 10838.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Objective C                     80           3848           1876          11844
    C/C++ Header                    92            980           1716           1412
    -------------------------------------------------------------------------------
    SUM:                           172           4828           3592          13256
    -------------------------------------------------------------------------------
    

提交回复
热议问题