1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tool GSC Lines of Code Counter

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by BullyWiiPlaza, Jun 30, 2016.

  1. BullyWiiPlaza

    BullyWiiPlaza Modder

    215
    172
    243
    Credits:
    150
    I thought that it would be useful to count the total lines of code in a GSC project. For this I found CLOC which you can download Please login or register to view links or downloads!.

    Since this is a command line tool, you'll have to use CMD and type the following command:
    Code:
    cloc-1.64.exe --force-lang="C",gsc "D:\Bossam v6"
    The first parameter specifies the language and the 2nd parameter the project folder which you need to edit every time you want to analyze a different project.

    Note:
    All GSC source files must have the .gsc extension, not .txt or anything else.

    If you enter the command correctly and press Enter, the output will look similar to this:
    Code:
    http://cloc.sourceforge.net v 1.64  T=0.13 s (7.5 files/s, 100438.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           1016             71          12282
    -------------------------------------------------------------------------------
    So Bossam's menu for instance has 12.282 lines of code.

    Let's do another one:
    Code:
    >cloc-1.64.exe --force-lang="C",gsc "D:\Jiggy v4.2"
           1 text file.
           1 unique file.
           1 file ignored.
    
    http://cloc.sourceforge.net v 1.64  T=0.17 s (6.1 files/s, 100226.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1            771            932          14841
    -------------------------------------------------------------------------------
    The biggest menu probably:
    Code:
    >cloc-1.64.exe --force-lang="C",gsc "D:\Project TCM v9"
           1 text file.
           1 unique file.
           1 file ignored.
    
    http://cloc.sourceforge.net v 1.64  T=0.36 s (2.8 files/s, 108789.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           4117           8879          26351
    -------------------------------------------------------------------------------
    And one last one:
    Code:
    >cloc-1.64.exe --force-lang="C",gsc "D:\Dynamic v3"
          20 text files.
          20 unique files.
           5 files ignored.
    
    http://cloc.sourceforge.net v 1.64  T=0.17 s (120.2 files/s, 91523.2 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                               20            163              0          15065
    -------------------------------------------------------------------------------
    SUM:                            20            163              0          15065
    -------------------------------------------------------------------------------
    Of course, the menu size does not mean much about quality but it's still interesting. I hope you enjoyed this. :tonguewink:
     
    Last edited: Jun 30, 2016
    RosticGamer99 and 無法者 like this.
  2. AdamWasHere

    AdamWasHere Active Member

    31
    5
    108
    Credits:
    1
    :y:
     
  3. CF4_99

    CF4_99 Active Member

    38
    36
    218
    Credits:
    253
    dope:handok:
     
  4. Tusta

    Tusta Head Member Donator

    14
    14
    14
    Credits:
    3,154
    Wrong, that isn't working because the gsc compiler doesn't compile Comments or any blank spaces.
     
  5. BullyWiiPlaza

    BullyWiiPlaza Modder

    215
    172
    243
    Credits:
    150
    lol, it works just fine for counting source code lines. The blank lines are not included in the code column.
     
    DF_AUS likes this.

Share This Page