acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

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

  function parseResource(href, lang, successCallback, failureCallback) {
    var baseURL = href.replace(/[^\/]*$/, '') || './';
    function evalString(text) {
      if (text.lastIndexOf('\\') < 0) return text;
      return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'");
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 3 hrs to fix

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

      function parseResource(href, lang, successCallback, failureCallback) {
        var baseURL = href.replace(/[^\/]*$/, '') || './';
        function evalString(text) {
          if (text.lastIndexOf('\\') < 0) return text;
          return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'");
    Severity: Major
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.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

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

            session.getDescendants = function (folderId, depth, options) {
              options = _fill(options);
              options.cmisselector = 'descendants';
              if (depth) {
                options.depth = depth;
        Severity: Major
        Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 3 hrs to fix
        cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 685..694

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

        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

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

        function webViewerPageNumberChanged(evt) {
          var pdfViewer = PDFViewerApplication.pdfViewer;
          pdfViewer.currentPageLabel = evt.value;
          if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) {
            PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 3 hrs to fix
        cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2194..2200

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

        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

            session.getFolderTree = function (folderId, depth, options) {
              options = _fill(options);
              options.cmisselector = 'folderTree';
              if (depth) {
                options.depth = depth;
        Severity: Major
        Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 3 hrs to fix
        cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 667..676

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

        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

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

        function webViewerPageNumberChanged(evt) {
          var pdfViewer = PDFViewerApplication.pdfViewer;
          pdfViewer.currentPageLabel = evt.value;
          if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) {
            PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 3 hrs to fix
        cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2201..2207

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

        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

        Function StepperManagerClosure has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var StepperManager = (function StepperManagerClosure() {
          var steppers = [];
          var stepperDiv = null;
          var stepperControls = null;
          var stepperChooser = null;
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 3 hrs to fix

          Function setHash has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              value: function setHash(hash) {
                var pageNumber = void 0,
                    dest = void 0;
                if (hash.indexOf('=') >= 0) {
                  var params = (0, _ui_utils.parseQueryString)(hash);
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 3 hrs to fix

            Function setHash has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                value: function setHash(hash) {
                  var pageNumber = void 0,
                      dest = void 0;
                  if (hash.indexOf('=') >= 0) {
                    var params = (0, _ui_utils.parseQueryString)(hash);
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 3 hrs to fix

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

              function webViewerResize() {
                var pdfDocument = PDFViewerApplication.pdfDocument,
                    pdfViewer = PDFViewerApplication.pdfViewer;
              
                if (!pdfDocument) {
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 3 hrs to fix
              cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2118..2130

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

              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

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

              function webViewerResize() {
                var pdfDocument = PDFViewerApplication.pdfDocument,
                    pdfViewer = PDFViewerApplication.pdfViewer;
              
                if (!pdfDocument) {
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 3 hrs to fix
              cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2111..2123

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

              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

              Function paintOnCanvas has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  value: function paintOnCanvas(canvasWrapper) {
                    var renderCapability = (0, _pdfjsLib.createPromiseCapability)();
                    var result = {
                      promise: renderCapability.promise,
                      onRenderContinue: function onRenderContinue(cont) {
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 3 hrs to fix

                Function paintOnCanvas has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    value: function paintOnCanvas(canvasWrapper) {
                      var renderCapability = (0, _pdfjsLib.createPromiseCapability)();
                      var result = {
                        promise: renderCapability.promise,
                        onRenderContinue: function onRenderContinue(cont) {
                Severity: Major
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 3 hrs to fix

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

                      session.applyPolicy = function (objectId, policyId, options) {
                        var options = _fill(options);
                        options.objectId = objectId;
                        options.policyId = policyId;
                        options.cmisaction = 'applyPolicy';
                  Severity: Major
                  Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 2 hrs to fix
                  cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1125..1133

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

                      session.removePolicy = function (objectId, policyId, options) {
                        var options = _fill(options);
                        options.objectId = objectId;
                        options.policyId = policyId;
                        options.cmisaction = 'removePolicy';
                  Severity: Major
                  Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 2 hrs to fix
                  cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1109..1116

                  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 5 locations. Consider refactoring.
                  Open

                  request.put = function(url, data, fn){
                    var req = request('PUT', url);
                    if ('function' == typeof data) fn = data, data = null;
                    if (data) req.send(data);
                    if (fn) req.end(fn);
                  Severity: Major
                  Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1296..1302
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356

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

                  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 5 locations. Consider refactoring.
                  Open

                  request.head = function(url, data, fn){
                    var req = request('HEAD', url);
                    if ('function' == typeof data) fn = data, data = null;
                    if (data) req.send(data);
                    if (fn) req.end(fn);
                  Severity: Major
                  Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js and 4 other locations - About 2 hrs to fix
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1278..1284
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1332..1338
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1350..1356
                  cmis_web/static/lib/cmisjs/superagent.7.2.0.js on lines 1368..1374

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language