sonarqube网站“;“行”;数据位于/api/issues/search
我试图从问题列表中获取组件行(代码行), 我正在使用/api/issues/search?ps=500&p=1&statuses=OPEN 但是,issues数组有一些对象没有“line”属性 在本例中,第二个对象具有“线”属性,但第一个对象没有:sonarqube网站“;“行”;数据位于/api/issues/search,sonarqube,sonarqube-web,sonarqube-5.5,Sonarqube,Sonarqube Web,Sonarqube 5.5,我试图从问题列表中获取组件行(代码行), 我正在使用/api/issues/search?ps=500&p=1&statuses=OPEN 但是,issues数组有一些对象没有“line”属性 在本例中,第二个对象具有“线”属性,但第一个对象没有: { "key": "353163de-a4df-40e3-82f0-9a39e94bd1db", "rule": "squid:S00105", "severity": "MINOR", "component": "revision_
{
"key": "353163de-a4df-40e3-82f0-9a39e94bd1db",
"rule": "squid:S00105",
"severity": "MINOR",
"component": "revision_tqc_r5:controlador/cl/ps/io/Word.java",
"componentId": 374,
"project": "revision_tqc_r5",
"flows": [],
"status": "OPEN",
"message": "Replace all tab characters in this file by sequences of white-spaces.",
"effort": "2min",
"debt": "2min",
"author": "",
"tags": [(...)],
"creationDate": "2016-04-20T22:14:21+0200",
"updateDate": "2016-04-20T22:14:21+0200",
"type": "CODE_SMELL"
},
{
"key": "3535f5e2-622d-42d3-b18c-a555c4b7c182",
"rule": "css:leading-zeros",
"severity": "MINOR",
"component": "revision_tqc_r5:vista/web/defectos/wpscripts/wpstyleslogin.css",
"componentId": 3037,
"project": "revision_tqc_r5",
"line": 100,
"textRange": {(...)},
"flows": [],
"status": "OPEN",
"message": "Remove this leading zero",
"effort": "2min",
"debt": "2min",
"author": "",
"tags": [(...)],
"creationDate": "2016-04-20T22:14:21+0200",
"updateDate": "2016-04-20T22:14:21+0200",
"type": "CODE_SMELL"
}
如何在issues数组的这些对象中显示“line”属性
谢谢。在SonarQube中,问题可以附加到文件级别-在这种情况下,web服务不会返回“line”属性
在您的示例中,检测文件中使用了某些选项卡的规则正是在这种情况下。它只是说“在这个文件中,您使用的选项卡应该用空格代替”。这样做的目的是为了不让太多相同类型的问题“污染”您的项目。若您指的是行号,而不是行号本身 它是 “文本范围”:{(…)}, 它有两名成员
- issue.textRange.startine
- issue.textRange.endLine