d11n/uri-query

View on GitHub

Showing 5 of 9 total issues

Function parse_query_string has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function parse_query_string(query_string) {
        const query_object = {};
        const query_pairs = query_string.split(/&+/);
        for (const pair of query_pairs) {
            let separator_index = pair.indexOf('=');
Severity: Major
Found in source/strategies/default.js - About 4 hrs to fix

    Function compose_query_string has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function compose_query_string(query_params) {
            if (!query_params || 'object' !== typeof query_params) {
                return '';
            }
            let uri_query = '';
    Severity: Major
    Found in source/strategies/default.js - About 2 hrs to fix

      Function add_composite_value has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function add_composite_value(key, value) {
                  const path_keys = get_path_keys(key);
                  let query_object_value = query_object;
                  for (let i = 0, n = path_keys.length - 1; i <= n; i++) {
                      const path_key = path_keys[i];
      Severity: Major
      Found in source/strategies/default.js - About 2 hrs to fix

        Function get_path_keys has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function get_path_keys(path_string) {
                    const path_keys = [];
                    let unparsed_path = path_string;
                    while (unparsed_path) {
                        const open_brack_i = unparsed_path.indexOf('[');
        Severity: Minor
        Found in source/strategies/default.js - About 1 hr to fix

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

              function parse_query_params(query_params) {
                  if (query_params instanceof Set) {
                      return new Set(parse_query_params(Array.from(query_params)));
                  }
                  const query_object = Array.isArray(query_params) ? [] : {};
          Severity: Minor
          Found in source/strategies/default.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language