How to calculate Effective lines of code?

  • kanchan

    kanchan - 2007-07-25

    Using StatSVN we can find the LOC(which includes commented lines and blank lines).Is it possible to find out LOEC(Lines of Effective Code)?

    • Jason Kealey

      Jason Kealey - 2007-07-29

      We don't currently support eLOC.

      You could easily write a filter in our LOC calculation class to ignore empty lines, but commented lines would be trickier since they are programming-language dependant and they span multiple lines. Since we only query the server for diffs and don't necessarily see the whole file, it is not a trivial undertaking. It wouldn't be hard to program, but it would be much much slower.

      • Jean-Philippe Daigle

        I'm actually of the opinion that StatSVN should try and stay away from programming-language-dependent analysis.

        There's all sorts of things you might want to analyze in a source repository: cocomo complexity, effective LOC, function points, class complexity, etc, etc, etc. All these are measured differently by language, and tools and methodologies exist to calculate those metrics at one point in time.

        IMHO StatSVN/StatCVS should only concern themselves with time-based analysis of text files, the result of which is usually close enough to LOC to be a useful and meaningful metric.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks