ahmadnassri/httpsnippet

View on GitHub

Showing 230 of 282 total issues

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

export const okhttp: Client = {
  info: {
    key: 'okhttp',
    title: 'OkHttp',
    link: 'http://square.github.io/okhttp/',
Severity: Major
Found in src/targets/java/okhttp/client.ts and 1 other location - About 3 days to fix
src/targets/kotlin/okhttp/client.ts on lines 15..76

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

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

export const okhttp: Client = {
  info: {
    key: 'okhttp',
    title: 'OkHttp',
    link: 'http://square.github.io/okhttp/',
Severity: Major
Found in src/targets/kotlin/okhttp/client.ts and 1 other location - About 3 days to fix
src/targets/java/okhttp/client.ts on lines 15..75

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

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

runCustomFixtures({
  targetId: 'objc',
  clientId: 'nsurlsession',
  tests: [
    {
Severity: Major
Found in src/targets/objc/nsurlsession/client.test.ts and 1 other location - About 6 hrs to fix
src/targets/swift/nsurlsession/client.test.ts on lines 7..44

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

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

runCustomFixtures({
  targetId: 'swift',
  clientId: 'nsurlsession',
  tests: [
    {
Severity: Major
Found in src/targets/swift/nsurlsession/client.test.ts and 1 other location - About 6 hrs to fix
src/targets/objc/nsurlsession/client.test.ts on lines 7..36

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
Severity: Major
Found in src/targets/php/curl/fixtures/multipart-file.php and 5 other locations - About 4 hrs to fix
src/targets/php/curl/fixtures/application-form-encoded.php on lines 1..28
src/targets/php/curl/fixtures/multipart-data.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data-no-params.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data.php on lines 1..28
src/targets/php/curl/fixtures/text-plain.php on lines 1..28

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
Severity: Major
Found in src/targets/php/curl/fixtures/application-form-encoded.php and 5 other locations - About 4 hrs to fix
src/targets/php/curl/fixtures/multipart-data.php on lines 1..28
src/targets/php/curl/fixtures/multipart-file.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data-no-params.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data.php on lines 1..28
src/targets/php/curl/fixtures/text-plain.php on lines 1..28

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
Severity: Major
Found in src/targets/php/curl/fixtures/multipart-data.php and 5 other locations - About 4 hrs to fix
src/targets/php/curl/fixtures/application-form-encoded.php on lines 1..28
src/targets/php/curl/fixtures/multipart-file.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data-no-params.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data.php on lines 1..28
src/targets/php/curl/fixtures/text-plain.php on lines 1..28

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
src/targets/php/curl/fixtures/application-form-encoded.php on lines 1..28
src/targets/php/curl/fixtures/multipart-data.php on lines 1..28
src/targets/php/curl/fixtures/multipart-file.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data.php on lines 1..28
src/targets/php/curl/fixtures/text-plain.php on lines 1..28

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
Severity: Major
Found in src/targets/php/curl/fixtures/text-plain.php and 5 other locations - About 4 hrs to fix
src/targets/php/curl/fixtures/application-form-encoded.php on lines 1..28
src/targets/php/curl/fixtures/multipart-data.php on lines 1..28
src/targets/php/curl/fixtures/multipart-file.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data-no-params.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data.php on lines 1..28

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

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

<?php

$curl = curl_init();

curl_setopt_array($curl, [
Severity: Major
Found in src/targets/php/curl/fixtures/multipart-form-data.php and 5 other locations - About 4 hrs to fix
src/targets/php/curl/fixtures/application-form-encoded.php on lines 1..28
src/targets/php/curl/fixtures/multipart-data.php on lines 1..28
src/targets/php/curl/fixtures/multipart-file.php on lines 1..28
src/targets/php/curl/fixtures/multipart-form-data-no-params.php on lines 1..28
src/targets/php/curl/fixtures/text-plain.php on lines 1..28

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

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

      it('should add headersObj to source object case insensitive when HTTP/1.0', () => {
        const snippet = new HTTPSnippet({
          ...headers,
          httpVersion: 'HTTP/1.1',
          headers: [
Severity: Major
Found in src/httpsnippet.test.ts and 1 other location - About 3 hrs to fix
src/httpsnippet.test.ts on lines 179..199

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

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

      it('should add headersObj to source object lowercased when HTTP/2.x', () => {
        const snippet = new HTTPSnippet({
          ...headers,
          httpVersion: 'HTTP/2',
          headers: [
Severity: Major
Found in src/httpsnippet.test.ts and 1 other location - About 3 hrs to fix
src/httpsnippet.test.ts on lines 157..177

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/jsonObj-null-value.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/custom-method.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/nested.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/insecure-skip-verify.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/https.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/cookies.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/full.js on lines 16..27
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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

const req = http.request(options, function (res) {
  const chunks = [];

  res.on('data', function (chunk) {
    chunks.push(chunk);
Severity: Major
Found in src/targets/node/native/fixtures/full.js and 17 other locations - About 3 hrs to fix
src/targets/node/native/fixtures/application-form-encoded.js on lines 14..25
src/targets/node/native/fixtures/application-json.js on lines 13..24
src/targets/node/native/fixtures/cookies.js on lines 13..24
src/targets/node/native/fixtures/custom-method.js on lines 11..22
src/targets/node/native/fixtures/headers.js on lines 15..26
src/targets/node/native/fixtures/https.js on lines 11..22
src/targets/node/native/fixtures/insecure-skip-verify.js on lines 12..23
src/targets/node/native/fixtures/jsonObj-multiline.js on lines 13..24
src/targets/node/native/fixtures/jsonObj-null-value.js on lines 13..24
src/targets/node/native/fixtures/multipart-data.js on lines 13..24
src/targets/node/native/fixtures/multipart-file.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data-no-params.js on lines 13..24
src/targets/node/native/fixtures/multipart-form-data.js on lines 13..24
src/targets/node/native/fixtures/nested.js on lines 11..22
src/targets/node/native/fixtures/query.js on lines 11..22
src/targets/node/native/fixtures/short.js on lines 11..22
src/targets/node/native/fixtures/text-plain.js on lines 13..24

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

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