这一条有点具体.
We use SonarCloud, and the "New Code" settings for the relevant project is as following:
也就是说,在主分支机构上,只考虑新于2天的代码.
We had a merge request that made some changes, including switching from Java 11 to Java 17. It had a passing pipeline, so we merged, and bam! the analysis fails on the main branch:
如您所见,新代码被正确检测到(它显示"新代码:从2天前开始",并且只有9行被认为是新的.然而,我得到了10种代码气味,它们是在完全不同的、更老的代码上长大的.这些气味通常与Java 17有关(将‘Stream.Collect(Collectors.toList())’的用法替换为‘Stream.toList()’).
所以我的问题是:当SonarQube检测到Java版本更改时,它会忽略新的代码定义吗?是不是因为这些问题存在于旧代码中,但被认为是新的?为什么它没有在通过合并请求分析中被提出?