abeizn commented on code in PR #6507:
URL: 
https://github.com/apache/incubator-devlake/pull/6507#discussion_r1407119073


##########
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:
   yes,
   "ps": {"1"} is correct
   "ps": {}string{"1"} is invalid syntax



-- 
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]

Reply via email to