]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws
authorStas Vilchik <vilchiks@gmail.com>
Wed, 1 Apr 2015 13:08:54 +0000 (15:08 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 1 Apr 2015 13:24:59 +0000 (15:24 +0200)
server/sonar-web/src/main/js/source-viewer/viewer.js

index b86c28532d3522a60d43fbb23b6bd01497d55d9a..8423c0ffb339a9fddf8b10d43ba5328e9326d133 100644 (file)
@@ -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;
             }