• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Lines of Code Counters

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

Does anyone know of any good lines of code changed utilities for Java? I need to compare 2 versions of an application (with several thousand source files). I need something which compares at the project / directory level and reports new lines, deleted lines etc.

I've seen Fisheye which looks pretty good, but I need to provide alternatives even if they are discounted for some reason.

Thanks,

Greg
 
Ranch Hand
Posts: 502
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try Windiff from microsoft, which will compare files and folders as well.


Windiff download
 
Gregory Till
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion Prabhu, but what I need is a utility to tell me how many lines have been added / changed / removed rather than exactly what each change is. Also, I need a tool that recognises the difference between java source lines and comments.

To put it in context, I need a tool that takes 2 directories as arguments (cvs integration would be nice, but not essential) and says something like -

200 lines of code have been added
50 lines of code have been removed
75 lines of code have been changed
[ November 17, 2006: Message edited by: Gregory Till ]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I need a tool that recognises the difference between java source lines and comments.

Are you really sure about this? I've worked on plenty of code where comments were a vital part of the application :- Javadoc produced as API documentation, xdoclet and similar technologies which embed configuration in commments, etc.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it would be possible to slap together something that could plunder the Unix "diff" utility sed-format (-e) output and run that over the tree. I agree with Frank, though. Just because it's not Java doesn't mean it's not important.

If this is for another one of those hairball "lines-of-code" productivity metrics, however, I do feel obliged to point out that some of my most productive days have been ones where I started with 800 lines of crappy buggy code and ended with 200 lines of tight, reliable high-performance code. In other words, "produced" negative LOC.

Never forget that for most projects, it's not the size of the program that people are paying for, it's whether or not the program does the job acceptably. LOC matters to the bean-counters, but not to the customers. Software is not hamburger. More isn't automatically better.

Besides, hamburger tends to be much more internally structured.
 
Gregory Till
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the replies Frank and Tim.


This is more for baseline differential metrics for assessing / predicting bugs vs scope of a given release. I'm sure I could cobble something together pretty quickly, but why re-invent the wheel if it already exists.

I know there are arguments against (a change to 1 line in 1 core file having potentially more impact than 1000 changes elsewhere) and that this kind of thing has fallen out of favour recently, but as long as it's taken with the correct pinch of salt, I think it could potentially be useful. Plus my boss has told me to do it ;-)

So if anyone knows of a tool, I'd be grateful. Otherwise I'll just go away and sulk in a corner ;-)
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know of anything prebuilt, but I doubt it would take me more than an hour or 2 to whip out a Perl script for that. Or 2-3 hours for its Java equivalent. Perl is more convenient for me because pattern-matching is closer to the surface in Perl than in Java. Plus when you set up matches, you don't have to escape the grep escaspes with Java escapes.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic