ahmadnassri/httpsnippet

View on GitHub

Showing 52 of 282 total issues

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

  convert: ({ queryObj, url, postData, allHeaders, method }, options) => {
    const opts = {
      indent: '    ',
      pretty: true,
      ...options,
Severity: Minor
Found in src/targets/python/requests/client.ts - About 6 hrs 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 42 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ fullUrl, method, httpVersion, headersObj, allHeaders, postData }, options = {}) => {
    const {
      binary = false,
      globOff = false,
      indent = '  ',
Severity: Minor
Found in src/targets/shell/curl/client.ts - About 6 hrs 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 31 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }, options) => {
    const opts = {
      body: false,
      cert: false,
      headers: false,
Severity: Minor
Found in src/targets/shell/httpie/client.ts - About 4 hrs 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 28 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
    const opts = {
      closingTag: false,
      indent: '  ',
      noTags: false,
Severity: Minor
Found in src/targets/php/guzzle/client.ts - About 4 hrs 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 27 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ postData, headersObj, method, queryObj, cookiesObj, url }, options = {}) => {
    const { closingTag = false, indent = '  ', noTags = false, shortTags = false } = options;

    const { push, blank, join } = new CodeBuilder({ indent });
    let hasBody = false;
Severity: Minor
Found in src/targets/php/http2/client.ts - About 3 hrs 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 27 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ postData, method, allHeaders, fullUrl }, options = {}) => {
    const { blank, push, join } = new CodeBuilder({ indent: '\t' });

    const {
      showBoilerplate = true,
Severity: Minor
Found in src/targets/go/native/client.ts - About 3 hrs 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 23 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ queryObj, method, postData, url, allHeaders }, options) => {
    const { push, join } = new CodeBuilder({ indent: options?.indent });
    const methods = ['get', 'post', 'put', 'delete', 'patch', 'head', 'options'];
    method = method.toLowerCase();

Severity: Minor
Found in src/targets/clojure/clj_http/client.ts - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ uriObj: { path, protocol, host }, postData, allHeaders, method }, options = {}) => {
    const { insecureSkipVerify = false } = options;

    const { push, blank, join } = new CodeBuilder();
    // Start Request
Severity: Minor
Found in src/targets/python/python3/client.ts - About 3 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ method, fullUrl, postData, headersObj, cookies }, options) => {
    const opts = {
      indent: '  ',
      ...options,
    };
Severity: Minor
Found in src/targets/node/fetch/client.ts - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ method, allHeaders, postData, fullUrl }, inputOpts) => {
    const opts = {
      indent: '  ',
      credentials: null,
      ...inputOpts,
Severity: Minor
Found in src/targets/javascript/fetch/client.ts - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ allHeaders, postData, method, fullUrl }, options) => {
    const opts = {
      indent: '    ',
      ...options,
    };
Severity: Minor
Found in src/targets/csharp/httpclient/client.ts - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ fullUrl, method, allHeaders, postData }, options) => {
    const opts = {
      indent: '  ',
      ...options,
    };
Severity: Minor
Found in src/targets/javascript/jquery/client.ts - About 2 hrs 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 15 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ allHeaders, postData, method, fullUrl }, options) => {
    const opts = {
      indent: '    ',
      pretty: true,
      timeout: 10,
Severity: Minor
Found in src/targets/objc/nsurlsession/client.ts - About 1 hr 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 15 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ postData, allHeaders, method, fullUrl }, options) => {
    const opts = {
      indent: '  ',
      cors: true,
      ...options,
Severity: Minor
Found in src/targets/javascript/xhr/client.ts - About 1 hr 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 literalRepresentation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

export const literalRepresentation = (
  value: any,
  opts: Record<string, any>,
  indentLevel?: number,
): any => {
Severity: Minor
Found in src/targets/python/helpers.ts - About 1 hr 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 15 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ url, queryObj, queryString, postData, allHeaders, method }, options = {}) => {
    // Start snippet
    const { push, blank, join } = new CodeBuilder({
      indent: options.indent ?? '  ',
    });
Severity: Minor
Found in src/targets/r/httr/client.ts - About 1 hr 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 generatePowershellConvert has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const generatePowershellConvert = (command: PowershellCommand) => {
  const convert: Converter<any> = ({
    method,
    headersObj,
    cookies,
Severity: Minor
Found in src/targets/powershell/common.ts - About 1 hr to fix

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

      convert: ({ method, url, postData, queryObj, headersObj, cookiesObj }, options = {}) => {
        const { closingTag = false, indent = '  ', noTags = false, shortTags = false } = options;
    
        const { push, blank, join } = new CodeBuilder({ indent });
    
    
    Severity: Minor
    Found in src/targets/php/http1/client.ts - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
    Open

      convert: ({ allHeaders, postData, fullUrl, method }, options) => {
        const opts = {
          indent: '  ',
          pretty: true,
          timeout: '10',
    Severity: Minor
    Found in src/targets/swift/nsurlsession/client.ts - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
    Open

      convert: ({ method, url, cookies, queryObj, postData, headersObj }, options) => {
        const opts = {
          indent: '  ',
          ...options,
        };
    Severity: Minor
    Found in src/targets/node/unirest/client.ts - About 1 hr 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