I know what the difference is between line and branch coverage, but what is the difference between code coverage and line coverage? Is the former instruction coverage?
To expand on the answer, you can only query sonar for these terms:
And then you can covert to the terms above using these equations:
CT + CF = conditions_to_cover - uncovered_conditions
2*B = conditions_to_cover
LC = lines_to_cover - uncovered_lines
EL = lines_to_cover
You can use the Sonar Drilldown or REST API to get the metric values above:
http://my.sonar.com/drilldown/measures/My-Project-Name?metric=line_coverage
http://my.sonar.com/api/resources?resource=55555&metrics=ncloc,conditions_to_cover,uncovered_conditions,lines_to_cover,uncovered_lines,coverage,line_coverage,branch_coverage,it_conditions_to_cover,it_uncovered_conditions,it_lines_to_cover,it_uncovered_lines,it_coverage,it_line_coverage,it_branch_coverage,overall_conditions_to_cover,overall_uncovered_conditions,overall_lines_to_cover,overall_uncovered_lines,overall_coverage,overall_line_coverage,overall_branch_coverage
This blog post has additional information: http://sizustech.blogspot.com/2015/10/making-sense-of-sonar-qube-stats-like.html