acsone/alfodoo

View on GitHub

Showing 538 of 538 total issues

Function PDFSidebar has 307 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var PDFSidebar = function () {
  function PDFSidebar(options) {
    var l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _ui_utils.NullL10n;

    _classCallCheck(this, PDFSidebar);
Severity: Major
Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 day to fix

    Function PDFSidebar has 307 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

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

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

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

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

          function webViewerUpdateViewarea(evt) {
            var location = evt.location,
                store = PDFViewerApplication.store;
            if (store && PDFViewerApplication.isInitialViewSet) {
              store.setMultiple({
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 day to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2091..2110

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

          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 webViewerUpdateViewarea(evt) {
            var location = evt.location,
                store = PDFViewerApplication.store;
            if (store && PDFViewerApplication.isInitialViewSet) {
              store.setMultiple({
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 day to fix
          cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2098..2117

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

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

          var TextLayerBuilder = function () {
            function TextLayerBuilder(_ref) {
              var textLayerDiv = _ref.textLayerDiv,
                  eventBus = _ref.eventBus,
                  pageIndex = _ref.pageIndex,
          Severity: Major
          Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 day to fix

            Function TextLayerBuilder has 287 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var TextLayerBuilder = function () {
              function TextLayerBuilder(_ref) {
                var textLayerDiv = _ref.textLayerDiv,
                    eventBus = _ref.eventBus,
                    pageIndex = _ref.pageIndex,
            Severity: Major
            Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 day to fix

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

              {
                webViewerFileInputChange = function webViewerFileInputChange(evt) {
                  var file = evt.fileInput.files[0];
                  if (!_pdfjsLib.PDFJS.disableCreateObjectURL && URL.createObjectURL) {
                    PDFViewerApplication.open(URL.createObjectURL(file));
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 day to fix
              cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2145..2165

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

              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

              {
                webViewerFileInputChange = function webViewerFileInputChange(evt) {
                  var file = evt.fileInput.files[0];
                  if (!_pdfjsLib.PDFJS.disableCreateObjectURL && URL.createObjectURL) {
                    PDFViewerApplication.open(URL.createObjectURL(file));
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 day to fix
              cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2138..2158

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

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

              var PDFLinkService = function () {
                function PDFLinkService() {
                  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                      eventBus = _ref.eventBus;
              
              
              Severity: Major
              Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js - About 1 day to fix

                Function PDFLinkService has 273 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var PDFLinkService = function () {
                  function PDFLinkService() {
                    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
                        eventBus = _ref.eventBus;
                
                
                Severity: Major
                Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js - About 1 day to fix

                  Function StepperClosure has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var Stepper = (function StepperClosure() {
                    // Shorter way to create element and optionally set textContent.
                    function c(tag, textContent) {
                      var d = document.createElement(tag);
                      if (textContent) {
                  Severity: Minor
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 1 day 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 webViewerPageRendered(evt) {
                    var pageNumber = evt.pageNumber;
                    var pageIndex = pageNumber - 1;
                    var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
                    if (pageNumber === PDFViewerApplication.page) {
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 2018..2040

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

                  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 webViewerPageRendered(evt) {
                    var pageNumber = evt.pageNumber;
                    var pageIndex = pageNumber - 1;
                    var pageView = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
                    if (pageNumber === PDFViewerApplication.page) {
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 2025..2047

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

                  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 getPDFFileNameFromURL(url) {
                    var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'document.pdf';
                  
                    if (isDataSchema(url)) {
                      console.warn('getPDFFileNameFromURL: ' + 'ignoring "data:" URL for performance reasons.');
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 354..374

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

                  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 getPDFFileNameFromURL(url) {
                    var defaultFilename = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'document.pdf';
                  
                    if (isDataSchema(url)) {
                      console.warn('getPDFFileNameFromURL: ' + 'ignoring "data:" URL for performance reasons.');
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 354..374

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

                  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

                  exports.localized = exports.animationStarted = exports.normalizeWheelEventDelta = exports.binarySearchFirstItem = exports.watchScroll = exports.scrollIntoView = exports.getOutputScale = exports.approximateFraction = exports.roundToDivide = exports.getVisibleElements = exports.parseQueryString = exports.noContextMenuHandler = exports.getPDFFileNameFromURL = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.mozL10n = exports.RendererType = exports.cloneObj = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = undefined;
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js on lines 94..94

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

                  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

                  exports.localized = exports.animationStarted = exports.normalizeWheelEventDelta = exports.binarySearchFirstItem = exports.watchScroll = exports.scrollIntoView = exports.getOutputScale = exports.approximateFraction = exports.roundToDivide = exports.getVisibleElements = exports.parseQueryString = exports.noContextMenuHandler = exports.getPDFFileNameFromURL = exports.ProgressBar = exports.EventBus = exports.NullL10n = exports.mozL10n = exports.RendererType = exports.cloneObj = exports.VERTICAL_PADDING = exports.SCROLLBAR_PADDING = exports.MAX_AUTO_SCALE = exports.UNKNOWN_SCALE = exports.MAX_SCALE = exports.MIN_SCALE = exports.DEFAULT_SCALE = exports.DEFAULT_SCALE_VALUE = exports.CSS_UNITS = undefined;
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/viewer.js and 1 other location - About 1 day to fix
                  cmis_web/static/lib/pdfjs-1.9.426/web/odoo-viewer.js on lines 94..94

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

                  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

                  File debugger.js has 562 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* Copyright 2012 Mozilla Foundation
                   *
                   * Licensed under the Apache License, Version 2.0 (the "License");
                   * you may not use this file except in compliance with the License.
                   * You may obtain a copy of the License at
                  Severity: Major
                  Found in cmis_web/static/lib/pdfjs-1.9.426/web/debugger.js - About 1 day to fix
                    Severity
                    Category
                    Status
                    Source
                    Language