okcashpro/okshop

View on GitHub
shop/static/shop/selecttoautocomplete.js

Summary

Maintainability
C
1 day
Test Coverage

Function jquery_ui has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    jquery_ui: function( context ) {
      // loose matching of search terms
      var filter_options = function( term ) {
        var split_term = term.split(' ');
        var matchers = [];
Severity: Major
Found in shop/static/shop/selecttoautocomplete.js - About 3 hrs to fix

    Function extract_options has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        extract_options: function( $select_field ) {
          var options = [];
          var $options = $select_field.find('option');
          var number_of_options = $options.length;
          
    Severity: Minor
    Found in shop/static/shop/selecttoautocomplete.js - About 1 hr to fix

      Function filter_options has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            var filter_options = function( term ) {
              var split_term = term.split(' ');
              var matchers = [];
              for (var i=0; i < split_term.length; i++) {
                if ( split_term[i].length > 0 ) {
      Severity: Minor
      Found in shop/static/shop/selecttoautocomplete.js - About 1 hr to fix

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

            insert_text_field: function( context ) {
              var $text_field = $( '<input type="text"></input>' );
              if ( settings['copy-attributes-to-text-field'] ) {
                var attrs = {};
                var raw_attrs = context.$select_field[0].attributes;
        Severity: Minor
        Found in shop/static/shop/selecttoautocomplete.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status