aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-06-01 16:02:43 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-06-01 16:02:43 +0200
commit6609543936253149851cbbcbb89d197a89eb2392 (patch)
tree3a8e78bb3d2d0ca26dfaecc0360d895a3ec92583
parent899e9116b68a6663ed9fd4aa8cf84556845aa5fb (diff)
downloadsonarqube-6609543936253149851cbbcbb89d197a89eb2392.tar.gz
sonarqube-6609543936253149851cbbcbb89d197a89eb2392.zip
fix quality flaws
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/quality-gates/gates-view.js2
-rw-r--r--server/sonar-web/src/main/js/components/issue/views/assign-form-view.js14
-rw-r--r--server/sonar-web/src/main/js/components/issue/views/tags-form-view.js14
-rw-r--r--server/sonar-web/src/main/js/libs/widgets/treemap.js4
5 files changed, 19 insertions, 19 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js b/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js
index 5c8353b7e00..5ec13c6734a 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/gate-conditions-view.js
@@ -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');
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js b/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js
index 2fa1ceb6d18..6c05b728d55 100644
--- a/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js
+++ b/server/sonar-web/src/main/js/apps/quality-gates/gates-view.js
@@ -19,7 +19,7 @@ define([
highlight: function (id) {
this.highlighted = id;
this.render();
- },
+ }
});
});
diff --git a/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js b/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js
index 9bda9b4ea5c..f2894e865af 100644
--- a/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js
+++ b/server/sonar-web/src/main/js/components/issue/views/assign-form-view.js
@@ -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;
}
},
diff --git a/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js b/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js
index a750a245b63..ee04d7103c9 100644
--- a/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js
+++ b/server/sonar-web/src/main/js/components/issue/views/tags-form-view.js
@@ -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;
}
},
diff --git a/server/sonar-web/src/main/js/libs/widgets/treemap.js b/server/sonar-web/src/main/js/libs/widgets/treemap.js
index f9cc1992833..5c38af4db18 100644
--- a/server/sonar-web/src/main/js/libs/widgets/treemap.js
+++ b/server/sonar-web/src/main/js/libs/widgets/treemap.js
@@ -297,8 +297,8 @@
}).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);