【发布时间】:2012-06-30 22:21:56
【问题描述】:
我有一个关于声纳的Code coverage 问题。
在这个例子中:
public static void apply(Person person) {
if (person != null) {
callApply(person);
}
}
在我的声纳Code coverage 中,我得到以下结果:
if (person != null) => hit=(10) % = (75%)
callApply(person); => hit(10) % =()
我不明白为什么在相同的命中数下,覆盖率是 75%?为什么我在调用 callApply 方法时没有任何值覆盖率
我认为这个版本的 Sonar 使用 Jacoco 作为覆盖代码。
谢谢。
【问题讨论】: