Halyul/hexo-theme-mdui

View on GitHub

Showing 125 of 125 total issues

Function Promise$2 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Promise$2 = function () {
  function Promise(resolver) {
    this[PROMISE_ID] = nextId();
    this._result = this._state = undefined;
    this._subscribers = [];
Severity: Minor
Found in source/js/_files/es6-promise.js - About 1 hr to fix

    Function PrismPlugin has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

     function PrismPlugin(data) {
       // Patch for caption support
       if (captionRegex.test(data.content)) {
         // Attempt to parse the code
         data.content = data.content.replace(captionRegex, (origin, lang, caption, code) => {
    Severity: Minor
    Found in scripts/lib/prism.js - About 1 hr to fix

      Function _initBody has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this._initBody = function(body) {
            this._bodyInit = body;
            if (!body) {
              this._bodyText = '';
            } else if (typeof body === 'string') {
      Severity: Minor
      Found in source/js/_files/fetch.js - About 1 hr to fix

        Function actualSize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  var actualSize = function actualSize(event, image, index, fromIcon) {
                    var w = image.clientWidth;
                    var nw;
                    if (_this.core.s.dynamic) {
                      nw = _this.core.s.dynamicEl[index].width || image.naturalWidth || w;
        Severity: Minor
        Found in source/js/_files/lg-zoom.js - About 1 hr to fix

          Function all has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Promise.all = function (arr) {
                  var args = Array.prototype.slice.call(arr);
              
                  return new Promise(function (resolve, reject) {
                    if (args.length === 0) return resolve([]);
          Severity: Minor
          Found in source/js/_files/barba.js - About 1 hr to fix

            Function off has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    off: function off(el, event) {
                        if (!el) {
                            return;
                        }
            
            
            Severity: Minor
            Found in source/js/_files/lightgallery.js - About 1 hr to fix

              Function touchEnd has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Plugin.prototype.touchEnd = function (distance) {
                      var _this = this;
              
                      // keep slide animation for any mode while dragg/swipe
                      if (_this.s.mode !== 'lg-slide') {
              Severity: Minor
              Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                            if (allowX) {
                              _el.setAttribute('data-x', Math.abs(distanceX));
                            } else {
                              distanceX = -Math.abs(_el.getAttribute('data-x'));
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 571..575

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

                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 (allowY) {
                              _el.setAttribute('data-y', Math.abs(distanceY));
                            } else {
                              distanceY = -Math.abs(_el.getAttribute('data-y'));
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 577..581

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

                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 if (_next) {
                
                                    // next slide
                                    _lgUtils2.default.addClass(this.___slide[index], 'lg-next-slide');
                                    _lgUtils2.default.addClass(this.___slide[_prevIndex], 'lg-prev-slide');
                Severity: Minor
                Found in source/js/_files/lightgallery.js and 1 other location - About 55 mins to fix
                source/js/_files/lightgallery.js on lines 1046..1056

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

                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

                                if (Math.abs(endCoords.x - startCoords.x) > 15 || Math.abs(endCoords.y - startCoords.y) > 15) {
                
                                  if (_this.core.s.useLeftForZoom) {
                                    _el.style.left = distanceX + 'px';
                                    _el.style.top = distanceY + 'px';
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 55 mins to fix
                source/js/_files/lg-zoom.js on lines 554..589

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

                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

                          if (Math.abs(endCoords.x - startCoords.x) > 15 || Math.abs(endCoords.y - startCoords.y) > 15) {
                            if (allowY) {
                              if (distanceY <= -maxY) {
                                distanceY = -maxY;
                              } else if (distanceY >= -minY) {
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 55 mins to fix
                source/js/_files/lg-zoom.js on lines 409..417

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

                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 (_prev) {
                
                                    //prevslide
                                    _lgUtils2.default.addClass(this.___slide[index], 'lg-prev-slide');
                                    _lgUtils2.default.addClass(this.___slide[_prevIndex], 'lg-next-slide');
                Severity: Minor
                Found in source/js/_files/lightgallery.js and 1 other location - About 55 mins to fix
                source/js/_files/lightgallery.js on lines 1051..1056

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

                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 getProperty has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                function getProperty(obj, name){
                    name = name.replace(/\[(\w+)\]/g, '.$1').replace(/^\./, '');
                
                    var split = name.split('.');
                    var key = split.shift();
                Severity: Minor
                Found in scripts/lib/style_renderer.js - About 55 mins 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

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

                            if (allowY) {
                              if (distanceY <= -maxY) {
                                distanceY = -maxY;
                              } else if (distanceY >= -minY) {
                                distanceY = -minY;
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 50 mins to fix
                source/js/_files/lg-zoom.js on lines 563..569

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

                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 (allowX) {
                              if (distanceX <= -maxX) {
                                distanceX = -maxX;
                              } else if (distanceX >= -minX) {
                                distanceX = -minX;
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 50 mins to fix
                source/js/_files/lg-zoom.js on lines 555..561

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

                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

                        try {
                            if (typeof clearTimeout === 'function') {
                                cachedClearTimeout = clearTimeout;
                            } else {
                                cachedClearTimeout = defaultClearTimeout;
                Severity: Minor
                Found in source/js/_files/barba.js and 1 other location - About 50 mins to fix
                source/js/_files/barba.js on lines 588..596

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

                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

                        try {
                            if (typeof setTimeout === 'function') {
                                cachedSetTimeout = setTimeout;
                            } else {
                                cachedSetTimeout = defaultSetTimout;
                Severity: Minor
                Found in source/js/_files/barba.js and 1 other location - About 50 mins to fix
                source/js/_files/barba.js on lines 597..605

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

                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

                            if (!_lgUtils2.default.hasClass(document.body, 'lg-on')) {
                                _lgUtils2.default.addClass(document.body, 'lg-on');
                                setTimeout(function () {
                                    _this.build(_this.index);
                                });
                Severity: Minor
                Found in source/js/_files/lightgallery.js and 1 other location - About 50 mins to fix
                source/js/_files/lightgallery.js on lines 393..398

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

                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

                            if (!_lgUtils2.default.hasClass(document.body, 'lg-on')) {
                                _lgUtils2.default.addClass(document.body, 'lg-on');
                                setTimeout(function () {
                                    _this.build(_this.index);
                                });
                Severity: Minor
                Found in source/js/_files/lightgallery.js and 1 other location - About 50 mins to fix
                source/js/_files/lightgallery.js on lines 408..413

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

                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