Closed spenserblack closed 4 weeks ago
Yep pretty clearly a bug. As you say the additional newline. Its one of those things I explicitly removed from the main counts, but forgot about when it came to the ULOC calculation. Ill fix it soon.
Pushed a fix which resolves it.
$ go run . -u examples/issue552
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
Plain Text 1 2 0 0 2 0
(ULOC) 2
───────────────────────────────────────────────────────────────────────────────
Total 1 2 0 0 2 0
───────────────────────────────────────────────────────────────────────────────
Unique Lines of Code (ULOC) 2
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop (organic) $39
Estimated Schedule Effort (organic) 0.29 months
Estimated People Required (organic) 0.01
───────────────────────────────────────────────────────────────────────────────
Processed 18 bytes, 0.000 megabytes (SI)
───────────────────────────────────────────────────────────────────────────────
Will ensure this will make it into the next release. Thanks for reporting with a test case that makes it so easy to resolve.
Describe the bug
I ran
scc -u
and got 1 more unique line than total lines... which I don't believe should ever be possible :sweat_smile:Based on some very simple testing, it looks like the final newline is counted towards the ULOC count.
This is surprising behavior because
To Reproduce
I've got a minimal file used to generate the report above here:
Note that the final newline is important.
Expected behavior
2 lines, 2 total lines. I'm not really sure if all empty lines should be excluded from the ULOC count, but probably the final newline at least.
Desktop (please complete the following information):