acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

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

    session.deleteContentStream = function (objectId, options) {
      var options = _fill(options);
      options.objectId = objectId;
      options.cmisaction = 'deleteContent';
      return new CmisRequest(_post(session.defaultRepository.rootFolderUrl)
Severity: Major
Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 4 other locations - About 2 hrs to fix
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 977..984
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 992..999
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1056..1063
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1093..1100

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

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

    session.checkOut = function (objectId, options) {
      var options = _fill(options);
      options.objectId = objectId;
      options.cmisaction = 'checkOut';
      return new CmisRequest(_post(session.defaultRepository.rootFolderUrl)
Severity: Major
Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 4 other locations - About 2 hrs to fix
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 929..935
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 992..999
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1056..1063
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1093..1100

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

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

    session.getAllVersions = function (versionSeriesId, options) {
      var options = _fill(options);
      options.versionSeriesId = versionSeriesId;
      options.cmisselector = 'versions';
      return new CmisRequest(_get(session.defaultRepository.rootFolderUrl)
Severity: Major
Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 4 other locations - About 2 hrs to fix
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 929..935
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 977..984
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 992..999
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1093..1100

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

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

    session.getAppliedPolicies = function (objectId, options) {
      var options = _fill(options);
      options.objectId = objectId;
      options.cmisselector = 'policies';
      return new CmisRequest(_get(session.defaultRepository.rootFolderUrl)
Severity: Major
Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js and 4 other locations - About 2 hrs to fix
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 929..935
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 977..984
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 992..999
cmis_web/static/lib/cmisjs/cmis.0.3.1.js on lines 1056..1063

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

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

    value: function switchView(view) {
      var forceOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      if (view === SidebarView.NONE) {
        this.close();
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

    Function AnnotationLayerBuilder has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var AnnotationLayerBuilder = function () {
      function AnnotationLayerBuilder(_ref) {
        var pageDiv = _ref.pageDiv,
            pdfPage = _ref.pdfPage,
            linkService = _ref.linkService,
    Severity: Major
    Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

      Function loadLocale has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function loadLocale(lang, callback) {
          if (lang) {
            lang = lang.toLowerCase();
          }
          callback = callback || function _callback() {};
      Severity: Major
      Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

        Function fontAdded has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            fontAdded: function fontAdded(fontObj, url) {
              function properties(obj, list) {
                var moreInfo = document.createElement('table');
                for (var i = 0; i < list.length; i++) {
                  var tr = document.createElement('tr');
        Severity: Major
        Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 2 hrs to fix

          Function Stats has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function AnnotationLayerBuilder has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var AnnotationLayerBuilder = function () {
              function AnnotationLayerBuilder(_ref) {
                var pageDiv = _ref.pageDiv,
                    pdfPage = _ref.pdfPage,
                    linkService = _ref.linkService,
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

              Function switchView has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  value: function switchView(view) {
                    var forceOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
              
                    if (view === SidebarView.NONE) {
                      this.close();
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

                Function loadLocale has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function loadLocale(lang, callback) {
                    if (lang) {
                      lang = lang.toLowerCase();
                    }
                    callback = callback || function _callback() {};
                Severity: Major
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

                  Function StepperManagerClosure has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var StepperManager = (function StepperManagerClosure() {
                    var steppers = [];
                    var stepperDiv = null;
                    var stepperControls = null;
                    var stepperChooser = null;
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 2 hrs 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

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

                  function webViewerPresentationModeChanged(evt) {
                    var active = evt.active,
                        switchInProgress = evt.switchInProgress;
                  
                    PDFViewerApplication.pdfViewer.presentationModeState = switchInProgress ? _pdf_viewer.PresentationModeState.CHANGING : active ? _pdf_viewer.PresentationModeState.FULLSCREEN : _pdf_viewer.PresentationModeState.NORMAL;
                  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 2078..2083

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

                  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 webViewerPresentationModeChanged(evt) {
                    var active = evt.active,
                        switchInProgress = evt.switchInProgress;
                  
                    PDFViewerApplication.pdfViewer.presentationModeState = switchInProgress ? _pdf_viewer.PresentationModeState.CHANGING : active ? _pdf_viewer.PresentationModeState.FULLSCREEN : _pdf_viewer.PresentationModeState.NORMAL;
                  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 2085..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 80.

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

                    function PDFThumbnailView(_ref) {
                      var container = _ref.container,
                          id = _ref.id,
                          defaultViewport = _ref.defaultViewport,
                          linkService = _ref.linkService,
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 2 hrs to fix

                    Function PDFThumbnailView has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function PDFThumbnailView(_ref) {
                        var container = _ref.container,
                            id = _ref.id,
                            defaultViewport = _ref.defaultViewport,
                            linkService = _ref.linkService,
                    Severity: Major
                    Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 2 hrs to fix

                      Function CmisRequest has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function CmisRequest(req, text) {
                      
                            var callback_ok = _noop;
                            var callback_notOk = _globalNotOk;
                            var callback_error = _globalError;
                      Severity: Major
                      Found in cmis_web/static/lib/cmisjs/cmis.0.3.1.js - About 2 hrs to fix

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

                        function cloneObj(obj) {
                          var result = Object.create(null);
                          for (var i in obj) {
                            if (Object.prototype.hasOwnProperty.call(obj, i)) {
                              result[i] = obj[i];
                        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 392..400

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

                        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 webViewerFind(evt) {
                          PDFViewerApplication.findController.executeCommand('find' + evt.type, {
                            query: evt.query,
                            phraseSearch: evt.phraseSearch,
                            caseSensitive: evt.caseSensitive,
                        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 2213..2221

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

                        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