XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/js/vendor/bootstrap-modal.js

Summary

Maintainability
F
4 days
Test Coverage

Function Modal has 349 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function () {
    function Modal(element, config) {
      this._config = this._getConfig(config);
      this._element = element;
      this._dialog = element.querySelector(Selector.DIALOG);
Severity: Major
Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 day to fix

    File bootstrap-modal.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
      * Bootstrap modal.js v4.3.1 (https://getbootstrap.com/)
      * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
      * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
      */
    Severity: Minor
    Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 7 hrs to fix

      Function _showBackdrop has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _proto._showBackdrop = function _showBackdrop(callback) {
            var _this8 = this;
      
            var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
      
      
      Severity: Major
      Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 2 hrs to fix

        Function _showElement has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _proto._showElement = function _showElement(relatedTarget) {
              var _this3 = this;
        
              var transition = $(this._element).hasClass(ClassName.FADE);
        
        
        Severity: Minor
        Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 hr to fix

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

              _proto.show = function show(relatedTarget) {
                var _this = this;
          
                if (this._isShown || this._isTransitioning) {
                  return;
          Severity: Minor
          Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 hr to fix

            Function hide has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _proto.hide = function hide(event) {
                  var _this2 = this;
            
                  if (event) {
                    event.preventDefault();
            Severity: Minor
            Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 hr to fix

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

                      $(fixedContent).each(function (index, element) {
                        var actualPadding = element.style.paddingRight;
                        var calculatedPadding = $(element).css('padding-right');
                        $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
                      }); // Adjust sticky content margin
              Severity: Major
              Found in phpsysinfo/js/vendor/bootstrap-modal.js and 1 other location - About 3 hrs to fix
              phpsysinfo/js/vendor/bootstrap-modal.js on lines 510..514

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

              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

                      $(stickyContent).each(function (index, element) {
                        var actualMargin = element.style.marginRight;
                        var calculatedMargin = $(element).css('margin-right');
                        $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
                      }); // Adjust body padding
              Severity: Major
              Found in phpsysinfo/js/vendor/bootstrap-modal.js and 1 other location - About 3 hrs to fix
              phpsysinfo/js/vendor/bootstrap-modal.js on lines 504..508

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

              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

                      if ($(this._element).hasClass(ClassName.FADE)) {
                        var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
              
                        $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
                      } else {
              Severity: Major
              Found in phpsysinfo/js/vendor/bootstrap-modal.js and 1 other location - About 1 hr to fix
              phpsysinfo/js/vendor/bootstrap-modal.js on lines 321..326

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

              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

                    if (transition) {
                      var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
                      $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
                    } else {
                      transitionComplete();
              Severity: Major
              Found in phpsysinfo/js/vendor/bootstrap-modal.js and 1 other location - About 1 hr to fix
              phpsysinfo/js/vendor/bootstrap-modal.js on lines 456..462

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

              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

              There are no issues that match your filters.

              Category
              Status