diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-22 17:11:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-22 17:11:21 +0100 |
commit | bc07b29494abd5dff7875175df91df38d0b908ac (patch) | |
tree | 05f82f8ca3787011e2a0810e7d85c9d81e4b222f /server/sonar-web/src/main/js/components/source-viewer/source.js | |
parent | e52ca10a4a1b07d05c894e0d8564ffa1b5af3e47 (diff) | |
download | sonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.tar.gz sonarqube-bc07b29494abd5dff7875175df91df38d0b908ac.zip |
upgrade eslint and its plugins, tune rules (#1481)
Diffstat (limited to 'server/sonar-web/src/main/js/components/source-viewer/source.js')
-rw-r--r-- | server/sonar-web/src/main/js/components/source-viewer/source.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/components/source-viewer/source.js b/server/sonar-web/src/main/js/components/source-viewer/source.js index 8a085468bb4..b862fbc73cf 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/source.js +++ b/server/sonar-web/src/main/js/components/source-viewer/source.js @@ -44,7 +44,7 @@ export default Backbone.Model.extend({ const source = this.get('source'); let metaIdx = 0; let metaLine = meta[metaIdx]; - source.forEach(function (line) { + source.forEach(line => { while (metaLine != null && line.line > metaLine.line) { metaLine = meta[++metaIdx]; } @@ -59,11 +59,11 @@ export default Backbone.Model.extend({ addDuplications (duplications) { const source = this.get('source'); if (source != null) { - source.forEach(function (line) { + source.forEach(line => { const lineDuplications = []; - duplications.forEach(function (d, i) { + duplications.forEach((d, i) => { let duplicated = false; - d.blocks.forEach(function (b) { + d.blocks.forEach(b => { if (b._ref === '1') { const lineFrom = b.from; const lineTo = b.from + b.size - 1; @@ -84,7 +84,7 @@ export default Backbone.Model.extend({ const source = this.get('source'); let hasDuplications = false; if (source != null) { - source.forEach(function (line) { + source.forEach(line => { if (line.duplicated) { hasDuplications = true; } @@ -94,9 +94,7 @@ export default Backbone.Model.extend({ }, hasCoverage (source) { - return _.some(source, function (line) { - return line.coverageStatus != null; - }); + return _.some(source, line => line.coverageStatus != null); } }); |