adobe/brackets

View on GitHub
src/utils/StringMatch.js

Summary

Maintainability
F
3 days
Test Coverage

File StringMatch.js has 484 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
Severity: Minor
Found in src/utils/StringMatch.js - About 7 hrs to fix

    Function _computeRangesAndScore has 128 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _computeRangesAndScore(matchList, str, lastSegmentStart) {
            var matchCounter;
            var ranges = [];
            var lastMatchIndex = -1;
            var lastSegmentScore = 0;
    Severity: Major
    Found in src/utils/StringMatch.js - About 5 hrs to fix

      Function _generateMatchList has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _generateMatchList(query, str, originalQuery, originalStr, specials, startingSpecial) {
              var result = [];
      
              // used to keep track of which special character we're testing now
              var specialsCounter = startingSpecial;
      Severity: Major
      Found in src/utils/StringMatch.js - About 3 hrs to fix

        Function addMatch has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function addMatch(match) {
                    // Pull off the character index
                    var c = match.index;
                    var newPoints = 0;
        
        
        Severity: Major
        Found in src/utils/StringMatch.js - About 2 hrs to fix

          Function stringMatch has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function stringMatch(str, query, options, special) {
                  var result;
          
                  options = options || {};
          
          
          Severity: Minor
          Found in src/utils/StringMatch.js - About 1 hr to fix

            Function multiFieldSort has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function multiFieldSort(searchResults, fieldSpec) {
                    // Move field names into an array, with primary field first
                    var comparisons;
                    if (Array.isArray(fieldSpec)) {
                        comparisons = fieldSpec;
            Severity: Minor
            Found in src/utils/StringMatch.js - About 1 hr to fix

              Function findSpecialCharacters has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function findSpecialCharacters(str) {
                      var i, c;
              
                      // the beginning of the string is always special
                      var specials = [0];
              Severity: Minor
              Found in src/utils/StringMatch.js - About 1 hr to fix

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

                    function _lastSegmentSearch(query, str, originalQuery, originalStr, specials, startingSpecial, lastSegmentStart) {
                        var queryCounter, matchList;
                
                        // It's possible that the query is longer than the last segment.
                        // If so, we can chop off the bit that we know couldn't possibly be there.
                Severity: Minor
                Found in src/utils/StringMatch.js - About 1 hr to fix

                  Function _lastSegmentSearch has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function _lastSegmentSearch(query, str, originalQuery, originalStr, specials, startingSpecial, lastSegmentStart) {
                  Severity: Major
                  Found in src/utils/StringMatch.js - About 50 mins to fix

                    Function _generateMatchList has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function _generateMatchList(query, str, originalQuery, originalStr, specials, startingSpecial) {
                    Severity: Minor
                    Found in src/utils/StringMatch.js - About 45 mins to fix

                      Function _wholeStringSearch has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function _wholeStringSearch(queryLower, compareLower, originalQuery, originalStr, specials, lastSegmentSpecialsIndex) {
                      Severity: Minor
                      Found in src/utils/StringMatch.js - About 45 mins to fix

                        There are no issues that match your filters.

                        Category
                        Status