]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Issues performance
authorStas Vilchik <vilchiks@gmail.com>
Tue, 1 Jul 2014 09:27:08 +0000 (15:27 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 1 Jul 2014 09:27:18 +0000 (15:27 +0600)
sonar-server/src/main/coffee/component-viewer/source.coffee

index d1e255f01a8463d40ecdd3505d6820cea784b149..e88be3c39d4148124c9f81707700f675749148d5 100644 (file)
@@ -101,7 +101,8 @@ define [
 
     renderIssues: ->
       issues = @model.get 'activeIssues'
-      issues = _.sortBy(issues, 'line').slice 0, ISSUES_LIMIT
+      issues = _.sortBy issues, 'line'
+      rendered = 0
       issues.forEach (issue) =>
         line = issue.line || 0
         line = 0 if issue.resolution == 'FIXED' || issue.resolution == 'REMOVED'
@@ -110,15 +111,17 @@ define [
           line = 0
           row = @$("##{@cid}-#{line}")
         if row.length > 0
+          rendered += 1
           row.removeClass 'row-hidden'
           container = row.children('.line')
           container.addClass 'issue' if line > 0
-          issueView = new IssueView model: new Issue issue
-          issueView.render().$el.appendTo container
-          issueView.on 'reset', =>
-            @options.main.requestComponent(@options.main.key, false, false).done =>
-              @options.main.headerView.silentUpdate = true
-              @options.main.headerView.render()
+          if rendered < ISSUES_LIMIT
+            issueView = new IssueView model: new Issue issue
+            issueView.render().$el.appendTo container
+            issueView.on 'reset', =>
+              @options.main.requestComponent(@options.main.key, false, false).done =>
+                @options.main.headerView.silentUpdate = true
+                @options.main.headerView.render()
 
 
     showSpinner: ->