acsone/alfodoo

View on GitHub
cmis_web/static/src/js/form_widgets.js

Summary

Maintainability
F
1 wk
Test Coverage

File form_widgets.js has 1249 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*---------------------------------------------------------
 + * Odoo cmis_web
 + * Author  Laurent Mignon 2016 Acsone SA/NV
 + * License in __openerp__.py at root level of the module
 + *---------------------------------------------------------
Severity: Major
Found in cmis_web/static/src/js/form_widgets.js - About 3 days to fix

    Function register_content_events has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        register_content_events: function(){
             var self = this;
             var datatable_container =this.$el.find('.dataTables_scrollBody');
             datatable_container.off('dragleave dragend drop dragover dragenter drop');
             if (self.dislayed_folder_cmisobject && self.dislayed_folder_cmisobject.allowableActions['canCreateDocument']){
    Severity: Major
    Found in cmis_web/static/src/js/form_widgets.js - About 3 hrs to fix

      Function get_datatable_config has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          get_datatable_config: function(){
              var l10n = _t.database.parameters;
              var self = this;
              var config = {
                  searching:      false,
      Severity: Major
      Found in cmis_web/static/src/js/form_widgets.js - About 3 hrs to fix

        Function willStart has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

             willStart: function () {
                 var self = this;
                 var re = /(?:\.([^.]+))?$/;
                 var parts = re.exec(this.file.name);
                 var name_without_ext = this.file.name.slice(0, -parts[1].length - 1);
        Severity: Minor
        Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

          Function _get_css_class has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             _get_css_class: function(){
                 if (this.baseTypeId === 'cmis:folder') {
                     return 'fa fa-folder cmis-folder';
                 }
          
          
          Severity: Minor
          Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

            Function upload_files has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                upload_files: function(files){
                    var self = this;
                    var numFiles = files.length;
                    var processedFiles = [];
                    if (numFiles > 0) {
            Severity: Minor
            Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

              Function init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                   init: function(parent, parent_cmisobject, file) {
                       var self = this;
                       var options = {
                           buttons: [
                               {text: _t("Process"),
              Severity: Minor
              Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

                Function init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    init: function(parent, cmisObjectWrapped, options) {
                        var self = this;
                        var btnOkTitle = _t('OK');
                        if (!_.isUndefined(options) && _.has(options, 'btnOkTitle')){
                            btnOkTitle = options.btnOkTitle;
                Severity: Minor
                Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                           var options = {
                               buttons: [
                                   {text: _t("Process"),
                                    classes: "btn-primary",
                                    click: function (e) {
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 2 other locations - About 5 hrs to fix
                  cmis_web/static/src/js/form_widgets.js on lines 41..61
                  cmis_web/static/src/js/form_widgets.js on lines 265..285

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 150.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                           var options = {
                               buttons: [
                                   {text: _t("Rename"),
                                    classes: "btn-primary",
                                    click: function (e) {
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 2 other locations - About 5 hrs to fix
                  cmis_web/static/src/js/form_widgets.js on lines 96..116
                  cmis_web/static/src/js/form_widgets.js on lines 265..285

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 150.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                           var options = {
                               buttons: [
                                   {text: _t("Add"),
                                    classes: "btn-primary",
                                    click: function (e) {
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 2 other locations - About 5 hrs to fix
                  cmis_web/static/src/js/form_widgets.js on lines 41..61
                  cmis_web/static/src/js/form_widgets.js on lines 96..116

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 150.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                           this.$el.find('.dropdown-menu').on('mouseleave', function(e){
                               if($(e.target).is(':visible')){
                                   $(e.target).closest('.btn-group').find('.dropdown-toggle[aria-expanded="true"]').trigger('click').blur();
                               }
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 2 hrs to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1181..1185

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 94.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                           this.$el.find('.dropdown-menu a').on('click', function(e){
                               if($(e.target).is(':visible')){
                                   $(e.target).closest('.btn-group').find('.dropdown-toggle[aria-expanded="true"]').trigger('click').blur();
                               }
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 2 hrs to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1175..1179

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 94.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      init: function(parent, cmisObjectWrapped) {
                          var self = this;
                          var options = {
                              btnOkTitle: _t("Update content"),
                              title: _t("Update content of ") + cmisObjectWrapped.name,
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 428..436

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 68.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      init: function(parent, cmisObjectWrapped) {
                          var self = this;
                          var options = {
                              btnOkTitle: _t("Import new version"),
                              title: _t("Import new version of ") + cmisObjectWrapped.name,
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 404..412

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 68.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-rename').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_rename(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-checkout').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_checkout(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-get-properties').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_get_properties(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-delete-object').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_delete_object(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-cancel-checkout').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_cancel_checkout(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-set-content-stream').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_set_content_stream(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1222..1226
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 7 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-checkin').on('click', function(e) {
                               self._prevent_on_hashchange(e);
                               var row = self._get_event_row(e);
                               self.on_click_checkin(row);
                           });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 6 other locations - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1202..1206
                  cmis_web/static/src/js/form_widgets.js on lines 1207..1211
                  cmis_web/static/src/js/form_widgets.js on lines 1212..1216
                  cmis_web/static/src/js/form_widgets.js on lines 1217..1221
                  cmis_web/static/src/js/form_widgets.js on lines 1227..1231
                  cmis_web/static/src/js/form_widgets.js on lines 1232..1236

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                               cmis_session
                               .createDocument(this.parent_cmisobject.objectId, file, {'cmis:name': file.name}, file.mimeType)
                               .ok(function(data) {
                                   processedFiles.push(data);
                                   if (processedFiles.length == numFiles){
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1251..1259

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 58.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              cmis_session
                              .createDocument(this.displayed_folder_id, file, {'cmis:name': file.name}, file.mimeType)
                              .ok(function(data) {
                                  processedFiles.push(data);
                                  if (processedFiles.length == numFiles){
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 311..319

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 58.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          this.$el.find('.root-content-action-new-folder').on('click', function(e){
                              var dialog = new CmisCreateFolderDialog(self, self.dislayed_folder_cmisobject);
                              dialog.open();
                  
                          });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1327..1330

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          this.$el.find('.root-content-action-new-doc').on('click', function(e){
                              var dialog = new CmisCreateDocumentDialog(self, self.dislayed_folder_cmisobject);
                              dialog.open();
                          });
                  Severity: Major
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1322..1326

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 56.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                               this.cmisSession
                                   .updateProperties(this.cmisObject.objectId, {'cmis:name': newName})
                                   .ok(function (cmisObject) {
                                       self.getParent().trigger('cmis_node_updated', [cmisObject]);
                                       self.$el.parents('.modal').modal('hide');
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 50 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 189..194

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 52.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-download').on('click', function(e) {
                               var row = self._get_event_row(e);
                               self.on_click_download(row);
                           });
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 50 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1197..1200

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 52.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                           $el_actions.find('.content-action-preview').on('click', function(e) {
                               var row = self._get_event_row(e);
                               self.on_click_preview(row);
                           });
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 50 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1193..1196

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 52.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                               this.cmis_session
                                   .createDocument(this.parent_cmisobject.objectId, this.file, {'cmis:name': this.$new_filename.val()}, this.file.mimeType)
                                   .ok(function(new_cmisobject) {
                                       self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                                       self.$el.parents('.modal').modal('hide');
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 50 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 82..87

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 52.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                               datatable_container.on('dragover dragenter', function(e) {
                                   datatable_container.addClass('is-dragover');
                                   e.preventDefault();
                                   e.stopPropagation();
                               });
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 40 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1155..1159

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 49.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                               datatable_container.on('dragleave dragend drop', function(e) {
                                  datatable_container.removeClass('is-dragover');
                                  e.preventDefault();
                                  e.stopPropagation();
                               });
                  Severity: Minor
                  Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 40 mins to fix
                  cmis_web/static/src/js/form_widgets.js on lines 1150..1154

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 49.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status