Part of the QA steps required for a project I am tangentially involved with require the person who is responsible to integrate new version of source file to first calculate how many lines have been added, removed and "changed". Changes may include physically move a whole function or procedure around the source file (without altering the content, just reorganization) and this is counted as "no change" while actually altering a line, say from
Of course the matching should not include extra spaces or comments.
The question is: can you point to something (I suppose a Perl script would be enough as a starter) that given two version of a file can:
Remove comments Count added, removed and "modified" lines, giving the three results, and not counting whole functions/procedures which have been moved up or down in the file without altering the workings?
Language is C/C++.
At the moment this is done by diff-ing the two source files and manually counting the lines. The result needs not to be precise to the line - basically if you get over a certain quota of "significant changes" the source goes through a more complicated integration/testing phase, so as long as the results are close enough to actual changes it's ok, in case of "too many changes" it will be reviewed by a human anyway.