scc
scc copied to clipboard
JSON format is broken
Describe the bug
When supplied with the -f json
flag, the output generates an array for the Files
field instead of an int
[
{
"Name": "Swift",
"Bytes": 2052746,
"CodeBytes": 0,
"Lines": 67684,
"Code": 47337,
"Comment": 7389,
"Blank": 12958,
"Complexity": 3132,
"Count": 946,
"WeightedComplexity": 0,
"Files": []
},
etc...
To Reproduce
run scc -f json
Expected behavior
The files field should be of type Int
not an empty array
Desktop (please complete the following information):
- OS: macOS 12.5 (21G72)
- Version [3.0.0]
I just realized that the JSON
outputs Count
field is what probably should be the Files
value.
It seems like a bug nevertheless, hovever keeping in mind that this format is best for machine consumption (at least I am using it that way), any change would probably break existing consumers.
Yep Count
is what you are looking for in this case.
I don't know if I would classify it as a bug, but even if it was its unlikely to change in order to ensure backwards compatibility.
Going to close on the basic, that empty isnt a huge issue and I don't want to break backwards compatibility.