EmmaRamirez/Clickopolis

View on GitHub

Showing 115 of 115 total issues

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

export const foodTotal = (state = 0, action) => {
  switch (action.type) {
    case 'CLICK_FOOD_BUTTON':
      return state + action.amount;
    default:
Severity: Minor
Found in src/reducers/foodTotal.ts and 1 other location - About 40 mins to fix
src/reducers/prodTotal.ts on lines 1..8

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

let archer = {
    name: 'Archer',
    plural: 'Archers',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let cannon = {
    name: 'Cannon',
    plural: 'Cannons',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let cavalry = {
    name: 'Cavalry',
    plural: 'Cavalry',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let tank = {
    name: 'Tank',
    plural: 'Tanks',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 146..155

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

let ziggurat:Building = new Building('Ziggurat', 0, 120, 1200, 'A tiny proto-pyramid.', '+3 <img src="img/research.png"> PM', true, false, function (args) {
  args.playerCiv.researchPM += 3;
  //notify({message: `Your scholars have convened at your newest Ziggurat! (<img src='img/research.png'> ${playerCiv.researchPM} PM)`})
});
Severity: Major
Found in src/data/building.ts and 4 other locations - About 40 mins to fix
src/data/building.ts on lines 26..29
src/data/building.ts on lines 41..44
src/data/building.ts on lines 45..48
src/data/building.ts on lines 58..61

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

let submarine = {
    name: 'Submarine',
    plural: 'Submarines',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let asclepeia:Building = new Building('Asclepeia', 0, 50, 500, 'We can\'t pronounce it either.', '+1 <img src="img/health.png">', true, false, function (args) {
  args.playerCiv.health += 1;
  //notify({message: `Your civilization became healthier! (<img src='img/health.png'> ${playerCiv.health})`});
});
Severity: Major
Found in src/data/building.ts and 4 other locations - About 40 mins to fix
src/data/building.ts on lines 26..29
src/data/building.ts on lines 45..48
src/data/building.ts on lines 58..61
src/data/building.ts on lines 62..65

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

let stealthBomber = {
    name: 'Stealth Bomber',
    plural: 'Stealth Bombers',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144

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

let galley = {
    name: 'Galley',
    plural: 'Galleys',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let barracks:Building = new Building('Barracks', 0, 35, 350, 'Keep your soldiers at the ready!', '+1 <img src="img/strength.png">', true, false, function (args) {
  args.playerCiv.strengthFromBuildings += 1;
  //notify({message: `Your civilization grew stronger! (<img src='img/strength.png'> ${playerCiv.strength})`});
});
Severity: Major
Found in src/data/building.ts and 4 other locations - About 40 mins to fix
src/data/building.ts on lines 41..44
src/data/building.ts on lines 45..48
src/data/building.ts on lines 58..61
src/data/building.ts on lines 62..65

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

let destroyer = {
    name: 'Destroyer',
    plural: 'Destroyers',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let spearman = {
    name: 'Spearman',
    plural: 'Spearmen',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let infantry = {
    name: 'Infantry',
    plural: 'Infantry',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let fighterJet = {
    name: 'Fighter Jet',
    plural: 'Fighter Jets',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let frigate = {
    name: 'Frigate',
    plural: 'Frigates',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let graveyard:Building = new Building('Graveyard', 0, 30, 300, 'Here, your (dead) citizens gather.', '-1 <img src="img/pollution.png">', true, false, function (args) {
  args.playerCiv.pollutionFromBuildings -= 1;
  //notify({message: `Good idea, let's keep the dead bodies away. (<img src='img/pollution.png'> ${playerCiv.pollution})`});
});
Severity: Major
Found in src/data/building.ts and 4 other locations - About 40 mins to fix
src/data/building.ts on lines 26..29
src/data/building.ts on lines 41..44
src/data/building.ts on lines 58..61
src/data/building.ts on lines 62..65

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

let fort:Building = new Building('Fort', 0, 100, 1000, 'Defend the nation! Defend the state!', '+5 <img src="img/defense.png">', true, false, function (args) {
  args.playerCiv.defenseFromBuildings += 5;
  //notify({message: `Much better than the one made out of pillows. (<img src='img/defense.png'> ${playerCiv.defense})`})
});
Severity: Major
Found in src/data/building.ts and 4 other locations - About 40 mins to fix
src/data/building.ts on lines 26..29
src/data/building.ts on lines 41..44
src/data/building.ts on lines 45..48
src/data/building.ts on lines 62..65

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

let helicopter = {
    name: 'Helicopter',
    plural: 'Helicopters',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 3..12
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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

let footSoldier = {
    name: 'Foot Soldier',
    plural: 'Foot Soldiers',
    amount: 0,
    enabled: true,
Severity: Major
Found in src/data/soldier.ts and 13 other locations - About 40 mins to fix
src/data/soldier.ts on lines 14..23
src/data/soldier.ts on lines 25..34
src/data/soldier.ts on lines 36..45
src/data/soldier.ts on lines 47..56
src/data/soldier.ts on lines 58..67
src/data/soldier.ts on lines 69..78
src/data/soldier.ts on lines 80..89
src/data/soldier.ts on lines 91..100
src/data/soldier.ts on lines 102..111
src/data/soldier.ts on lines 113..122
src/data/soldier.ts on lines 124..133
src/data/soldier.ts on lines 135..144
src/data/soldier.ts on lines 146..155

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