ahmadnassri/httpsnippet

View on GitHub
src/helpers/escape.ts

Summary

Maintainability
B
4 hrs
Test Coverage

Function escapeString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function escapeString(rawValue: any, options: EscapeOptions = {}) {
  const {
    delimiter = '"',
    escapeChar = '\\',
    escapeNewlines = true
Severity: Minor
Found in src/helpers/escape.ts - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

          return escapeChar + 'f';
    Severity: Major
    Found in src/helpers/escape.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return escapeChar + 'r';
      Severity: Major
      Found in src/helpers/escape.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return c; // Don't just continue, or this is caught by < \u0020
        Severity: Major
        Found in src/helpers/escape.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return JSON.stringify(c).slice(1, -1);
          Severity: Major
          Found in src/helpers/escape.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return escapeChar + escapeChar;
            Severity: Major
            Found in src/helpers/escape.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return c;
              Severity: Major
              Found in src/helpers/escape.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return escapeChar + delimiter;
                Severity: Major
                Found in src/helpers/escape.ts - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status