acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

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

request.patch = function(url, data, fn){
  var req = request('PATCH', 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 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

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

request.get = function(url, data, fn){
  var req = request('GET', url);
  if ('function' == typeof data) fn = data, data = null;
  if (data) req.query(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 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
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

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

request.post = function(url, data, fn){
  var req = request('POST', 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 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

Function renderMatches has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    value: function renderMatches(matches) {
      if (matches.length === 0) {
        return;
      }
      var textContentItemsStr = this.textContentItemsStr;
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

    Function ProgressBar has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var ProgressBar = function () {
      function ProgressBar(id) {
        var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
            height = _ref.height,
            width = _ref.width,
    Severity: Major
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

      Function renderMatches has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          value: function renderMatches(matches) {
            if (matches.length === 0) {
              return;
            }
            var textContentItemsStr = this.textContentItemsStr;
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

        Function ProgressBar has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var ProgressBar = function () {
          function ProgressBar(id) {
            var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
                height = _ref.height,
                width = _ref.width,
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

          Function SecondaryToolbar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function SecondaryToolbar(options, mainContainer, eventBus) {
              _classCallCheck(this, SecondaryToolbar);
          
              this.toolbar = options.toolbar;
              this.toggleButton = options.toggleButton;
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

            Function SecondaryToolbar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function SecondaryToolbar(options, mainContainer, eventBus) {
                _classCallCheck(this, SecondaryToolbar);
            
                this.toolbar = options.toolbar;
                this.toggleButton = options.toggleButton;
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

              Function 1 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.superagent = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
              
              /**
               * Expose `Emitter`.
               */
              Severity: Major
              Found in cmis_web/static/lib/cmisjs/superagent.7.2.0.js - About 2 hrs to fix

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

                    session.createType = function (type, options) {
                      options = _fill(options);
                      options.cmisaction = 'createType';
                      options.type = JSON.stringify(type);
                      return new CmisRequest(_post(session.defaultRepository.repositoryUrl)
                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 610..617

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

                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.updateType = function (type, options) {
                      options = _fill(options);
                      options.cmisaction = 'updateType';
                      options.type = JSON.stringify(type);
                      return new CmisRequest(_post(session.defaultRepository.repositoryUrl)
                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 596..602

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

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

                    updateOperatorList: function updateOperatorList(operatorList) {
                      var self = this;
                
                      function cboxOnClick() {
                        var x = +this.dataset.idx;
                Severity: Major
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 2 hrs to fix

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

                  function apiPageModeToSidebarView(mode) {
                    switch (mode) {
                      case 'UseNone':
                        return _pdf_sidebar.SidebarView.NONE;
                      case 'UseThumbs':
                  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 2530..2543

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

                  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 apiPageModeToSidebarView(mode) {
                    switch (mode) {
                      case 'UseNone':
                        return _pdf_sidebar.SidebarView.NONE;
                      case 'UseThumbs':
                  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 2523..2536

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

                  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 webViewerHashchange(evt) {
                    if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
                      var hash = evt.hash;
                      if (!hash) {
                        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 2131..2143

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

                  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 webViewerHashchange(evt) {
                    if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
                      var hash = evt.hash;
                      if (!hash) {
                        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 2124..2136

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

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

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

                    Function PasswordPrompt has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                      function webViewerSidebarViewChanged(evt) {
                        PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;
                        var store = PDFViewerApplication.store;
                        if (store && PDFViewerApplication.isInitialViewSet) {
                          store.set('sidebarView', evt.view).catch(function () {});
                      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 2084..2090

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

                      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