aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-01 15:08:54 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-01 15:24:59 +0200
commit6e0105ee44c765a6e5d2618bf0f9b443c54027f4 (patch)
treeca06cbf298c780e8f200f7a9a1d52352f9f211b6
parentb0f8253fbd3ccbc5abe2e46dfdedb0d1ea0a1561 (diff)
downloadsonarqube-6e0105ee44c765a6e5d2618bf0f9b443c54027f4.tar.gz
sonarqube-6e0105ee44c765a6e5d2618bf0f9b443c54027f4.zip
fix quality flaws
-rw-r--r--server/sonar-web/src/main/js/source-viewer/viewer.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js
index b86c28532d3..8423c0ffb33 100644
--- a/server/sonar-web/src/main/js/source-viewer/viewer.js
+++ b/server/sonar-web/src/main/js/source-viewer/viewer.js
@@ -439,7 +439,9 @@ define([
blocks = _.filter(blocks, function (b) {
var outOfBounds = b.from > line || b.from + b.size < line,
currentFile = b._ref === '1',
- isOk = (b._ref != null) && (!currentFile || (currentFile && (outOfBounds || foundOne)));
+ shouldDisplayForCurrentFile = outOfBounds || foundOne,
+ shouldDisplay = !currentFile || (currentFile && shouldDisplayForCurrentFile),
+ isOk = (b._ref != null) && shouldDisplay;
if (b._ref === '1' && !outOfBounds) {
foundOne = true;
}