summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/graphs
diff options
context:
space:
mode:
authorJack Davison <jack.davison@student.manchester.ac.uk>2016-09-09 18:36:48 +0100
committerJack Davison <jack.davison@student.manchester.ac.uk>2016-10-26 14:22:53 +0100
commit728f1f71a53707606393c7887fe690dffb0d0916 (patch)
tree598821b50c933b795413df02e899ac0bd3139393 /app/assets/javascripts/graphs
parenta66a3c7449f6d91f7f3bb1a86ac0e17623ba1fd6 (diff)
downloadgitlab-ce-728f1f71a53707606393c7887fe690dffb0d0916.tar.gz
Refactored less readable existance checks
CoffeeScript generated JavaScript contains some unreadable expressions. This refactoring addresses complex uses of the exestential operator that produced unreadable Javascript.
Diffstat (limited to 'app/assets/javascripts/graphs')
-rw-r--r--app/assets/javascripts/graphs/stat_graph_contributors_graph.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js
index 7d9d4d7c679..917c87a21a0 100644
--- a/app/assets/javascripts/graphs/stat_graph_contributors_graph.js
+++ b/app/assets/javascripts/graphs/stat_graph_contributors_graph.js
@@ -29,8 +29,7 @@
ContributorsGraph.set_y_domain = function(data) {
return ContributorsGraph.prototype.y_domain = [
0, d3.max(data, function(d) {
- var ref, ref1;
- return d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions;
+ return d.commits = d.commits || d.additions || d.deletions;
})
];
};
@@ -44,8 +43,7 @@
ContributorsGraph.init_y_domain = function(data) {
return ContributorsGraph.prototype.y_domain = [
0, d3.max(data, function(d) {
- var ref, ref1;
- return d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions;
+ return d.commits = d.commits || d.additions || d.deletions;
})
];
};
@@ -147,9 +145,8 @@
return this.area = d3.svg.area().x(function(d) {
return x(d.date);
}).y0(this.height).y1(function(d) {
- var ref, ref1, xa;
- xa = d.commits = (ref = (ref1 = d.commits) != null ? ref1 : d.additions) != null ? ref : d.deletions;
- return y(xa);
+ d.commits = d.commits || d.additions || d.deletions;
+ return y(d.commits);
}).interpolate("basis");
};