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


##########
backend/plugins/sonarqube/tasks/issues_collector.go:
##########
@@ -133,17 +145,43 @@ func CollectIssues(taskCtx plugin.SubTaskContext) (err 
errors.Error) {
                                        createdBeforeUnix = createdBefore.Unix()
                                }
 
-                               // can not split it any more
+                               // can not split it by time
                                if createdBeforeUnix-createdAfterUnix <= 10 {
-                                       return 100, nil
+                                       // split it by dir/fil
+                                       for _, facet := range body.Facets {
+                                               for _, value := range 
facet.Values {
+                                                       // by dir
+                                                       if value.Count <= 
MAXPAGESIZE {
+                                                               
iterator.Push(&SonarqubeIssueIteratorNode{
+                                                                       
Severity:      severity,
+                                                                       Status: 
       status,
+                                                                       Type:   
       typ,
+                                                                       
CreatedAfter:  createdAfter,
+                                                                       
CreatedBefore: createdBefore,
+                                                                       
FilePath:      value.Val,
+                                                               })
+                                                               
logger.Info("split by dir for it's count:[%d] and val:[%s]", value.Count, 
value.Val)
+                                                       } else {
+                                                               // by file
+                                                               for _, issue := 
range body.Issues {

Review Comment:
   1. 
xxxx?componentKeys=6f29ad17-7573-4042-85b5-3ea750c08fb1&directories=node/src/services/app&ps=1&facets=files
     results show:
   
![image](https://github.com/apache/incubator-devlake/assets/101256042/7657fd2e-c464-4149-96a7-ed9eb0fe0721)
   2. 
xxxx?componentKeys=6f29ad17-7573-4042-85b5-3ea750c08fb1:node/src/services/app 
result shows:
   
![image](https://github.com/apache/incubator-devlake/assets/101256042/93739ac6-b8af-4827-8823-8b5bd5492f8c)
   
   



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