summaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-08-05 09:52:07 +0200
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2014-08-05 09:52:12 +0200
commit8f8524265ba56992a9e5bdc0f9e7abe84c6a9f8c (patch)
treed77aea3059af5342eb205ce6ad3376acc443d1b0 /server/sonar-web
parent5bd41ba9adf10b03fa302cdb3e29ad6fb3bbe62c (diff)
downloadsonarqube-8f8524265ba56992a9e5bdc0f9e7abe84c6a9f8c.tar.gz
sonarqube-8f8524265ba56992a9e5bdc0f9e7abe84c6a9f8c.zip
Fix quality flaws
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/application.js7
-rw-r--r--server/sonar-web/src/main/js/duplication.js5
-rw-r--r--server/sonar-web/src/main/js/widgets/bubble-chart.js12
3 files changed, 15 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/application.js b/server/sonar-web/src/main/js/application.js
index c17aeadeaea..43e29aa07ba 100644
--- a/server/sonar-web/src/main/js/application.js
+++ b/server/sonar-web/src/main/js/application.js
@@ -227,7 +227,8 @@ Treemap.prototype.load = function () {
var self = this;
$j.ajax({
type: "GET",
- url: baseUrl + '/treemap/index?html_id=' + this.id + '&size_metric=' + this.sizeMetric + '&color_metric=' + this.colorMetric + '&resource=' + context.rid,
+ url: baseUrl + '/treemap/index?html_id=' + this.id + '&size_metric=' + this.sizeMetric +
+ '&color_metric=' + this.colorMetric + '&resource=' + context.rid,
dataType: "html",
success: function (data) {
if (data.length > 1) {
@@ -385,7 +386,8 @@ function openAccordionItem(url) {
var ajaxRequest = $j.ajax({
url: url
}).fail(function (jqXHR, textStatus) {
- var error = "Server error. Please contact your administrator. The status of the error is : "+ jqXHR.status + ", textStatus is : "+ textStatus;
+ var error = "Server error. Please contact your administrator. The status of the error is : " +
+ jqXHR.status + ", textStatus is : " + textStatus;
console.log(error);
$j("#accordion-panel").append($j('<div class="error">').append(error));
}).done(function (html) {
@@ -481,4 +483,3 @@ jQuery(function() {
return false;
});
});
-
diff --git a/server/sonar-web/src/main/js/duplication.js b/server/sonar-web/src/main/js/duplication.js
index edd28f41fee..00732651ecb 100644
--- a/server/sonar-web/src/main/js/duplication.js
+++ b/server/sonar-web/src/main/js/duplication.js
@@ -11,11 +11,12 @@ function updateDuplicationLines(url, groupId, itemId, linesCount, fromLine, toLi
toLine = fromLine + linesCount - 1;
}
$j.ajax({
- url: url + "&to_line=" + toLine + "&from_line=" + fromLine + "&lines_count=" + linesCount + "&group_index=" + groupId,
+ url: url + "&to_line=" + toLine + "&from_line=" + fromLine + "&lines_count=" + linesCount +
+ "&group_index=" + groupId,
success:function(response){
$j('#source-' + groupId).html(response);
},
type:'get'
});
return false;
-} \ No newline at end of file
+}
diff --git a/server/sonar-web/src/main/js/widgets/bubble-chart.js b/server/sonar-web/src/main/js/widgets/bubble-chart.js
index d4b3feb87a3..76a0fac761a 100644
--- a/server/sonar-web/src/main/js/widgets/bubble-chart.js
+++ b/server/sonar-web/src/main/js/widgets/bubble-chart.js
@@ -73,10 +73,14 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
var noInvalidEntry = true,
atLeastOneValueOnX = false,
atLeastOneValueOnY = false;
- this.components().forEach(function validateComponent(component) {
- noInvalidEntry &= (!!component.measures[widget.metricsPriority()[0]] && !!component.measures[widget.metricsPriority()[1]]);
- atLeastOneValueOnX |= (component.measures[widget.metricsPriority()[0]] || {}).fval != '-';
- atLeastOneValueOnY |= (component.measures[widget.metricsPriority()[1]] || {}).fval != '-';
+ this.components().forEach(function(component) {
+ noInvalidEntry = noInvalidEntry &&
+ !!component.measures[widget.metricsPriority()[0]] &&
+ !!component.measures[widget.metricsPriority()[1]];
+ atLeastOneValueOnX = atLeastOneValueOnX ||
+ (component.measures[widget.metricsPriority()[0]] || {}).fval !== '-';
+ atLeastOneValueOnY = atLeastOneValueOnY ||
+ (component.measures[widget.metricsPriority()[1]] || {}).fval !== '-';
});
var validData = !!noInvalidEntry && !!atLeastOneValueOnX && !!atLeastOneValueOnY;