]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaws
authorStas Vilchik <vilchiks@gmail.com>
Tue, 7 Feb 2017 08:54:17 +0000 (09:54 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 7 Feb 2017 08:54:30 +0000 (09:54 +0100)
server/sonar-web/src/main/js/apps/component-measures/details/treemap/MeasureTreemap.js
server/sonar-web/src/main/js/apps/issues/component-viewer/main.js
server/sonar-web/src/main/js/apps/issues/controller.js
server/sonar-web/src/main/js/apps/issues/facets/assignee-facet.js
server/sonar-web/src/main/js/apps/issues/facets/creation-date-facet.js
server/sonar-web/src/main/js/apps/issues/facets/resolution-facet.js
server/sonar-web/src/main/js/apps/permission-templates/components/Template.js
server/sonar-web/src/main/js/apps/users/change-password-view.js
server/sonar-web/src/main/js/components/issue/views/comment-form-view.js
server/sonar-web/src/main/js/helpers/handlebars/inArray.js
server/sonar-web/src/main/js/helpers/handlebars/limitString.js

index 5cd860c9ab5e4bf33fffaab9bc69e1b29bf7db9e..e1d1c750cde58da94513f69efd47155b34636745 100644 (file)
@@ -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(() => {
index 4736fdcfe50d96376c2edda3181c2bf3b45c4cf9..c677a6aaf81b1de1869b7c51940b5a5428b49cfd 100644 (file)
@@ -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();
index bdb0455f4568afac7bbc310934ed9f46a1c54a40..7bb4dff6a91565ace876ac277508b50fe5749d6d 100644 (file)
@@ -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);
       }
     });
   },
index 9c327ffe51f0db227f6336a93d696b1c7bfb324a..5556853dbc2bb85f149d2e9ed47f212c0c03b018 100644 (file)
@@ -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');
     }
   },
 
index 2ed322dc1408aa07c79f4e0ec2b84a8778358259..ae53f5ab467778e5742d4befc593ae4349d8b28b 100644 (file)
@@ -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();
index 2a2720ba468ac05bd6cd580d7956158f4fdae923..4d23327c6197fd08da01cb34a4d21777f3ba5591 100644 (file)
@@ -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');
     }
   },
 
index c37066308dce63e89eeeab7ca424edcb509d2407..308af5bd70ba47fecaf43f9ba07290f6fcaa7763 100644 (file)
@@ -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);
index c68e9aabe6b888bb881ac99098442b0580a9e974..e8e7f2dcd76a21218c61d7756212a559d12ed4a9 100644 (file)
@@ -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
index b80d0b5603d53898a670ada4222f224c559cb65e..a0cf1b3ddcb78dade9ec352b42492aae992c46fc 100644 (file)
@@ -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();
index e1e36af1327ec520dde2383eeb74c08b3bbbe604..42d26d07a852e87e7ced522d76f911ccbca5edfc 100644 (file)
  * 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);
   }
 };
index 90d226a8609279c2cbd83daf7e083452b971d400..bb82346634656a37b393b3cc4d69bdbb37a3308b 100644 (file)
@@ -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 '';
   }
 };