ahmadnassri/httpsnippet

View on GitHub

Showing 282 of 282 total issues

Identical blocks of code found in 17 locations. Consider refactoring.
Open

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
Severity: Major
Found in src/targets/node/unirest/fixtures/jsonObj-null-value.js and 16 other locations - About 50 mins to fix
src/targets/node/unirest/fixtures/application-form-encoded.js on lines 14..18
src/targets/node/unirest/fixtures/application-json.js on lines 31..35
src/targets/node/unirest/fixtures/cookies.js on lines 10..14
src/targets/node/unirest/fixtures/custom-method.js on lines 5..9
src/targets/node/unirest/fixtures/full.js on lines 28..32
src/targets/node/unirest/fixtures/headers.js on lines 11..15
src/targets/node/unirest/fixtures/https.js on lines 5..9
src/targets/node/unirest/fixtures/jsonObj-multiline.js on lines 14..18
src/targets/node/unirest/fixtures/multipart-data.js on lines 19..23
src/targets/node/unirest/fixtures/multipart-file.js on lines 17..21
src/targets/node/unirest/fixtures/multipart-form-data-no-params.js on lines 9..13
src/targets/node/unirest/fixtures/multipart-form-data.js on lines 15..19
src/targets/node/unirest/fixtures/nested.js on lines 11..15
src/targets/node/unirest/fixtures/query.js on lines 14..18
src/targets/node/unirest/fixtures/short.js on lines 5..9
src/targets/node/unirest/fixtures/text-plain.js on lines 11..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 17 locations. Consider refactoring.
Open

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
Severity: Major
Found in src/targets/node/unirest/fixtures/cookies.js and 16 other locations - About 50 mins to fix
src/targets/node/unirest/fixtures/application-form-encoded.js on lines 14..18
src/targets/node/unirest/fixtures/application-json.js on lines 31..35
src/targets/node/unirest/fixtures/custom-method.js on lines 5..9
src/targets/node/unirest/fixtures/full.js on lines 28..32
src/targets/node/unirest/fixtures/headers.js on lines 11..15
src/targets/node/unirest/fixtures/https.js on lines 5..9
src/targets/node/unirest/fixtures/jsonObj-multiline.js on lines 14..18
src/targets/node/unirest/fixtures/jsonObj-null-value.js on lines 14..18
src/targets/node/unirest/fixtures/multipart-data.js on lines 19..23
src/targets/node/unirest/fixtures/multipart-file.js on lines 17..21
src/targets/node/unirest/fixtures/multipart-form-data-no-params.js on lines 9..13
src/targets/node/unirest/fixtures/multipart-form-data.js on lines 15..19
src/targets/node/unirest/fixtures/nested.js on lines 11..15
src/targets/node/unirest/fixtures/query.js on lines 14..18
src/targets/node/unirest/fixtures/short.js on lines 5..9
src/targets/node/unirest/fixtures/text-plain.js on lines 11..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 17 locations. Consider refactoring.
Open

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
Severity: Major
Found in src/targets/node/unirest/fixtures/application-form-encoded.js and 16 other locations - About 50 mins to fix
src/targets/node/unirest/fixtures/application-json.js on lines 31..35
src/targets/node/unirest/fixtures/cookies.js on lines 10..14
src/targets/node/unirest/fixtures/custom-method.js on lines 5..9
src/targets/node/unirest/fixtures/full.js on lines 28..32
src/targets/node/unirest/fixtures/headers.js on lines 11..15
src/targets/node/unirest/fixtures/https.js on lines 5..9
src/targets/node/unirest/fixtures/jsonObj-multiline.js on lines 14..18
src/targets/node/unirest/fixtures/jsonObj-null-value.js on lines 14..18
src/targets/node/unirest/fixtures/multipart-data.js on lines 19..23
src/targets/node/unirest/fixtures/multipart-file.js on lines 17..21
src/targets/node/unirest/fixtures/multipart-form-data-no-params.js on lines 9..13
src/targets/node/unirest/fixtures/multipart-form-data.js on lines 15..19
src/targets/node/unirest/fixtures/nested.js on lines 11..15
src/targets/node/unirest/fixtures/query.js on lines 14..18
src/targets/node/unirest/fixtures/short.js on lines 5..9
src/targets/node/unirest/fixtures/text-plain.js on lines 11..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 17 locations. Consider refactoring.
Open

