acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

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

    session.getRepositoryInfo = function (options) {
      options = _fill(options);
      options.cmisselector = 'repositoryInfo';
      return new CmisRequest(_get(session.defaultRepository.repositoryUrl)
        .query(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 638..643

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

Function _bindMouse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    value: function _bindMouse() {
      var _this2 = this;

      var div = this.textLayerDiv;
      var expandDivsTimer = null;
Severity: Minor
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

    Function _bindMouse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        value: function _bindMouse() {
          var _this2 = this;
    
          var div = this.textLayerDiv;
          var expandDivsTimer = null;
    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

          @api.depends('location')
          @api.multi
          def _compute_proxy_location(self):
              for record in self:
                  record.proxy_location = cmis.CMIS_PROXY_PATH + '/%s' % record.id
      Severity: Major
      Found in cmis_web_proxy/models/cmis_backend.py and 1 other location - About 1 hr to fix
      cmis_web_proxy_alf/models/cmis_backend.py on lines 13..18

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

      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

          @api.depends('alfresco_api_location')
          @api.multi
          def _compute_proxy_api_location(self):
              for record in self:
                  record.proxy_api_location = (
      Severity: Major
      Found in cmis_web_proxy_alf/models/cmis_backend.py and 1 other location - About 1 hr to fix
      cmis_web_proxy/models/cmis_backend.py on lines 21..25

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

      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

          init: function(parent, cmisObjectWrapped) {
              var self = this;
              var options = {
                  btnOkTitle: _t("Update content"),
                  title: _t("Update content of ") + cmisObjectWrapped.name,
      Severity: Major
      Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
      cmis_web/static/src/js/form_widgets.js on lines 428..436

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

      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

          init: function(parent, cmisObjectWrapped) {
              var self = this;
              var options = {
                  btnOkTitle: _t("Import new version"),
                  title: _t("Import new version of ") + cmisObjectWrapped.name,
      Severity: Major
      Found in cmis_web/static/src/js/form_widgets.js and 1 other location - About 1 hr to fix
      cmis_web/static/src/js/form_widgets.js on lines 404..412

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

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

          value: function _addEventListeners() {
            var _this3 = this;
      
            this.mainContainer.addEventListener('transitionend', function (evt) {
              if (evt.target === _this3.mainContainer) {
      Severity: Minor
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

        Function _addEventListeners has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            value: function _addEventListeners() {
              var _this3 = this;
        
              this.mainContainer.addEventListener('transitionend', function (evt) {
                if (evt.target === _this3.mainContainer) {
        Severity: Minor
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

          Function SimpleLinkService has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function convertMatches has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                value: function convertMatches(matches, matchesLength) {
                  var i = 0;
                  var iIndex = 0;
                  var textContentItemsStr = this.textContentItemsStr;
                  var end = textContentItemsStr.length - 1;
            Severity: Minor
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

              Function convertMatches has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  value: function convertMatches(matches, matchesLength) {
                    var i = 0;
                    var iIndex = 0;
                    var textContentItemsStr = this.textContentItemsStr;
                    var end = textContentItemsStr.length - 1;
              Severity: Minor
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 hr to fix

                Function SimpleLinkService has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function Stats has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var Stats = (function Stats() {
                    var stats = [];
                    function clear(node) {
                      while (node.hasChildNodes()) {
                        node.removeChild(node.lastChild);
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function goToDestination has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        var goToDestination = function goToDestination(_ref2) {
                          var namedDest = _ref2.namedDest,
                              explicitDest = _ref2.explicitDest;
                  
                          var destRef = explicitDest[0],
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix

                    Function goToDestination has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          var goToDestination = function goToDestination(_ref2) {
                            var namedDest = _ref2.namedDest,
                                explicitDest = _ref2.explicitDest;
                    
                            var destRef = explicitDest[0],
                    Severity: Minor
                    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

                      function formatL10nValue(text, args) {
                        if (!args) {
                          return text;
                        }
                        return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function (all, name) {
                      Severity: Major
                      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 hr to fix
                      cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 115..122

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

                      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 formatL10nValue(text, args) {
                        if (!args) {
                          return text;
                        }
                        return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function (all, name) {
                      Severity: Major
                      Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 hr to fix
                      cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 115..122

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

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

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

                        Function webViewerWheel has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function webViewerWheel(evt) {
                          var pdfViewer = PDFViewerApplication.pdfViewer;
                          if (pdfViewer.isInPresentationMode) {
                            return;
                          }
                        Severity: Minor
                        Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language