diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-02-07 09:54:17 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2017-02-07 09:54:30 +0100 |
commit | f760aabc58687ffa7794c056ff3195ba1eee3a5b (patch) | |
tree | 89d6929f46cac68f31bd1b49e1bd6d0d9ea6c81a /server/sonar-web/src/main/js | |
parent | ac69e7c18e1b4d86be4ea1085ef3b38c7bda531c (diff) | |
download | sonarqube-f760aabc58687ffa7794c056ff3195ba1eee3a5b.tar.gz sonarqube-f760aabc58687ffa7794c056ff3195ba1eee3a5b.zip |
fix quality flaws
Diffstat (limited to 'server/sonar-web/src/main/js')
11 files changed, 19 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js index 5cd860c9ab5..e1d1c750cde 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js @@ -134,7 +134,8 @@ export default class MeasureTreemap extends React.Component { const isFile = node.qualifier === 'FIL' || node.qualifier === 'UTS'; if (isFile) { - return Workspace.openComponent({ uuid: node.id }); + Workspace.openComponent({ uuid: node.id }); + return; } this.fetchComponents(node.key).then(() => { diff --git a/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js b/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js index 4736fdcfe50..c677a6aaf81 100644 --- a/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js +++ b/server/sonar-web/src/main/js/apps/issues/component-viewer/main.js @@ -40,7 +40,7 @@ export default SourceViewer.extend({ this.bindShortcuts(); if (this.baseIssue != null) { this.baseIssue.trigger('locations', this.baseIssue); - return this.scrollToLine(this.baseIssue.get('line')); + this.scrollToLine(this.baseIssue.get('line')); } }, @@ -51,7 +51,7 @@ export default SourceViewer.extend({ if (!selectedIssueView) { return; } - return selectedIssueView.find('.js-issue-' + action).click(); + selectedIssueView.find('.js-issue-' + action).click(); }; key('up', 'componentViewer', () => { that.options.app.controller.selectPrev(); diff --git a/server/sonar-web/src/main/js/apps/issues/controller.js b/server/sonar-web/src/main/js/apps/issues/controller.js index bdb0455f456..7bb4dff6a91 100644 --- a/server/sonar-web/src/main/js/apps/issues/controller.js +++ b/server/sonar-web/src/main/js/apps/issues/controller.js @@ -80,7 +80,7 @@ export default Controller.extend({ }); } if (firstPage && that.isIssuePermalink()) { - return that.showComponentViewer(that.options.app.list.first()); + that.showComponentViewer(that.options.app.list.first()); } }); }, @@ -112,7 +112,7 @@ export default Controller.extend({ }); const facetData = r.facets.find(facet => facet.property === id); if (facetData != null) { - return facet.set(facetData); + facet.set(facetData); } }); }, diff --git a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js index 9c327ffe51f..5556853dbc2 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js @@ -48,7 +48,7 @@ export default CustomValuesFacet.extend({ const value = this.options.app.state.get('query').assigned; if ((value != null) && (!value || value === 'false')) { - return this.$('.js-facet').filter('[data-unassigned]').addClass('active'); + this.$('.js-facet').filter('[data-unassigned]').addClass('active'); } }, diff --git a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js index 2ed322dc140..ae53f5ab467 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js @@ -56,7 +56,7 @@ export default BaseFacet.extend({ props.forEach(prop => { const value = query[prop]; if (value != null) { - return that.$(`input[name=${prop}]`).val(value); + that.$(`input[name=${prop}]`).val(value); } }); let values = this.model.getValues(); diff --git a/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js b/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js index 2a2720ba468..4d23327c619 100644 --- a/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js +++ b/server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js @@ -29,7 +29,7 @@ export default BaseFacet.extend({ BaseFacet.prototype.onRender.apply(this, arguments); const value = this.options.app.state.get('query').resolved; if ((value != null) && (!value || value === 'false')) { - return this.$('.js-facet').filter('[data-unresolved]').addClass('active'); + this.$('.js-facet').filter('[data-unresolved]').addClass('active'); } }, diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js index c37066308dc..308af5bd70b 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js @@ -90,7 +90,8 @@ class Template extends React.Component { handleToggleUser (user, permission) { if (user.login === '<creator>') { - return this.handleToggleProjectCreator(user, permission); + this.handleToggleProjectCreator(user, permission); + return; } const { template } = this.props; const hasPermission = user.permissions.includes(permission); diff --git a/server/sonar-web/src/main/js/apps/users/change-password-view.js b/server/sonar-web/src/main/js/apps/users/change-password-view.js index c68e9aabe6b..e8e7f2dcd76 100644 --- a/server/sonar-web/src/main/js/apps/users/change-password-view.js +++ b/server/sonar-web/src/main/js/apps/users/change-password-view.js @@ -38,7 +38,7 @@ export default ModalForm.extend({ return; } this.disableForm(); - return this.model.changePassword(oldPassword, password, { + this.model.changePassword(oldPassword, password, { statusCode: { // do not show global error 400: null diff --git a/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js b/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js index b80d0b5603d..a0cf1b3ddcb 100644 --- a/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js +++ b/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js @@ -94,7 +94,7 @@ export default PopupView.extend({ } this.disableForm(); this.options.detailView.disableControls(); - return $.post(url, data) + $.post(url, data) .done(r => this.options.detailView.updateAfterAction(r)) .fail(() => { this.enableForm(); diff --git a/server/sonar-web/src/main/js/helpers/handlebars/inArray.js b/server/sonar-web/src/main/js/helpers/handlebars/inArray.js index e1e36af1327..42d26d07a85 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/inArray.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/inArray.js @@ -18,11 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ module.exports = function (array, element, options) { - if (Array.isArray(array)) { - if (array.indexOf(element) !== -1) { - return options.fn(this); - } else { - return options.inverse(this); - } + if (Array.isArray(array) && array.indexOf(element) !== -1) { + return options.fn(this); + } else { + return options.inverse(this); } }; diff --git a/server/sonar-web/src/main/js/helpers/handlebars/limitString.js b/server/sonar-web/src/main/js/helpers/handlebars/limitString.js index 90d226a8609..bb823466346 100644 --- a/server/sonar-web/src/main/js/helpers/handlebars/limitString.js +++ b/server/sonar-web/src/main/js/helpers/handlebars/limitString.js @@ -21,5 +21,7 @@ module.exports = function (str) { if (typeof str === 'string') { const LIMIT = 30; return str.length > LIMIT ? str.substr(0, LIMIT) + '...' : str; + } else { + return ''; } }; |