acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

Consider simplifying this complex logical expression.
Open

  if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) {
    window.print();
    if (hasAttachEvent) {
      return;
    }
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

    Function get_unique_folder_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_unique_folder_name(self, name, parent, conflict_handler=None):
            """Return a unique name for a folder into its parent.
    
            Check if the name already exists into the parent.
            If the name already exists:
    Severity: Minor
    Found in cmis_field/models/cmis_backend.py - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

                var top = $image.prop('offsetHeight') * this.scale > $zoomer.height() ? e.clientY - this.dragStartY : 0;
    Severity: Minor
    Found in cmis_web/static/src/js/document_viewer.js and 1 other location - About 50 mins to fix
    cmis_web/static/src/js/document_viewer.js on lines 206..206

    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

                var left = $image.prop('offsetWidth') * this.scale > $zoomer.width() ? e.clientX - this.dragStartX : 0;
    Severity: Minor
    Found in cmis_web/static/src/js/document_viewer.js and 1 other location - About 50 mins to fix
    cmis_web/static/src/js/document_viewer.js on lines 205..205

    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

    Request.prototype.type = function(type){
      this.set('Content-Type', request.types[type] || type);
      return this;
    };
    Severity: Minor
    Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 1 other location - About 50 mins to fix
    cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 902..905

    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.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

    Request.prototype.accept = function(type){
      this.set('Accept', request.types[type] || type);
      return this;
    };
    Severity: Minor
    Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 1 other location - About 50 mins to fix
    cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 863..866

    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

    Avoid deeply nested control flow statements.
    Open

                if (anyCaseLang === lang) {
                  gL10nData = dict.locales[lang];
                  break;
                } else if (anyCaseLang === defaultLocale) {
                  gL10nData = dict.locales[defaultLocale];
    Severity: Major
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (found) {
                    children[i].nodeValue = '';
                  } else {
                    children[i].nodeValue = data[gTextProp];
                    found = true;
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if (zoomArgs.length !== 5) {
                        console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
                      } else {
                        dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
                      }
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (found) {
                        children[i].nodeValue = '';
                      } else {
                        children[i].nodeValue = data[gTextProp];
                        found = true;
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if (zoomArgs.length !== 5) {
                            console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
                          } else {
                            dest = [null, { name: zoomArg }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
                          }
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if (str.length > 0) {
                              newArgs.push(str.join(''));
                              str = [];
                            }
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 45 mins to fix

                Function createPolicy has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    session.createPolicy = function (folderId, properties, policies, addACEs, removeACEs, options) {
                Severity: Minor
                Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js - About 45 mins to fix

                  Function createItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      session.createItem = function (folderId, properties, policies, addACEs, removeACEs, options) {
                  Severity: Minor
                  Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if (anyCaseLang === lang) {
                                  gL10nData = dict.locales[lang];
                                  break;
                                } else if (anyCaseLang === defaultLocale) {
                                  gL10nData = dict.locales[defaultLocale];
                    Severity: Major
                    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          for result in gen_dict_extract(key, d):
                                              yield result
                      
                      
                      Severity: Major
                      Found in cmis_web_proxy/controllers/cmis.py - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language