ahmadnassri/httpsnippet

View on GitHub

Showing 52 of 282 total issues

Function convert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ uriObj, method: rawMethod, fullUrl, postData, allHeaders }, options = {}) => {
    const { insecureSkipVerify = false } = options;

    const { push, blank, join } = new CodeBuilder();

Severity: Minor
Found in src/targets/ruby/native/client.ts - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function concatValues has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  concatType: 'array' | 'object',
  values: any,
  pretty: boolean,
  indentation: string,
  indentLevel: number,
Severity: Minor
Found in src/targets/python/helpers.ts - About 35 mins 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

                  Function convert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    convert: ({ method, fullUrl, uriObj, httpVersion, allHeaders, postData }, options) => {
                      const opts = {
                        absoluteURI: false,
                        autoContentLength: true,
                        autoHost: true,
                  Severity: Minor
                  Found in src/targets/http/http1.1/client.ts - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function concatValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function concatValues(
                    concatType: 'array' | 'object',
                    values: any,
                    pretty: boolean,
                    indentation: string,
                  Severity: Minor
                  Found in src/targets/python/helpers.ts - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function convert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    convert: ({ fullUrl, allHeaders, postData, method }, options) => {
                      const opts = {
                        indent: '  ',
                        ...options,
                      };
                  Severity: Minor
                  Found in src/targets/ocaml/cohttp/client.ts - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language