acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

Function PDFFindBar has 170 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var PDFFindBar = function () {
  function PDFFindBar(options) {
    var _this = this;

    var l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ui_utils.NullL10n;
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 6 hrs to fix

    Function PDFFindBar has 170 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var PDFFindBar = function () {
      function PDFFindBar(options) {
        var _this = this;
    
        var l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ui_utils.NullL10n;
    Severity: Major
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 6 hrs to fix

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

          if (file && file.lastIndexOf('file:', 0) === 0) {
            PDFViewerApplication.setTitleUsingUrl(file);
            var xhr = new XMLHttpRequest();
            xhr.onload = function () {
              PDFViewerApplication.open(new Uint8Array(xhr.response));
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 1996..2012

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

      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

          if (file && file.lastIndexOf('file:', 0) === 0) {
            PDFViewerApplication.setTitleUsingUrl(file);
            var xhr = new XMLHttpRequest();
            xhr.onload = function () {
              PDFViewerApplication.open(new Uint8Array(xhr.response));
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 1994..2010

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

      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 webViewerPageChanging(evt) {
        var page = evt.pageNumber;
        PDFViewerApplication.toolbar.setPageNumber(page, evt.pageLabel || null);
        PDFViewerApplication.secondaryToolbar.setPageNumber(page);
        if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2235..2248

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

      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 webViewerPageChanging(evt) {
        var page = evt.pageNumber;
        PDFViewerApplication.toolbar.setPageNumber(page, evt.pageLabel || null);
        PDFViewerApplication.secondaryToolbar.setPageNumber(page);
        if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2242..2255

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

      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 binarySearchFirstItem(items, condition) {
        var minIndex = 0;
        var maxIndex = items.length - 1;
        if (items.length === 0 || !condition(items[maxIndex])) {
          return items.length;
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 219..238

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

      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 binarySearchFirstItem(items, condition) {
        var minIndex = 0;
        var maxIndex = items.length - 1;
        if (items.length === 0 || !condition(items[maxIndex])) {
          return items.length;
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 6 hrs to fix
      cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 219..238

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

      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 PDFOutlineViewer has 147 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var PDFOutlineViewer = function () {
        function PDFOutlineViewer(_ref) {
          var container = _ref.container,
              linkService = _ref.linkService,
              eventBus = _ref.eventBus;
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 5 hrs to fix

        Function PDFOutlineViewer has 147 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var PDFOutlineViewer = function () {
          function PDFOutlineViewer(_ref) {
            var container = _ref.container,
                linkService = _ref.linkService,
                eventBus = _ref.eventBus;
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 5 hrs 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("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 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

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

          function webViewerPageMode(evt) {
            var mode = evt.mode,
                view = void 0;
            switch (mode) {
              case 'thumbs':
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 5 hrs to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2049..2071

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

          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

          var DefaultExternalServices = {
            updateFindControlState: function updateFindControlState(data) {},
            initPassiveLoading: function initPassiveLoading(callbacks) {},
            fallback: function fallback(data, callback) {},
            reportTelemetry: function reportTelemetry(data) {},
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 5 hrs to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 901..923

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

          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

          var DefaultExternalServices = {
            updateFindControlState: function updateFindControlState(data) {},
            initPassiveLoading: function initPassiveLoading(callbacks) {},
            fallback: function fallback(data, callback) {},
            reportTelemetry: function reportTelemetry(data) {},
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 5 hrs to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 902..924

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

          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 webViewerPageMode(evt) {
            var mode = evt.mode,
                view = void 0;
            switch (mode) {
              case 'thumbs':
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 5 hrs to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2042..2064

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

          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

          File cmis.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          # Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)
          # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
          import json
          import logging
          Severity: Minor
          Found in cmis_web_proxy/controllers/cmis.py - About 5 hrs to fix

            Function FontInspectorClosure has 135 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var FontInspector = (function FontInspectorClosure() {
              var fonts;
              var active = false;
              var fontAttribute = 'data-font-name';
              function removeSelection() {
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 5 hrs to fix

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

                  session.createPolicy = function (folderId, properties, policies, addACEs, removeACEs, options) {
                    options = _fill(options);
                    options.objectId = folderId;
                    _setProps(properties, options);
                    if (policies) {
              Severity: Major
              Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 5 hrs to fix
              cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 504..520

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

              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