Opened 17 years ago

Closed 16 years ago

#57 closed task (wontfix)

Stats ... Parser ... statistics

Reported by: Jari Häkkinen Owned by: Peter Johansson
Priority: major Milestone: 0.6
Component: core Version: trunk
Keywords: Cc:

Description (last modified by Peter Johansson)

What is the statistics generated by Stats class?

code comments empty lines should be ignored

The Stats class ignores empty lines but the Parser class does not. Yes, this was true even before Jaris change of the Stats class.

Anyway, the statistics should be described somewhere besides the API docs. (ref #59)

Change History (9)

comment:1 Changed 17 years ago by Jari Häkkinen

Also the Parser and the Stats parsing of blame lines must be kept in sync. A bug was removed (Stats.parse skipped empty lines without increasing the Parser count iterator). The construct Stats/Parser? is dangerous. Maybe another design should be contemplated especially now when SVNblame comes into play. Maybe SVNblame, Stats, and Parser should merge into something new?

comment:2 Changed 17 years ago by Peter Johansson

Milestone: later0.5

comment:3 Changed 17 years ago by Peter Johansson

Description: modified (diff)

comment:4 Changed 17 years ago by Peter Johansson

I agree. It looks like Parser easily could fit inside the SVNblame class, and that would probably be more logical and less error prone.

comment:5 Changed 17 years ago by Peter Johansson

The statement above that empty lines were ignored in the Stats object also Jari's change is not completely true. What is true is that the parsing ignored empty lines in the temporary files in which the system call was written. However empty lines in this temporary files is not equivalent to empty lines in the real file, because an empty line in the real file will have a blame output such as: " 14 Peter". Hence empty lines in the real file was not ignored. This extra check was introduced to avoid problems with trailing newlines, but was probably never really needed.

I suppose this means that the Stats class should be modified to not ignore empty lines, right?

comment:6 Changed 17 years ago by Jari Häkkinen

Should the stats class ignore empty lines? It depends, what is the stats class supposed to track? Code lines and comment lines? And the rest is assumed to be empty lines? Probably the stats object should keep track of all lines and tag them according to available tags at least in debug mode. I cannot recall the details but there was a clear miscrepancy between Stats and Parser when I checked it previously. Anyway, this may be irrelevant since I'd like to suggest another design for parsing and statistics in a later posting.

comment:7 Changed 17 years ago by Peter Johansson

A better way to use the Parser object would be to place it inside SVNblame. Parser should then not parse on construction but is parses line by line. The line could be sent to Parser (as a string) and the parsing corresponds to the code after the getline statement in present code. This design would bind SVNblame tighter together and make them easier to keep synched.

comment:8 Changed 17 years ago by Peter Johansson

(In [183]) refs #57 modified Stats to no longer skip empty line.

comment:9 Changed 16 years ago by Jari Häkkinen

Resolution: wontfix
Status: newclosed

Leave redesign to some distant future.

Note: See TracTickets for help on using tickets.