--- a/DataViews/CodeMetrics.py Thu Sep 03 18:38:19 2015 +0200 +++ b/DataViews/CodeMetrics.py Thu Sep 03 19:15:51 2015 +0200 @@ -244,9 +244,13 @@ stats.inc('nloc') elif tok.type == COMMENT: stats.inc('comments') + if tok.line.strip() == tok.text: + stats.inc('commentlines') elif tok.type == EMPTY: if parser.tokenlist[idx - 1].type == token.OP: stats.inc('nloc') + elif parser.tokenlist[idx - 1].type == COMMENT: + continue else: stats.inc('empty') elif tok.type == INDENT: @@ -261,6 +265,8 @@ summarize(total, 'lines', parser.lines) summarize(total, 'bytes', len(text)) summarize(total, 'comments', stats.getCounter('TOTAL ', 'comments')) + summarize(total, 'commentlines', + stats.getCounter('TOTAL ', 'commentlines')) summarize(total, 'empty lines', stats.getCounter('TOTAL ', 'empty')) summarize(total, 'non-commentary lines', stats.getCounter('TOTAL ', 'nloc'))