niwa99/Tower-Defense

View on GitHub
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java

Summary

Maintainability
A
2 hrs
Test Coverage

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

    private static int getPlasmarizerRangeByLevel(int level) {
        switch (level) {
            case 1: return TOWER_PLASMARIZER_LEVEL_1_RANGE_IN_PIXELS;
            case 2: return TOWER_PLASMARIZER_LEVEL_2_RANGE_IN_PIXELS;
            case 3: return TOWER_PLASMARIZER_LEVEL_3_RANGE_IN_PIXELS;
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 85..93
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 100..108
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 115..123
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 130..138
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 114..122
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 174..182
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 189..197
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 97..105
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 117..125
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 137..145
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 157..165
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 91..99
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 106..114
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 136..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 46.

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

    private static int getPlasmarizerCostsByLevel(int level) {
        switch (level) {
            case 1: return TOWER_PLASMARIZER_LEVEL_1_COSTS;
            case 2: return TOWER_PLASMARIZER_LEVEL_2_COSTS;
            case 3: return TOWER_PLASMARIZER_LEVEL_3_COSTS;
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 85..93
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 100..108
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 115..123
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 130..138
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 114..122
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 174..182
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 189..197
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 97..105
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 117..125
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 137..145
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 157..165
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 106..114
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 121..129
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 136..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 46.

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

    private static int getPlasmarizerDamageByLevel(int level) {
        switch (level) {
            case 1: return TOWER_PLASMARIZER_LEVEL_1_DAMAGE;
            case 2: return TOWER_PLASMARIZER_LEVEL_2_DAMAGE;
            case 3: return TOWER_PLASMARIZER_LEVEL_3_DAMAGE;
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 85..93
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 100..108
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 115..123
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 130..138
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 114..122
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 174..182
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 189..197
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 97..105
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 117..125
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 137..145
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 157..165
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 91..99
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 121..129
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 136..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 46.

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

    private static int getPlasmarizerFirerateByLevel(int level) {
        switch (level) {
            case 1: return TOWER_PLASMARIZER_LEVEL_1_FIRERATE_IN_SECONDS;
            case 2: return TOWER_PLASMARIZER_LEVEL_2_FIRERATE_IN_SECONDS;
            case 3: return TOWER_PLASMARIZER_LEVEL_3_FIRERATE_IN_SECONDS;
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 85..93
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 100..108
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 115..123
app/src/main/java/de/dhbw/map/objects/tower/TowerArtillery.java on lines 130..138
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 114..122
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerBoombastic.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 129..137
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 144..152
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 159..167
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 174..182
app/src/main/java/de/dhbw/map/objects/tower/TowerFreezer.java on lines 189..197
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 97..105
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 117..125
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 137..145
app/src/main/java/de/dhbw/map/objects/tower/TowerLaser.java on lines 157..165
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 91..99
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 106..114
app/src/main/java/de/dhbw/map/objects/tower/TowerPlasmarizer.java on lines 121..129

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

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

There are no issues that match your filters.

Category
Status