acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

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

    try {
      var viewerOrigin = new URL(window.location.href).origin || 'null';
      if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
        return;
      }
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 2 hrs to fix
cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 1857..1869

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

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

    try {
      var viewerOrigin = new URL(window.location.href).origin || 'null';
      if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
        return;
      }
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 2 hrs to fix
cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 1856..1871

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

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

function isValidExplicitDestination(dest) {
  if (!(dest instanceof Array)) {
    return false;
  }
  var destLength = dest.length,
Severity: Minor
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

    Function isValidExplicitDestination has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function isValidExplicitDestination(dest) {
      if (!(dest instanceof Array)) {
        return false;
      }
      var destLength = dest.length,
    Severity: Minor
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

      Function draw has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          value: function draw() {
            var _this2 = this;
      
            if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
              console.error('Must be in new state before drawing');
      Severity: Minor
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

        Function error has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          error: function error(message, moreInfo) {
            var moreInfoText = [this.l10n.get('error_version_info', {
              version: _pdfjsLib.version || '?',
              build: _pdfjsLib.build || '?'
            }, 'PDF.js v{{version}} (build: {{build}})')];
        Severity: Minor
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

          Function error has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            error: function error(message, moreInfo) {
              var moreInfoText = [this.l10n.get('error_version_info', {
                version: _pdfjsLib.version || '?',
                build: _pdfjsLib.build || '?'
              }, 'PDF.js v{{version}} (build: {{build}})')];
          Severity: Minor
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

            Function draw has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                value: function draw() {
                  var _this2 = this;
            
                  if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
                    console.error('Must be in new state before drawing');
            Severity: Minor
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

              Function render has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  value: function render(_ref2) {
                    var outline = _ref2.outline;
              
                    var outlineCount = 0;
                    if (this.outline) {
              Severity: Minor
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                Function render has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    value: function render(_ref2) {
                      var outline = _ref2.outline;
                
                      var outlineCount = 0;
                      if (this.outline) {
                Severity: Minor
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                  Function nextMatch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      value: function nextMatch() {
                        var _this4 = this;
                  
                        var previous = this.state.findPrevious;
                        var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                    Function nextMatch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        value: function nextMatch() {
                          var _this4 = this;
                    
                          var previous = this.state.findPrevious;
                          var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
                    Severity: Minor
                    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                      Function pdfHistoryPush has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        push: function pdfHistoryPush(params, isInitialBookmark) {
                          if (!(this.initialized && this.historyUnlocked)) {
                            return;
                          }
                          if (params.dest && !params.hash) {
                      Severity: Minor
                      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                        Function pdfHistoryPush has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          push: function pdfHistoryPush(params, isInitialBookmark) {
                            if (!(this.initialized && this.historyUnlocked)) {
                              return;
                            }
                            if (params.dest && !params.hash) {
                        Severity: Minor
                        Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

                              value: function update(scale, rotation) {
                                this.scale = scale || this.scale;
                                if (typeof rotation !== 'undefined') {
                                  this.rotation = rotation;
                                }
                          Severity: Minor
                          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr 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 _touchSwipe has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  value: function _touchSwipe(evt) {
                                    if (!this.active) {
                                      return;
                                    }
                                    if (evt.touches.length > 1) {
                              Severity: Minor
                              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

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

                                    value: function _touchSwipe(evt) {
                                      if (!this.active) {
                                        return;
                                      }
                                      if (evt.touches.length > 1) {
                                Severity: Minor
                                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

                                      value: function update(scale, rotation) {
                                        this.scale = scale || this.scale;
                                        if (typeof rotation !== 'undefined') {
                                          this.rotation = rotation;
                                        }
                                  Severity: Minor
                                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

                                        session.getLastResult = function (options) {
                                          options = _fill(options);
                                          options.cmisaction = 'lastResult';
                                          return new CmisRequest(_post(session.defaultRepository.repositoryUrl)
                                            .send(options));
                                    Severity: Major
                                    Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 1 other location - About 1 hr to fix
                                    cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 256..261

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

                                    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