acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

Consider simplifying this complex logical expression.
Open

  if (!((typeof page === 'undefined' ? 'undefined' : _typeof(page)) === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
    return false;
  }
Severity: Critical
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

      if (!((typeof page === 'undefined' ? 'undefined' : _typeof(page)) === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
        return false;
      }
    Severity: Critical
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

              if r.text:
                  return self._prepare_json_response(
                      r.json(), dict(r.headers.items()), proxy_info, model_inst)
              else:
                  response = werkzeug.Response()
      Severity: Major
      Found in cmis_web_proxy/controllers/cmis.py and 1 other location - About 1 hr to fix
      cmis_web_proxy/controllers/cmis.py on lines 285..289

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

      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 r.text:
                  return self._prepare_json_response(
                      r.json(), dict(r.headers.items()), proxy_info, model_inst)
              else:
                  response = werkzeug.Response()
      Severity: Major
      Found in cmis_web_proxy/controllers/cmis.py and 1 other location - About 1 hr to fix
      cmis_web_proxy/controllers/cmis.py on lines 253..257

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

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

          upload_files: function(files){
              var self = this;
              var numFiles = files.length;
              var processedFiles = [];
              if (numFiles > 0) {
      Severity: Minor
      Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

        Function updateUIState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            value: function updateUIState(state, previous, matchCount) {
              var _this2 = this;
        
              var notFound = false;
              var findMsg = '';
        Severity: Minor
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

          Function translateElement has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function translateElement(element) {
              var l10n = getL10nAttributes(element);
              if (!l10n.id) return;
              var data = getL10nData(l10n.id, l10n.args);
              if (!data) {
          Severity: Minor
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

            Function _get_css_class has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

               _get_css_class: function(){
                   if (this.baseTypeId === 'cmis:folder') {
                       return 'fa fa-folder cmis-folder';
                   }
            
            
            Severity: Minor
            Found in cmis_web/static/src/js/form_widgets.js - About 1 hr to fix

              Function updateUIState has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  value: function updateUIState(state, previous, matchCount) {
                    var _this2 = this;
              
                    var notFound = false;
                    var findMsg = '';
              Severity: Minor
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                Function translateElement has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function translateElement(element) {
                    var l10n = getL10nAttributes(element);
                    if (!l10n.id) return;
                    var data = getL10nData(l10n.id, l10n.args);
                    if (!data) {
                Severity: Minor
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                  Function switchTool has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      value: function switchTool(tool) {
                        var _this2 = this;
                  
                        if (this.activeBeforePresentationMode !== null) {
                          return;
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

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

                        value: function update() {
                          var visible = this._getVisiblePages();
                          var visiblePages = visible.views;
                          if (visiblePages.length === 0) {
                            return;
                    Severity: Minor
                    Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                      Function _prepareMatches has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          value: function _prepareMatches(matchesWithLength, matches, matchesLength) {
                            function isSubTerm(matchesWithLength, currentIndex) {
                              var currentElem = matchesWithLength[currentIndex];
                              var nextElem = matchesWithLength[currentIndex + 1];
                              if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {
                      Severity: Minor
                      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                        Function GenericL10n has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var GenericL10n = function () {
                          function GenericL10n(lang) {
                            _classCallCheck(this, GenericL10n);
                        
                            this._lang = lang;
                        Severity: Minor
                        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

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

                              value: function render(_ref2) {
                                var attachments = _ref2.attachments,
                                    _ref2$keepRenderedCap = _ref2.keepRenderedCapability,
                                    keepRenderedCapability = _ref2$keepRenderedCap === undefined ? false : _ref2$keepRenderedCap;
                          
                          
                          Severity: Minor
                          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                            Function GenericL10n has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var GenericL10n = function () {
                              function GenericL10n(lang) {
                                _classCallCheck(this, GenericL10n);
                            
                                this._lang = lang;
                            Severity: Minor
                            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

                                  value: function render(_ref2) {
                                    var attachments = _ref2.attachments,
                                        _ref2$keepRenderedCap = _ref2.keepRenderedCapability,
                                        keepRenderedCapability = _ref2$keepRenderedCap === undefined ? false : _ref2$keepRenderedCap;
                              
                              
                              Severity: Minor
                              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                                Function _prepareMatches has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    value: function _prepareMatches(matchesWithLength, matches, matchesLength) {
                                      function isSubTerm(matchesWithLength, currentIndex) {
                                        var currentElem = matchesWithLength[currentIndex];
                                        var nextElem = matchesWithLength[currentIndex + 1];
                                        if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {
                                Severity: Minor
                                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                                  Function switchTool has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      value: function switchTool(tool) {
                                        var _this2 = this;
                                  
                                        if (this.activeBeforePresentationMode !== null) {
                                          return;
                                  Severity: Minor
                                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

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

                                        value: function update() {
                                          var visible = this._getVisiblePages();
                                          var visiblePages = visible.views;
                                          if (visiblePages.length === 0) {
                                            return;
                                    Severity: Minor
                                    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language