From: Stas Vilchik Date: Tue, 1 Jul 2014 09:27:08 +0000 (+0600) Subject: SONAR-5209 Issues performance X-Git-Tag: 4.4-RC1~72 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=16e9a19771a8442c0628f7291bef15e1427d3226;p=sonarqube.git SONAR-5209 Issues performance --- diff --git a/sonar-server/src/main/coffee/component-viewer/source.coffee b/sonar-server/src/main/coffee/component-viewer/source.coffee index d1e255f01a8..e88be3c39d4 100644 --- a/sonar-server/src/main/coffee/component-viewer/source.coffee +++ b/sonar-server/src/main/coffee/component-viewer/source.coffee @@ -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: ->