From: Stas Vilchik Date: Wed, 10 Aug 2016 12:36:31 +0000 (+0200) Subject: fix code issues X-Git-Tag: 6.1-RC1~431 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dec7927beed0f65b76bec9a80b538612ad272d96;p=sonarqube.git fix code issues --- diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index 67bba2daf14..773106b4056 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -34,17 +34,15 @@ export default ModalFormView.extend({ showSuccessMessage (profile, succeeded) { const profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }); - const profileName = profileBase != null ? profileBase.name : profile; const message = translateWithParameters('coding_rules.bulk_change.success', - profileName, profileBase.language, succeeded); + profileBase.name, profileBase.language, succeeded); this.ui.messagesContainer.append(`
${message}
`); }, showWarnMessage (profile, succeeded, failed) { const profileBase = _.findWhere(this.options.app.qualityProfiles, { key: profile }); - const profileName = profileBase != null ? profileBase.name : profile; const message = translateWithParameters('coding_rules.bulk_change.warning', - profileName, profileBase.language, succeeded, failed); + profileBase.name, profileBase.language, succeeded, failed); this.ui.messagesContainer.append(`
${message}
`); }, diff --git a/server/sonar-web/src/main/js/components/navigator/filters/metric-filters.js b/server/sonar-web/src/main/js/components/navigator/filters/metric-filters.js index dba09ff94a8..ff48cbd760e 100644 --- a/server/sonar-web/src/main/js/components/navigator/filters/metric-filters.js +++ b/server/sonar-web/src/main/js/components/navigator/filters/metric-filters.js @@ -192,7 +192,7 @@ export default BaseFilters.BaseFilterView.extend({ } }); - if (value && value.metric && value.op && (value.val != null)) { + if (value.metric && value.op && (value.val != null)) { this.model.set({ value, enabled: true diff --git a/server/sonar-web/src/main/js/components/source-viewer/main.js b/server/sonar-web/src/main/js/components/source-viewer/main.js index e5b226c2ff4..497e3d847c0 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/main.js +++ b/server/sonar-web/src/main/js/components/source-viewer/main.js @@ -254,7 +254,7 @@ export default Marionette.LayoutView.extend({ const url = window.baseUrl + '/api/duplications/show'; const options = { uuid: this.model.id }; return $.get(url, options, function (data) { - const hasDuplications = (data != null) && (data.duplications != null); + const hasDuplications = data.duplications != null; let duplications = []; if (hasDuplications) { duplications = {};