I am trying to read the data returned by the new version of the api but I am a bit confused. The old api v4.6
had a documentation around the totals
and the diff
attributes. The documentation of v5
seem to be lacking a bit of information.
I ran the commit report
api on one of my repos and I got the following response:
(For sake of Interest, view the GET
api call HERE
{
"totals": {
"files": 2,
"lines": 55,
"hits": 54,
"misses": 1,
"partials": 0,
"coverage": 98.18,
"branches": 0,
"methods": 0,
"messages": 0,
"sessions": 1,
"complexity": 0.0,
"complexity_total": 0.0,
"complexity_ratio": 0,
"diff": [
1,
1,
1,
0,
0,
"100",
0,
0,
0,
0,
0,
0,
0
]
},
"files": [
{
"name": "calculator.py",
"totals": {
"files": 0,
"lines": 24,
"hits": 24,
"misses": 0,
"partials": 0,
"coverage": 100.0,
"branches": 0,
"methods": 0,
"messages": 0,
"sessions": 0,
"complexity": 0.0,
"complexity_total": 0.0,
"complexity_ratio": 0,
"diff": 0
},
"line_coverage": [
[
3,
0
],
[
4,
0
],
[
5,
0
],
[
6,
0
],
]
},
],
...,
"commit_file_url": "https://app.codecov.io/gh/ErnestFistozz/codecov-python/commit/604c71bae5b931d98636d6a26f968041469124c3/tree/"
}
I believe the totals
and diff
within the new api version is the same with what is explained by v4.6 Totals and Diff .
Can you please direct me to the documentation where
"line_coverage": [
[
3,
0
]
]
is explained. i.e I wish to understand what do the 3
and the 0
mean exactly. Finally, is there any api that returns the change
percentage as shown in the screenshot
NB: I am currently subtracting the old coverage from the new coverage to get the change, just asking if there’s an easier approach