aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-07-22 21:12:53 +0200
committerStas Vilchik <vilchiks@gmail.com>2014-07-22 21:12:53 +0200
commite7e4d9f3fea348a80388f7cfd9fedfb48b9c799c (patch)
tree1080c6231ab774d069359e4e10b3266109c71e81 /server
parenta156268839a1fc58ff068b2a75ebe1e0f890e061 (diff)
downloadsonarqube-e7e4d9f3fea348a80388f7cfd9fedfb48b9c799c.tar.gz
sonarqube-e7e4d9f3fea348a80388f7cfd9fedfb48b9c799c.zip
Fix quality flaws
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/application.js6
-rw-r--r--server/sonar-web/src/main/js/navigator/filters/choice-filters.js3
-rw-r--r--server/sonar-web/src/main/js/translate.js6
3 files changed, 8 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/application.js b/server/sonar-web/src/main/js/application.js
index e84f1158318..730edbfc0e0 100644
--- a/server/sonar-web/src/main/js/application.js
+++ b/server/sonar-web/src/main/js/application.js
@@ -70,10 +70,10 @@ var SelectBox = {
cache: {},
init: function (id) {
var box = document.getElementById(id);
- var node;
SelectBox.cache[id] = [];
var cache = SelectBox.cache[id];
- for (var i = 0; (node = box.options[i]); i++) {
+ for (var i = 0, j = box.options.length; i < j; i++) {
+ var node = box.options[i];
cache.push({value: node.value, text: node.text, displayed: 1});
}
},
@@ -98,7 +98,7 @@ var SelectBox = {
node.displayed = 1;
for (var j = 0, k = tokens.length; j < k; j++) {
var token = tokens[j];
- if (node.text.toLowerCase().indexOf(token) == -1) {
+ if (node.text.toLowerCase().indexOf(token) === -1) {
node.displayed = 0;
}
}
diff --git a/server/sonar-web/src/main/js/navigator/filters/choice-filters.js b/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
index b368384be9c..3dec5f94708 100644
--- a/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
+++ b/server/sonar-web/src/main/js/navigator/filters/choice-filters.js
@@ -122,6 +122,9 @@ define([
e.preventDefault();
this.selectCurrent();
break;
+ default:
+ // Not a functional key - then skip
+ break;
}
},
diff --git a/server/sonar-web/src/main/js/translate.js b/server/sonar-web/src/main/js/translate.js
index e6fd9b2f16a..bf2f7f47626 100644
--- a/server/sonar-web/src/main/js/translate.js
+++ b/server/sonar-web/src/main/js/translate.js
@@ -2,10 +2,8 @@
window.suppressTranslationWarnings = false;
var warn = function(message) {
- if (!window.suppressTranslationWarnings) {
- if (console != null && typeof console.warn === 'function') {
- console.warn(message);
- }
+ if (!window.suppressTranslationWarnings && console != null && typeof console.warn === 'function') {
+ console.warn(message);
}
};