req.end(function (res) {
  if (res.error) throw new Error(res.error);

  console.log(res.body);
});
Severity: Major
Found in src/targets/node/unirest/fixtures/custom-method.js and 16 other locations - About 50 mins to fix
src/targets/node/unirest/fixtures/application-form-encoded.js on lines 14..18
src/targets/node/unirest/fixtures/application-json.js on lines 31..35
src/targets/node/unirest/fixtures/cookies.js on lines 10..14
src/targets/node/unirest/fixtures/full.js on lines 28..32
src/targets/node/unirest/fixtures/headers.js on lines 11..15
src/targets/node/unirest/fixtures/https.js on lines 5..9
src/targets/node/unirest/fixtures/jsonObj-multiline.js on lines 14..18
src/targets/node/unirest/fixtures/jsonObj-null-value.js on lines 14..18
src/targets/node/unirest/fixtures/multipart-data.js on lines 19..23
src/targets/node/unirest/fixtures/multipart-file.js on lines 17..21
src/targets/node/unirest/fixtures/multipart-form-data-no-params.js on lines 9..13
src/targets/node/unirest/fixtures/multipart-form-data.js on lines 15..19
src/targets/node/unirest/fixtures/nested.js on lines 11..15
src/targets/node/unirest/fixtures/query.js on lines 14..18
src/targets/node/unirest/fixtures/short.js on lines 5..9
src/targets/node/unirest/fixtures/text-plain.js on lines 11..15

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    if (headerCount === 1) {
      for (const header in headers) {
        push(`headers = { '${header}': "${escapeForDoubleQuotes(headers[header])}" }`);
        blank();
      }
Severity: Minor
Found in src/targets/python/python3/client.ts and 1 other location - About 50 mins to fix
src/targets/python/requests/client.ts on lines 132..153

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    } else if (headerCount === 1) {
      for (const header in headers) {
        push(`headers = {"${header}": "${escapeForDoubleQuotes(headers[header])}"}`);
        blank();
      }
Severity: Minor
Found in src/targets/python/requests/client.ts and 1 other location - About 50 mins to fix
src/targets/python/python3/client.ts on lines 57..77

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function generatePowershellConvert has a Cognitive Complexity of 8 (exceeds 5 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 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 convert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  convert: ({ uriObj, method, allHeaders, postData }, options = {}) => {
    const { indent = '  ', insecureSkipVerify = false } = options;
    const { blank, join, push, unshift } = new CodeBuilder({ indent });

    const reqOpts = {
Severity: Minor
Found in src/targets/node/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

Avoid deeply nested control flow statements.
Open

              if (headerName) {
                delete headersObj[headerName];
              }
Severity: Major
Found in src/targets/php/guzzle/client.ts - About 45 mins to fix

    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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        const { push, join, unshift } = new CodeBuilder({
          indent: opts.indent,
          // @ts-expect-error SEEMS LEGIT
          join: opts.indent !== false ? ` \\\n${opts.indent}` : ' ',
        });
    Severity: Minor
    Found in src/targets/shell/httpie/client.ts and 1 other location - About 45 mins to fix
    src/targets/shell/wget/client.ts on lines 35..39

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 50.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        const { push, join } = new CodeBuilder({
          indent: opts.indent,
          // @ts-expect-error SEEMS LEGIT
          join: opts.indent !== false ? ` \\\n${opts.indent}` : ' ',
        });
    Severity: Minor
    Found in src/targets/shell/wget/client.ts and 1 other location - About 45 mins to fix
    src/targets/shell/httpie/client.ts on lines 53..57

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 50.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    const settings = {
      async: true,
      crossDomain: true,
      url: 'http://mockbin.com/har',
      method: 'POST',
    Severity: Major
    Found in src/targets/javascript/jquery/fixtures/jsonObj-null-value.js and 2 other locations - About 40 mins to fix
    src/targets/javascript/jquery/fixtures/application-json.js on lines 1..11
    src/targets/javascript/jquery/fixtures/jsonObj-multiline.js on lines 1..11

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    const settings = {
      async: true,
      crossDomain: true,
      url: 'http://mockbin.com/har',
      method: 'POST',
    Severity: Major
    Found in src/targets/javascript/jquery/fixtures/jsonObj-multiline.js and 2 other locations - About 40 mins to fix
    src/targets/javascript/jquery/fixtures/application-json.js on lines 1..11
    src/targets/javascript/jquery/fixtures/jsonObj-null-value.js on lines 1..11

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    const settings = {
      async: true,
      crossDomain: true,
      url: 'http://mockbin.com/har',
      method: 'POST',
    Severity: Major
    Found in src/targets/javascript/jquery/fixtures/application-json.js and 2 other locations - About 40 mins to fix
    src/targets/javascript/jquery/fixtures/jsonObj-multiline.js on lines 1..11
    src/targets/javascript/jquery/fixtures/jsonObj-null-value.js on lines 1..11

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

              postData.params.forEach(param => {
                push(`encodedParams.set('${param.name}', '${param.value}');`);
              });
    Severity: Minor
    Found in src/targets/javascript/axios/client.ts and 1 other location - About 40 mins to fix
    src/targets/node/axios/client.ts on lines 52..54

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

              postData.params.forEach(param => {
                push(`encodedParams.set('${param.name}', '${param.value}');`);
              });
    Severity: Minor
    Found in src/targets/node/axios/client.ts and 1 other location - About 40 mins to fix
    src/targets/javascript/axios/client.ts on lines 51..53

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 49.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        cookies.forEach(({ name, value }) => {
          push(`request.AddCookie("${name}", "${value}");`);
        });
    Severity: Minor
    Found in src/targets/csharp/restsharp/client.ts and 2 other locations - About 40 mins to fix
    src/targets/objc/nsurlsession/client.ts on lines 67..71
    src/targets/swift/nsurlsession/client.ts on lines 66..68

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

                tail.forEach(({ name, value }) => {
                  push(
                    `[postData appendData:[@"&${name}=${value}" dataUsingEncoding:NSUTF8StringEncoding]];`,
                  );
                });
    Severity: Minor
    Found in src/targets/objc/nsurlsession/client.ts and 2 other locations - About 40 mins to fix
    src/targets/csharp/restsharp/client.ts on lines 32..34
    src/targets/swift/nsurlsession/client.ts on lines 66..68

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

                tail.forEach(({ name, value }) => {
                  push(`postData.append("&${name}=${value}".data(using: String.Encoding.utf8)!)`);
                });
    Severity: Minor
    Found in src/targets/swift/nsurlsession/client.ts and 2 other locations - About 40 mins to fix
    src/targets/csharp/restsharp/client.ts on lines 32..34
    src/targets/objc/nsurlsession/client.ts on lines 67..71

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 48.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language