ahmadnassri/httpsnippet

View on GitHub

Showing 230 of 282 total issues

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

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});
Severity: Major
Found in src/targets/javascript/xhr/fixtures/application-json.js and 17 other locations - About 50 mins to fix
src/targets/javascript/xhr/fixtures/application-form-encoded.js on lines 6..10
src/targets/javascript/xhr/fixtures/cookies.js on lines 6..10
src/targets/javascript/xhr/fixtures/cors.js on lines 5..9
src/targets/javascript/xhr/fixtures/custom-method.js on lines 6..10
src/targets/javascript/xhr/fixtures/full.js on lines 6..10
src/targets/javascript/xhr/fixtures/headers.js on lines 6..10
src/targets/javascript/xhr/fixtures/https.js on lines 6..10
src/targets/javascript/xhr/fixtures/jsonObj-multiline.js on lines 8..12
src/targets/javascript/xhr/fixtures/jsonObj-null-value.js on lines 8..12
src/targets/javascript/xhr/fixtures/multipart-data.js on lines 8..12
src/targets/javascript/xhr/fixtures/multipart-file.js on lines 7..11
src/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js on lines 4..8
src/targets/javascript/xhr/fixtures/multipart-form-data.js on lines 7..11
src/targets/javascript/xhr/fixtures/nested.js on lines 6..10
src/targets/javascript/xhr/fixtures/query.js on lines 6..10
src/targets/javascript/xhr/fixtures/short.js on lines 6..10
src/targets/javascript/xhr/fixtures/text-plain.js on lines 6..10

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 18 locations. Consider refactoring.
Open

xhr.addEventListener('readystatechange', function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});
Severity: Major
Found in src/targets/javascript/xhr/fixtures/jsonObj-null-value.js and 17 other locations - About 50 mins to fix
src/targets/javascript/xhr/fixtures/application-form-encoded.js on lines 6..10
src/targets/javascript/xhr/fixtures/application-json.js on lines 25..29
src/targets/javascript/xhr/fixtures/cookies.js on lines 6..10
src/targets/javascript/xhr/fixtures/cors.js on lines 5..9
src/targets/javascript/xhr/fixtures/custom-method.js on lines 6..10
src/targets/javascript/xhr/fixtures/full.js on lines 6..10
src/targets/javascript/xhr/fixtures/headers.js on lines 6..10
src/targets/javascript/xhr/fixtures/https.js on lines 6..10
src/targets/javascript/xhr/fixtures/jsonObj-multiline.js on lines 8..12
src/targets/javascript/xhr/fixtures/multipart-data.js on lines 8..12
src/targets/javascript/xhr/fixtures/multipart-file.js on lines 7..11
src/targets/javascript/xhr/fixtures/multipart-form-data-no-params.js on lines 4..8
src/targets/javascript/xhr/fixtures/multipart-form-data.js on lines 7..11
src/targets/javascript/xhr/fixtures/nested.js on lines 6..10
src/targets/javascript/xhr/fixtures/query.js on lines 6..10
src/targets/javascript/xhr/fixtures/short.js on lines 6..10
src/targets/javascript/xhr/fixtures/text-plain.js on lines 6..10

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/jsonObj-multiline.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-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/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

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

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

      for (const key in value) {
        keyValuePairs.push(`"${key}": ${literalRepresentation(value[key], opts, indentLevel)}`);
      }
Severity: Minor
Found in src/targets/python/helpers.ts and 1 other location - About 35 mins to fix
src/targets/swift/helpers.ts on lines 67..69

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 47.

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