d4x1 commented on code in PR #6507:
URL:
https://github.com/apache/incubator-devlake/pull/6507#discussion_r1407050539
##########
backend/plugins/sonarqube/tasks/issues_collector.go:
##########
@@ -133,17 +148,62 @@ func CollectIssues(taskCtx plugin.SubTaskContext) (err
errors.Error) {
createdBeforeUnix = createdBefore.Unix()
}
- // can not split it any more
- if createdBeforeUnix-createdAfterUnix <= 10 {
- return 100, nil
+ // can not split it by time
+ if createdBeforeUnix-createdAfterUnix <=
MININTERVAL {
+ // split it by dir/fil
+ for _, facet := range body.Facets {
+ for _, value := range
facet.Values {
+ if value.Count <=
MAXISSUECOUNT {
+
iterator.Push(&SonarqubeIssueIteratorNode{
+
Severity: severity,
+ Status:
status,
+ Type:
typ,
+
CreatedAfter: createdAfter,
+
CreatedBefore: createdBefore,
+
FilePath: value.Val,
+ })
+
logger.Info("split by dir, and it's issue count:[%d] and file path:[%s]",
value.Count, value.Val)
+ } else {
+ // split it by
dir when it's issue count > 10000
+ res2, err :=
data.ApiClient.Get("issues/search", url.Values{
+
"componentKeys": {fmt.Sprintf("%v", data.Options.ProjectKey)},
+
"directories": {value.Val},
+
"facets": {"files"},
+ "ps":
{"1"},
Review Comment:
Can this work? I think it should be `"ps": []string{"1"}`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]