leric commented on code in PR #6507:
URL:
https://github.com/apache/incubator-devlake/pull/6507#discussion_r1403441180
##########
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:
why iterate issues here? might need another issues/search request to get
files facets:
http://sonar_service/api/issues/search?componentKeys=be620d2f-b3fa-4c4c-9ddb-515a3810e908&directories=frontend%2Fapp%2Fpages%2Fproject-comparison-page&resolved=false&ps=1&facets=files
--
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]