GinoPane/oc-blogtaxonomy-plugin

View on GitHub
assets/js/jquery.mark.js

Summary

Maintainability
A
1 hr
Test Coverage

File jquery.mark.js has 1056 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

/*!***************************************************
* mark.js v9.0.0
* https://markjs.io/
* Copyright (c) 2014–2018, Julian Kühnel
* Released under the MIT license https://git.io/vwTVl
Severity: Major
Found in assets/js/jquery.mark.js - About 2 days to fix

    Function Mark has 479 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

      function () {
        function Mark(ctx) {
          _classCallCheck(this, Mark);
    
          this.ctx = ctx;
    Severity: Major
    Found in assets/js/jquery.mark.js - About 2 days to fix

      Function DOMIterator has 320 lines of code (exceeds 25 allowed). Consider refactoring.
      Wontfix

        function () {
          function DOMIterator(ctx) {
            var iframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
            var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
            var iframesTimeout = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5000;
      Severity: Major
      Found in assets/js/jquery.mark.js - About 1 day to fix

        Function RegExpCreator has 179 lines of code (exceeds 25 allowed). Consider refactoring.
        Wontfix

          function () {
            function RegExpCreator(options) {
              _classCallCheck(this, RegExpCreator);
        
              this.opt = _extends({}, {
        Severity: Major
        Found in assets/js/jquery.mark.js - About 7 hrs to fix

          Function mark has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Wontfix

                value: function mark(sv, opt) {
                  var _this9 = this;
          
                  this.opt = opt;
                  var totalMatches = 0,
          Severity: Minor
          Found in assets/js/jquery.mark.js - About 1 hr to fix

            Function iterateThroughNodes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Wontfix

                  value: function iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) {
                    var _this5 = this;
            
                    var itr = this.createIterator(ctx, whatToShow, filterCb);
            
            
            Severity: Minor
            Found in assets/js/jquery.mark.js - About 1 hr to fix

              Function wrapRangeInMappedTextNode has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Wontfix

                    value: function wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) {
                      var _this4 = this;
              
                      dict.nodes.every(function (n, i) {
                        var sibl = dict.nodes[i + 1];
              Severity: Minor
              Found in assets/js/jquery.mark.js - About 1 hr to fix

                Function forEachIframe has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Wontfix

                      value: function forEachIframe(ctx, filter, each) {
                        var _this3 = this;
                
                        var end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
                        var ifr = ctx.querySelectorAll('iframe'),
                Severity: Minor
                Found in assets/js/jquery.mark.js - About 1 hr to fix

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

                        value: function createSynonymsRegExp(str) {
                          var _this = this;
                  
                          var syn = this.opt.synonyms,
                              sens = this.opt.caseSensitive ? '' : 'i',
                  Severity: Minor
                  Found in assets/js/jquery.mark.js - About 1 hr to fix

                    Function wrapMatches has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Wontfix

                          value: function wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
                            var _this5 = this;
                    
                            var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
                            this.getTextNodes(function (dict) {
                    Severity: Minor
                    Found in assets/js/jquery.mark.js - About 1 hr to fix

                      Function checkIframeFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Wontfix

                            value: function checkIframeFilter(node, prevNode, currIfr, ifr) {
                              var key = false,
                                  handled = false;
                              ifr.forEach(function (ifrDict, i) {
                                if (ifrDict.val === currIfr) {
                      Severity: Minor
                      Found in assets/js/jquery.mark.js - About 1 hr to fix

                        Function value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Wontfix

                              value: function wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) {
                        Severity: Minor
                        Found in assets/js/jquery.mark.js - About 35 mins to fix

                          Function value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Wontfix

                                value: function wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
                          Severity: Minor
                          Found in assets/js/jquery.mark.js - About 35 mins to fix

                            Function value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Wontfix

                                  value: function iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) {
                            Severity: Minor
                            Found in assets/js/jquery.mark.js - About 35 mins to fix

                              Function value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Wontfix

                                    value: function separateGroups(node, match, matchIdx, filterCb, eachCb) {
                              Severity: Minor
                              Found in assets/js/jquery.mark.js - About 35 mins to fix

                                Function value has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Wontfix

                                      value: function wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) {
                                Severity: Minor
                                Found in assets/js/jquery.mark.js - About 35 mins to fix

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

                                                  if (matchIdx !== 0) {
                                                    for (var i = 1; i < matchIdx; i++) {
                                                      pos += match[i].length;
                                                    }
                                                  }
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 1 other location - About 40 mins to fix
                                  assets/js/jquery.mark.js on lines 963..967

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

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

                                              if (matchIdx !== 0) {
                                                for (var i = 1; i < matchIdx; i++) {
                                                  start += match[i].length;
                                                }
                                              }
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 1 other location - About 40 mins to fix
                                  assets/js/jquery.mark.js on lines 936..940

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

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

                                    $.fn.markRanges = function (ranges, opt) {
                                      new Mark(this.get()).markRanges(ranges, opt);
                                      return this;
                                    };
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 40 mins to fix
                                  assets/js/jquery.mark.js on lines 1206..1209
                                  assets/js/jquery.mark.js on lines 1211..1214

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

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

                                    $.fn.markRegExp = function (regexp, opt) {
                                      new Mark(this.get()).markRegExp(regexp, opt);
                                      return this;
                                    };
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 40 mins to fix
                                  assets/js/jquery.mark.js on lines 1206..1209
                                  assets/js/jquery.mark.js on lines 1216..1219

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

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

                                    $.fn.mark = function (sv, opt) {
                                      new Mark(this.get()).mark(sv, opt);
                                      return this;
                                    };
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 40 mins to fix
                                  assets/js/jquery.mark.js on lines 1211..1214
                                  assets/js/jquery.mark.js on lines 1216..1219

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

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

                                              kw.split(' ').forEach(function (kwSplitted) {
                                                if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) {
                                                  stack.push(kwSplitted);
                                                }
                                              });
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 1 other location - About 35 mins to fix
                                  assets/js/jquery.mark.js on lines 690..694

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

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

                                          if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
                                            str = this.setupIgnoreJoinersRegExp(str);
                                          }
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 35 mins to fix
                                  assets/js/jquery.mark.js on lines 482..484
                                  assets/js/jquery.mark.js on lines 544..546

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

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

                                            if (!_this.opt.separateWordSearch) {
                                              if (kw.trim() && stack.indexOf(kw) === -1) {
                                                stack.push(kw);
                                              }
                                            } else {
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 1 other location - About 35 mins to fix
                                  assets/js/jquery.mark.js on lines 695..699

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

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

                                          if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
                                            str = this.createJoinersRegExp(str);
                                          }
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 35 mins to fix
                                  assets/js/jquery.mark.js on lines 472..474
                                  assets/js/jquery.mark.js on lines 544..546

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

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

                                          if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
                                            str = this.setupIgnoreJoinersRegExp(str);
                                          }
                                  Severity: Minor
                                  Found in assets/js/jquery.mark.js and 2 other locations - About 35 mins to fix
                                  assets/js/jquery.mark.js on lines 472..474
                                  assets/js/jquery.mark.js on lines 482..484

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

                                  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