]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws
authorStas Vilchik <vilchiks@gmail.com>
Mon, 1 Jun 2015 14:02:43 +0000 (16:02 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 1 Jun 2015 14:02:43 +0000 (16:02 +0200)
server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js
server/sonar-web/src/main/js/apps/quality-gates/gates-view.js
server/sonar-web/src/main/js/components/issue/views/assign-form-view.js
server/sonar-web/src/main/js/components/issue/views/tags-form-view.js
server/sonar-web/src/main/js/libs/widgets/treemap.js

index 5c8353b7e009cc21a38619eec0f6939cb8d100c7..5ec13c6734a501998da27904b1cbb919754fc89a 100644 (file)
@@ -55,10 +55,10 @@ define([
         return !metric.hidden;
       });
       metrics = _.groupBy(metrics, 'domain');
-      metrics = _.map(metrics, function (metrics, domain) {
+      metrics = _.map(metrics, function (list, domain) {
         return {
           domain: domain,
-          metrics: _.sortBy(metrics, 'short_name')
+          metrics: _.sortBy(list, 'short_name')
         };
       });
       return _.sortBy(metrics, 'domain');
index 2fa1ceb6d180ee3d7202e0c9933b3646ebd4f87a..6c05b728d555cee989f374b57a644518763312a1 100644 (file)
@@ -19,7 +19,7 @@ define([
     highlight: function (id) {
       this.highlighted = id;
       this.render();
-    },
+    }
   });
 
 });
index 9bda9b4ea5cf7bdad0d76ec2ff3d8e3e555003cc..f2894e865af4a9820f27d74a615aac49131ae0fc 100644 (file)
@@ -89,19 +89,19 @@ define([
     onInputKeydown: function (e) {
       this.query = this.$('input').val();
       if (e.keyCode === 38) {
-        return this.selectPreviousOption();
+        this.selectPreviousOption();
       }
       if (e.keyCode === 40) {
-        return this.selectNextOption();
+        this.selectNextOption();
       }
       if (e.keyCode === 13) {
-        return this.selectActiveOption();
-      }
-      if (e.keyCode === 9) {
-        return false;
+        this.selectActiveOption();
       }
       if (e.keyCode === 27) {
-        return this.close();
+        this.close();
+      }
+      if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) {
+        return false;
       }
     },
 
index a750a245b63fda2b1836dc1712263ad2117314d2..ee04d7103c96412ec2776c7c03b6391af5b12950 100644 (file)
@@ -133,19 +133,19 @@ define([
     onInputKeydown: function (e) {
       this.query = this.$('input').val();
       if (e.keyCode === 38) {
-        return this.selectPreviousOption();
+        this.selectPreviousOption();
       }
       if (e.keyCode === 40) {
-        return this.selectNextOption();
+        this.selectNextOption();
       }
       if (e.keyCode === 13) {
-        return this.selectActiveOption();
-      }
-      if (e.keyCode === 9) {
-        return false;
+        this.selectActiveOption();
       }
       if (e.keyCode === 27) {
-        return this.close();
+        this.close();
+      }
+      if ([9, 13, 27, 38, 40].indexOf(e.keyCode) !== -1) {
+        return false;
       }
     },
 
index f9cc19928338f463a46abff551808529c9b1da6f..5c38af4db189ab6a7a82dca7a97200c6a63041f8 100644 (file)
     }).done(function (r) {
       var components = that.formatComponents(r);
       if (components != null) {
-        components = _.sortBy(components, function (d) {
-          return -that.sizeMetric.value(d);
+        components = _.sortBy(components, function (component) {
+          return -that.sizeMetric.value(component);
         });
         components = _.initial(components, components.length - that.options().maxItems - 1);
         that.updateTreemap(components, components.length > that.options().maxItems);