Hi, I was using the CodeStats task and discovered that it produces inaccurate results for block comments in C#. It does not correctly count the lines of comments within a block comment (/* ... */ spread across multiple lines).
The following modifications of lines 313 and 318 appear to solve the problem in the small sampling I have done. Line 313, from: if(line.IndexOf(_commentStarSlash)== 0) { Line 313, to: if(line.IndexOf(_commentStarSlash)==-1) { Line 318, from: if(line.IndexOf(_commentStarSlash)>0) { Line 318, to: if(line.IndexOf(_commentStarSlash)>=0) { For example: -- example ---------------------------------------- // comment // /* comment */ using System; -- example ---------------------------------------- With the existing code: Total: 8 - Comment: 3 - Empty: 2 With the above changes: Total: 8 - Comment: 5 - Empty: 2 Bert ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ NAntContrib-Developer mailing list NAntContrib-Developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer