Our Grails Stats: but what are yours?

We’re currently working on a Grails project for over a year now, with, on average, around 8 people including testers. I thought it would be nice to share our project statistics, but I’m wondering how our statistics compare to yours.

    +----------------------+-------+-------+
    | Name                 | Files |  LOC  |
    +----------------------+-------+-------+
    | Controllers          |    73 |  8394 | 
    | Domain Classes       |   122 |  4571 | 
    | Jobs                 |     2 |    27 | 
    | Services             |   117 | 10759 | 
    | Tag Libraries        |    34 |  3031 | 
    | Groovy Helpers       |   358 | 14095 | 
    | Java Helpers         |   356 | 32977 | 
    | Unit Tests           |   258 | 23146 | 
    | Integration Tests    |    15 |  1360 | 
    | Scripts              |    12 |   268 | 
    | GSP                  |   248 | 19156 | 
    | Javascript           |  1114 | 42434 | 
    +----------------------+-------+-------+
    | Totals               |  2709 | 160218| 
    +----------------------+-------+-------+

Some information about our project:

  • Java Helpers: this is 100% generated (CXF/JAXB code).
  • Scripts: this consists of some scripts to set the build number, generate the above CXF code based on some WSDLs, and run our Javascript unit tests
  • Domain/Service: Most of our business logic is in the domain or service layer. There is still to much code in our controllers, and we are working on that to make our controller layer smaller.

I hacked the script to also display our GSP and Javascript files. The Javascript is not entirely accurate, since it also includes JQuery and some JQuery libraries. Our functional (Geb) tests are missing though. These are quite new in our application, but are taking a bigger and bigger portion of our tests.

So, I’m curious to see what your project statistics looks like. If you run:

grails stats

You’ll get the same format as above. Please post it as a comment, even if it’s only a small project, along with some project details you might find interesting to share, and let’s see if we can create some nice graphs out of this!!

Erik Pragt
Erik Pragt
Erik Pragt is a passionate software developer with a broad range of experience in both static dynamic (Java, Scala) languages. Having worked as a consultant for a broad range of customers mostly in the Telecom, ISP, and banking sector, Erik is now an independent freelance consultant. In the limited time he's not sitting behind the computer he can be found in the gym, riding his motorcycle or diving, always looking for new inspiration.
Recommended Posts
Showing 9 comments
  • Tomas

    I found that grails stats only works with your top level project, so if you actually use the recommended plugin-oriented architecture, you need to run grails stats on each plugin / level.

    • Erik Pragt

      Tomas, thanks for the tip. Our project is a bit monolithic in that however. Still, could you share some data?

  • Martijn

    Can you share the scripts for generating the above (including the Javascript/GSP files)? Then I’ll run it along some of our projects as well

    • Erik Pragt

      Hi Martijn, thanks for the reply!

      What I did was that I changed the ‘Stats’ scripts in the scripts directory, and I added these two lines:

      [name: “GSP”, path: “views”, filetype: [“.gsp”]],
      [name: “Javascript”, path: “js”, filetype: [“.js”]],

  • Demian

    Just running Grails Stats

     +----------------------+-------+-------+
     | Name                 | Files |  LOC  |
     +----------------------+-------+-------+
     | Controllers          |   105 |  9333 |
     | Domain Classes       |   102 |  4104 |
     | Jobs                 |    16 |  1073 |
     | Services             |    98 | 10814 |
     | Tag Libraries        |     4 |   174 |
     | Groovy Helpers       |   113 |  3865 |
     | Java Helpers         |    86 |  6451 |
     | Unit Tests           |    24 |  1663 |
     | Integration Tests    |   223 | 26057 |
     | Scripts              |     3 |    77 |
     +----------------------+-------+-------+
     | Totals               |   774 | 63611 |
     +----------------------+-------+-------+
    
    • Erik Pragt

      Hi Demian,

      Thanks for posting your stats! Interesting to see how much integration tests you have! Is there a specific reason for choosing Integration above Unit tests?

  • Ted Naleid

    This is from a project that’s about 18 months old, started with just me and has grown to 8 devs over that period:

        +----------------------+-------+-------+
        | Name                 | Files |  LOC  |
        +----------------------+-------+-------+
        | Controllers          |    86 | 10170 | 
        | Domain Classes       |   139 |  6142 | 
        | Jobs                 |     7 |   108 | 
        | Services             |    86 | 10535 | 
        | Tag Libraries        |    41 |  3076 | 
        | Groovy Helpers       |   136 |  7514 | 
        | Java Helpers         |     1 |    65 | 
        | Unit Tests           |   522 | 49095 | 
        | Integration Tests    |   323 | 24085 | 
        | Functional Tests     |    14 |  1034 | 
        | Scripts              |     1 |    65 | 
        +----------------------+-------+-------+
        | Totals               |  1356 | 111889 | 
        +----------------------+-------+-------+
    

    Looks like our projects are very similar in size. My output doesn’t show gsp and javascript (how did you get that?), but I’d guess we’ve got about the same ratio as you do.

    • Erik Pragt

      Hi Ted, thanks for posting your result! Interesting, and your project seems very similar to ours indeed!

      To get the js and gsp output, I hacked the Grails Stats script a bit by adding the following two lines:
      [name: “GSP”, path: “views”, filetype: [“.gsp”]],
      [name: “Javascript”, path: “js”, filetype: [“.js”]],

      It’s not very accurate since it includes our JQuery libraries, but a nice indication maybe.

pingbacks / trackbacks

Start typing and press Enter to search