MatteoRagni/cas-rb

View on GitHub
docs/js/searcher.js

Summary

Maintainability
D
2 days
Test Coverage

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

Searcher.prototype = new function() {
  // search is performed in chunks of 1000 for non-blocking user input
  var CHUNK_SIZE = 1000;
  // do not try to find more than 100 results
  var MAX_RESULTS = 100;
Severity: Minor
Found in docs/js/searcher.js - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function prototype has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Searcher.prototype = new function() {
  // search is performed in chunks of 1000 for non-blocking user input
  var CHUNK_SIZE = 1000;
  // do not try to find more than 100 results
  var MAX_RESULTS = 100;
Severity: Major
Found in docs/js/searcher.js - About 6 hrs to fix

    Function performSearch has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function performSearch(data, regexps, queries, highlighters, state) {
        var searchIndex = data.searchIndex;
        var longSearchIndex = data.longSearchIndex;
        var info = data.info;
        var result = [];
    Severity: Minor
    Found in docs/js/searcher.js - About 1 hr to fix

      Function performSearch has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        function performSearch(data, regexps, queries, highlighters, state) {
      Severity: Minor
      Found in docs/js/searcher.js - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status