作为主题,例如Groovy文件。
我在my-groovy / src / main / java / com / mygroovy / example下创建了一个groovy文件,它包含一个声纳问题“Unused Variable”,可以被声纳跑步者检测到。
在my-groovy成功下运行sonarlint,但报告不正确。它没有问题......
// Apply our filter
self.applyFilter = function () {
// Create our filtered list
var filteredList = $filter('filter')(self.models, self.filter);
// Check to see if we are the same as the current list
var isSame = angular.equals(self.list, filteredList)
// If we are not the same
if (!isSame) {
// Update our scope
self.list = filteredList;
self.chartData = provider.getOverdueData(filteredList);
}
};
我的sonarlint.json是
my-groovy mac$ sonarlint --src '**/src/main/**'
INFO: Java 1.8.0_73 Oracle Corporation (64-bit)
INFO: Mac OS X 10.11.5 x86_64
INFO: Connected mode (org.mysonar:groovy)
INFO: Using storage for server 'org.mysonar' (last update 9/16/16 4:46 PM)
INFO: Index files
INFO: 6 files indexed
INFO: 4 source files to be analyzed
INFO: 4/4 source files have been analyzed
INFO:
------------- SonarLint Report -------------
No issues to display (6 files analyzed)
-------------------------------------------
INFO: SonarLint HTML Report generated: /Users/mac/Desktop/source/my-groovy/.sonarlint/sonarlint-report.html
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.855s
INFO: Final Memory: 6M/256M
INFO: ------------------------------------------------------------------------
我的global.json是
{
"serverId": "mysonar",
"projectKey":"org.mysonar:groovy"
}
答案 0 :(得分:0)
SonarLint尚不支持Groovy分析器,这就是您为什么会遇到这种意外行为的原因。