hongaar/bandersnatch

View on GitHub

Showing 102 of 254 total issues

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

  NO: {
    name: "Norway",
    native: "Norge",
    phone: [47],
    continent: "EU",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  CY: {
    name: "Cyprus",
    native: "Κύπρος",
    phone: [357],
    continent: "EU",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  RW: {
    name: "Rwanda",
    native: "Rwanda",
    phone: [250],
    continent: "AF",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 2197..2205

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

  EH: {
    name: "Western Sahara",
    native: "الصحراء الغربية",
    phone: [212],
    continent: "AF",
Severity: Minor
Found in examples/countries.ts and 1 other location - About 40 mins to fix
examples/countries.ts on lines 2116..2124

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

  GU: {
    name: "Guam",
    native: "Guam",
    phone: [1671],
    continent: "OC",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  AF: {
    name: "Afghanistan",
    native: "افغانستان",
    phone: [93],
    continent: "AS",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  VU: {
    name: "Vanuatu",
    native: "Vanuatu",
    phone: [678],
    continent: "OC",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754

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

  BV: {
    name: "Bouvet Island",
    native: "Bouvetøya",
    phone: [47],
    continent: "AN",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  LU: {
    name: "Luxembourg",
    native: "Luxembourg",
    phone: [352],
    continent: "EU",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  LS: {
    name: "Lesotho",
    native: "Lesotho",
    phone: [266],
    continent: "AF",
Severity: Major
Found in examples/countries.ts and 2 other locations - About 40 mins to fix
examples/countries.ts on lines 907..915
examples/countries.ts on lines 1457..1465

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

  ER: {
    name: "Eritrea",
    native: "ኤርትራ",
    phone: [291],
    continent: "AF",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  BE: {
    name: "Belgium",
    native: "België",
    phone: [32],
    continent: "EU",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  HT: {
    name: "Haiti",
    native: "Haïti",
    phone: [509],
    continent: "NA",
Severity: Major
Found in examples/countries.ts and 2 other locations - About 40 mins to fix
examples/countries.ts on lines 1205..1213
examples/countries.ts on lines 1457..1465

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

  BA: {
    name: "Bosnia and Herzegovina",
    native: "Bosna i Hercegovina",
    phone: [387],
    continent: "EU",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  CW: {
    name: "Curacao",
    native: "Curaçao",
    phone: [5999],
    continent: "NA",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1286..1294
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  MF: {
    name: "Saint Martin",
    native: "Saint-Martin",
    phone: [590],
    continent: "NA",
Severity: Major
Found in examples/countries.ts and 12 other locations - About 40 mins to fix
examples/countries.ts on lines 40..48
examples/countries.ts on lines 167..175
examples/countries.ts on lines 194..202
examples/countries.ts on lines 320..328
examples/countries.ts on lines 491..499
examples/countries.ts on lines 509..517
examples/countries.ts on lines 619..627
examples/countries.ts on lines 844..852
examples/countries.ts on lines 1223..1231
examples/countries.ts on lines 1520..1528
examples/countries.ts on lines 1746..1754
examples/countries.ts on lines 2197..2205

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

  NA: {
    name: "Namibia",
    native: "Namibia",
    phone: [264],
    continent: "AF",
Severity: Major
Found in examples/countries.ts and 2 other locations - About 40 mins to fix
examples/countries.ts on lines 907..915
examples/countries.ts on lines 1205..1213

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

  US: {
    name: "United States",
    native: "United States",
    phone: [1],
    continent: "NA",
Severity: Minor
Found in examples/countries.ts and 1 other location - About 40 mins to fix
examples/countries.ts on lines 610..618

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

Consider simplifying this complex logical expression.
Open

      if (isPromptable && (!presentInArgs || isDefault)) {
        // Detect the type of question we need to ask
        switch (true) {
          case typeof arg.getChoices() !== "undefined" &&
            (arg.getType() === "array" || Array.isArray(defaultValue)):
Severity: Major
Found in src/prompter.ts - About 40 mins to fix

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

      AM: {
        name: "Armenia",
        native: "Հայաստան",
        phone: [374],
        continent: "AS",
    Severity: Major
    Found in examples/countries.ts and 54 other locations - About 40 mins to fix
    examples/countries.ts on lines 103..111
    examples/countries.ts on lines 112..120
    examples/countries.ts on lines 139..147
    examples/countries.ts on lines 203..211
    examples/countries.ts on lines 230..238
    examples/countries.ts on lines 329..337
    examples/countries.ts on lines 338..346
    examples/countries.ts on lines 347..355
    examples/countries.ts on lines 356..364
    examples/countries.ts on lines 383..391
    examples/countries.ts on lines 392..400
    examples/countries.ts on lines 437..445
    examples/countries.ts on lines 518..526
    examples/countries.ts on lines 536..544
    examples/countries.ts on lines 646..654
    examples/countries.ts on lines 745..753
    examples/countries.ts on lines 790..798
    examples/countries.ts on lines 808..816
    examples/countries.ts on lines 871..879
    examples/countries.ts on lines 934..942
    examples/countries.ts on lines 943..951
    examples/countries.ts on lines 952..960
    examples/countries.ts on lines 961..969
    examples/countries.ts on lines 979..987
    examples/countries.ts on lines 1015..1023
    examples/countries.ts on lines 1051..1059
    examples/countries.ts on lines 1060..1068
    examples/countries.ts on lines 1087..1095
    examples/countries.ts on lines 1160..1168
    examples/countries.ts on lines 1187..1195
    examples/countries.ts on lines 1295..1303
    examples/countries.ts on lines 1304..1312
    examples/countries.ts on lines 1349..1357
    examples/countries.ts on lines 1358..1366
    examples/countries.ts on lines 1394..1402
    examples/countries.ts on lines 1421..1429
    examples/countries.ts on lines 1538..1546
    examples/countries.ts on lines 1556..1564
    examples/countries.ts on lines 1619..1627
    examples/countries.ts on lines 1691..1699
    examples/countries.ts on lines 1773..1781
    examples/countries.ts on lines 1782..1790
    examples/countries.ts on lines 1872..1880
    examples/countries.ts on lines 1917..1925
    examples/countries.ts on lines 1935..1943
    examples/countries.ts on lines 1953..1961
    examples/countries.ts on lines 1989..1997
    examples/countries.ts on lines 2016..2024
    examples/countries.ts on lines 2034..2042
    examples/countries.ts on lines 2080..2088
    examples/countries.ts on lines 2098..2106
    examples/countries.ts on lines 2134..2142
    examples/countries.ts on lines 2143..2151
    examples/countries.ts on lines 2215..2223

    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