]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6144 Component Viewer doesn't show coverage after line 1'000
authorStas Vilchik <vilchiks@gmail.com>
Mon, 2 Feb 2015 09:16:23 +0000 (10:16 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 2 Feb 2015 09:16:23 +0000 (10:16 +0100)
server/sonar-web/src/main/js/source-viewer/viewer.js

index fd234f626770074da9617e3d84fd53bc0f8a7e41..85d14bc9a9482fc2c1b37ddd8ae974bc2e298b93 100644 (file)
@@ -165,7 +165,7 @@ define([
               source.unshift({line: 0});
             }
             source = source.map(function (row) {
-              return _.extend(row, {coverageStatus: that.getCoverageStatus(row)});
+              return _.extend(row, { coverageStatus: that.getCoverageStatus(row) });
             });
             var firstLine = _.first(source).line,
                 linesRequested = options.to - options.from + 1;
@@ -539,6 +539,9 @@ define([
             if (source.length === 0 || (source.length > 0 && _.first(source).line === 1)) {
               source.unshift({line: 0});
             }
+            source = source.map(function (row) {
+              return _.extend(row, { coverageStatus: that.getCoverageStatus(row) });
+            });
             that.model.set({
               source: source,
               hasSourceBefore: (data.sources.length === that.LINES_AROUND) && (_.first(source).line > 0)
@@ -574,6 +577,9 @@ define([
               source = source.slice(source.length - that.TOTAL_LINES_LIMIT);
               that.model.set({ hasSourceBefore: true });
             }
+            source = source.map(function (row) {
+              return _.extend(row, { coverageStatus: that.getCoverageStatus(row) });
+            });
             that.model.set({
               source: source,
               hasSourceAfter: data.sources.length === that.LINES_AROUND