]> source.dussan.org Git - sonarqube.git/commitdiff
fix code issues
authorStas Vilchik <vilchiks@gmail.com>
Wed, 10 Aug 2016 12:36:31 +0000 (14:36 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 10 Aug 2016 12:36:31 +0000 (14:36 +0200)
server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js
server/sonar-web/src/main/js/components/navigator/filters/metric-filters.js
server/sonar-web/src/main/js/components/source-viewer/main.js

index 67bba2daf14b4e102a4e69031aa66c3d97021135..773106b40565ceac3cf99d1435852d9cd9952335 100644 (file)
@@ -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(`<div class="alert alert-success">${message}</div>`);
   },
 
   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(`<div class="alert alert-warning">${message}</div>`);
   },
 
index dba09ff94a82745b7811ff1c8028d980b391950e..ff48cbd760eaf1f24587fe0c204c0d2783b3d8d1 100644 (file)
@@ -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
index e5b226c2ff4a2b73494177331c5f6cd5338d5b0e..497e3d847c0695a87792bc7f1af83ec4513a1088 100644 (file)
@@ -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 = {};