Halyul/hexo-theme-mdui

View on GitHub

Showing 125 of 125 total issues

Function SmoothScroll has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var SmoothScroll = function (selector, options) {

        //
        // Variables
        //
Severity: Major
Found in source/js/_files/smooth-scroll.js - About 4 hrs to fix

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

            var _extends = Object.assign || function(target) {
              for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i];
    
                for (var key in source) {
    Severity: Major
    Found in source/js/_files/lg-autoplay.js and 2 other locations - About 3 hrs to fix
    source/js/_files/lg-fullscreen.js on lines 67..79
    source/js/_files/lg-zoom.js on lines 67..79

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

    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 3 locations. Consider refactoring.
    Open

            var _extends = Object.assign || function(target) {
              for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i];
    
                for (var key in source) {
    Severity: Major
    Found in source/js/_files/lg-fullscreen.js and 2 other locations - About 3 hrs to fix
    source/js/_files/lg-autoplay.js on lines 67..79
    source/js/_files/lg-zoom.js on lines 67..79

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

    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 3 locations. Consider refactoring.
    Open

            var _extends = Object.assign || function(target) {
              for (var i = 1; i < arguments.length; i++) {
                var source = arguments[i];
    
                for (var key in source) {
    Severity: Major
    Found in source/js/_files/lg-zoom.js and 2 other locations - About 3 hrs to fix
    source/js/_files/lg-autoplay.js on lines 67..79
    source/js/_files/lg-fullscreen.js on lines 67..79

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

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

        1: [function(require, module, exports) {
          (function(global, factory) {
            if (typeof define === "function" && define.amd) {
              define([], factory);
            } else if (typeof exports !== "undefined") {
    Severity: Major
    Found in source/js/_files/lg-fullscreen.js - About 3 hrs to fix

      Function Body has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function Body() {
          this.bodyUsed = false;
      
          this._initBody = function(body) {
            this._bodyInit = body;
      Severity: Major
      Found in source/js/_files/fetch.js - About 3 hrs to fix

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

              (function(global, factory) {
                if (typeof define === "function" && define.amd) {
                  define([], factory);
                } else if (typeof exports !== "undefined") {
                  factory();
        Severity: Major
        Found in source/js/_files/lg-zoom.js and 2 other locations - About 3 hrs to fix
        source/js/_files/lg-autoplay.js on lines 52..258
        source/js/_files/lg-fullscreen.js on lines 52..167

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

        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 3 locations. Consider refactoring.
        Open

              (function(global, factory) {
                if (typeof define === "function" && define.amd) {
                  define([], factory);
                } else if (typeof exports !== "undefined") {
                  factory();
        Severity: Major
        Found in source/js/_files/lg-fullscreen.js and 2 other locations - About 3 hrs to fix
        source/js/_files/lg-autoplay.js on lines 52..258
        source/js/_files/lg-zoom.js on lines 52..610

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

        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 3 locations. Consider refactoring.
        Open

              (function(global, factory) {
                if (typeof define === "function" && define.amd) {
                  define([], factory);
                } else if (typeof exports !== "undefined") {
                  factory();
        Severity: Major
        Found in source/js/_files/lg-autoplay.js and 2 other locations - About 3 hrs to fix
        source/js/_files/lg-fullscreen.js on lines 52..167
        source/js/_files/lg-zoom.js on lines 52..610

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

        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

          var collapseItem = function (item) {
            var parent = item.parentNode;
            if (parent.classList.contains('mdui-collapse-item-body')) {
              var collapseEl = document.querySelector('.mdui-collapse')
              var collapse = mdui.Collapse(collapseEl);
        Severity: Major
        Found in source/js/_files/js.pure.js and 1 other location - About 3 hrs to fix
        source/js/_files/js.barba.js on lines 213..221

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

        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

          var collapseItem = function (item) {
            var parent = item.parentNode;
            if (parent.classList.contains('mdui-collapse-item-body')) {
              var collapseEl = document.querySelector('.mdui-collapse')
              var collapse = mdui.Collapse(collapseEl);
        Severity: Major
        Found in source/js/_files/js.barba.js and 1 other location - About 3 hrs to fix
        source/js/_files/js.pure.js on lines 12..20

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

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

        var Enumerator = function () {
          function Enumerator(Constructor, input) {
            this._instanceConstructor = Constructor;
            this.promise = new Constructor(noop);
        
        
        Severity: Major
        Found in source/js/_files/es6-promise.js - About 2 hrs to fix

          Function zoomDrag has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  Zoom.prototype.zoomDrag = function() {
          
                    var _this = this;
                    var startCoords = {};
                    var endCoords = {};
          Severity: Major
          Found in source/js/_files/lg-zoom.js - About 2 hrs to fix

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

                          if (_this.core.s.useLeftForZoom) {
                            _el.style.left = distanceX + 'px';
                            _el.style.top = distanceY + 'px';
                          } else {
                            utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
            Severity: Major
            Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
            source/js/_files/lg-zoom.js on lines 411..416
            source/js/_files/lg-zoom.js on lines 583..588

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

            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 3 locations. Consider refactoring.
            Open

                              if (_this.core.s.useLeftForZoom) {
                                _el.style.left = distanceX + 'px';
                                _el.style.top = distanceY + 'px';
                              } else {
                                utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
            Severity: Major
            Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
            source/js/_files/lg-zoom.js on lines 510..515
            source/js/_files/lg-zoom.js on lines 583..588

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

            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 3 locations. Consider refactoring.
            Open

                        if (_this.core.s.useLeftForZoom) {
                          _el.style.left = distanceX + 'px';
                          _el.style.top = distanceY + 'px';
                        } else {
                          utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
            Severity: Major
            Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
            source/js/_files/lg-zoom.js on lines 411..416
            source/js/_files/lg-zoom.js on lines 510..515

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

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

                    Zoom.prototype.zoomSwipe = function() {
                      var _this = this;
                      var startCoords = {};
                      var endCoords = {};
                      var isMoved = false;
            Severity: Major
            Found in source/js/_files/lg-zoom.js - About 2 hrs to fix

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

                        if (document.exitFullscreen) {
                          document.exitFullscreen();
                        } else if (document.msExitFullscreen) {
                          document.msExitFullscreen();
                        } else if (document.mozCancelFullScreen) {
              Severity: Major
              Found in source/js/_files/lg-fullscreen.js and 1 other location - About 2 hrs to fix
              source/js/_files/lg-fullscreen.js on lines 114..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 87.

              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 (el.requestFullscreen) {
                          el.requestFullscreen();
                        } else if (el.msRequestFullscreen) {
                          el.msRequestFullscreen();
                        } else if (el.mozRequestFullScreen) {
              Severity: Major
              Found in source/js/_files/lg-fullscreen.js and 1 other location - About 2 hrs to fix
              source/js/_files/lg-fullscreen.js on lines 126..134

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

              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

                                      } else {
                                          el.removeEventListener(_event.split('.')[0], utils.Listener[_event]);
                                          el.setAttribute('lg-event-uid', el.getAttribute('lg-event-uid').replace('&' + _id[i], ''));
                                          delete utils.Listener[_event];
                                      }
              Severity: Major
              Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
              source/js/_files/lightgallery.js on lines 151..155

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

              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