analog-nico/pathjs-amd

View on GitHub
src/path.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function match has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Path.match = function (path, parameterize) {
        var params = {}, route = null, possible_routes, slice, i, j, compare;
        for (route in Path.routes.defined) {
            if (route !== null && route !== undefined) {
                route = Path.routes.defined[route];
Severity: Minor
Found in src/path.js - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                            if (parameterize) {
                                route.params = params;
                            }
    Severity: Major
    Found in src/path.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              for (i = 0; i < slice.split("/").length; i+=1) {
                                  if ((i < compare.split("/").length) && (slice.split("/")[i].charAt(0) === ":")) {
                                      params[slice.split('/')[i].replace(/:/, '')] = compare.split("/")[i];
                                      compare = compare.replace(compare.split("/")[i], slice.split("/")[i]);
                                  }
      Severity: Major
      Found in src/path.js - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status