Modify

Opened 8 years ago

Last modified 2 years ago

#261 new enhancement

Add lines of code statistics

Reported by: no_spam_f at smega dot com Owned by: anybody
Priority: highest Component: Request-a-Hack
Severity: normal Keywords:
Cc: lievenswouter@…, fcorreia@…, aidinabedi@… Trac Release: 0.11

Description

Show lines of code (LOC) for components and plot their change over time, maybe including LOC for changesets grouped by commiting user.

Attachments (0)

Change History (22)

comment:1 Changed 8 years ago by anonymous

  • Cc lievenswouter@… added
  • Trac Release set to 0.8

comment:2 Changed 7 years ago by anonymous

I need this hack. Thanks.

comment:3 follow-up: Changed 7 years ago by khundeen

Plan to work on this if more people want it.

comment:4 in reply to: ↑ 3 Changed 7 years ago by anonymous

Replying to khundeen:

Plan to work on this if more people want it.

Trac definately needs this. :)

comment:5 Changed 7 years ago by tedbundyjr

+ vote. will be usefull for all the dev. team member to evaluate their performance. :)

comment:6 Changed 7 years ago by johnzhang

  • Trac Release changed from 0.8 to 0.11

a must-have feature for trac

comment:7 Changed 7 years ago by anonymous

+1

A must-have feature also. But must also work with other VCS systems not just SubVersion! --JamesMills

comment:8 Changed 6 years ago by anonymous

That would be a really great addition to Trac.

comment:9 Changed 6 years ago by anonymous

I see this feature like this:
When you "browse source" in trac there's an additional button "LOC stats" displayed next to the directory or file.

  • If you press it next to the file, you'll see a plot of LOC over time for that file.
  • If you press it next to some directory, you'll see a plot of LOC over time for the whole directory (sum of LOC of all files).
  • It might be useful to jump there from the changeset entries in the timeline

comment:10 Changed 6 years ago by anonymous

me too :)

comment:11 Changed 6 years ago by anonymous

I vote for this

comment:12 Changed 6 years ago by anonymous

Needs it we do, yeees...

comment:13 Changed 6 years ago by Toby

Why does Lines of code == coder performance?

byte[] buffer;
buffer = byte[]{48, 65, 6C, 6C, 6F, 20, 57, 6F, 72, 6C, 64};
String s = new String(buffer);
OutputStream out = System.out;
out.print(s);
out.print("\n");

vs

System.out.println("Hello World");

Top version = 6x as performing than the bottom one, and thats not even with comments.

comment:14 Changed 6 years ago by anonymous

  • Cc fcorreia@… added

comment:15 Changed 6 years ago by anonymous

would also love this

comment:16 Changed 6 years ago by anonymous

LOC alone is a pretty useless stat. I wouldn't mind some "code statistics" not just LOC, but %Lines comments, largest file. file with largest "scoped object" i.e. function, method, whatever your language offers. complexity...all that.

anyway, if my idea of the plugin is the idea, then the plugin should just read/display, and define a format for the data to adhere too, and let external tools, or other plugins (or sub parts) do the work. (i.e., I don't want the # of classes in Java crap, it has bazillions, and my c code has none.).

Well, that's my take, maybe it's a different plugin.

comment:17 Changed 5 years ago by anonymous

+1

I agree that LOC in no very meaningful, but at least it gives some insight if a developer changed 1 or 100 lines of code over a certain time period.

comment:18 Changed 5 years ago by anonymous

LOC stats would be very very useful.
All coders should know how efficient code they write so the "Hello World" example above is pretty irrelevant. Even if you're a team leader you should have guidelines and control over your team. And if not you would be able to monitor the lines of code are written by each member of your team over time, so would be able to pick up on coders with LOC above the average (either they work too hard (yeah right) or they write inefficient code).

When can we have this hack then? :)

comment:19 Changed 5 years ago by anonymous

Have a look at statSVN, this does most of this already, but it would be good to have it integrated into trac.

I would be careful with LOC metrics as a productiviy measure, as others have highlighted. I would also suggest that for simplicity a simple physical lines of code count is done (i.e. none comment, none blank lines) as that can be made to work for a large number of languages. More detailed lines of code, such as a logical LOC are difficult to develop and are language specific. My company has Ada, Java, C, C++, C.NET, ASP and assembler in use as a mimimum!

comment:20 Changed 4 years ago by aidinabedi@…

  • Cc aidinabedi@… added
  • Priority changed from normal to highest

I would give my left arm for this feature!

unfortunately statSVN needs a local checkout of the repository. If this can be achieved by the plugin a integration with statSVN would be perfect!

comment:21 Changed 3 years ago by yoheeb@…

LOC, generally, is a useless statistic as shown in the println example above. however, in macro view, and depending on the industry/application, it has some value. However, making use of some external stats tool is ideal, then if you find loc useful, great, have it. If you find complexity calculation useful, add it.

The key, that was lost a bit in the follow on comments, was having it organized/summed by Component, rather than just per file. Other associations might be useful also, like by severity, or Date range? This would require some kind of association between file and component, and a little discipline in coding standards to maintain that, and might requiring configuration/use of the external tools properly to make good use of it.

I like metrics, I find them useful when taken together. I need them to be configurable/adjustable to my needs however, so the external tool idea is the way to go, IMHO.

comment:22 Changed 2 years ago by anonymous

+1, nice feature

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.