IL2HorusTeam/il2fb-ds-config

View on GitHub
il2fb/config/ds/schemas/console.py

Summary

Maintainability
C
1 day
Test Coverage

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

    @classmethod
    def from_ini(cls, ini):
        return cls({
            'enabled': field_from_ini(
                cls.enabled, ini,
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 2 other locations - About 3 hrs to fix
il2fb/config/ds/schemas/anticheat/speedhack.py on lines 35..52
il2fb/config/ds/schemas/connection.py on lines 35..52

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

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

    def to_ini(self, ini):
        field_to_ini(self.enabled, ini, 'Console', 'LOG')
        field_to_ini(self.file_name, ini, 'Console', 'LOGFILE')
        field_to_ini(self.log_time, ini, 'Console', 'LOGTIME')
        field_to_ini(self.keep_file, ini, 'Console', 'LOGKEEP')
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 2 other locations - About 2 hrs to fix
il2fb/config/ds/schemas/anticheat/speedhack.py on lines 56..60
il2fb/config/ds/schemas/connection.py on lines 56..60

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

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

    @classmethod
    def from_ini(cls, ini):
        return cls({
            'max_commands': field_from_ini(
                cls.max_commands, ini,
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 3 other locations - About 1 hr to fix
il2fb/config/ds/schemas/about.py on lines 24..33
il2fb/config/ds/schemas/anticheat/lags.py on lines 42..51
il2fb/config/ds/schemas/statistics.py on lines 107..116

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

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

    @classmethod
    def default(cls):
        return cls({
            field_name: field.default
            for field_name, field in cls.fields.items()
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 13 other locations - About 50 mins to fix
il2fb/config/ds/schemas/about.py on lines 41..45
il2fb/config/ds/schemas/anticheat/lags.py on lines 59..63
il2fb/config/ds/schemas/anticheat/lags.py on lines 111..115
il2fb/config/ds/schemas/anticheat/speedhack.py on lines 62..66
il2fb/config/ds/schemas/connection.py on lines 62..66
il2fb/config/ds/schemas/console.py on lines 161..165
il2fb/config/ds/schemas/events.py on lines 52..56
il2fb/config/ds/schemas/hud.py on lines 52..56
il2fb/config/ds/schemas/misc.py on lines 87..91
il2fb/config/ds/schemas/morse.py on lines 50..54
il2fb/config/ds/schemas/refly.py on lines 77..81
il2fb/config/ds/schemas/statistics.py on lines 87..91
il2fb/config/ds/schemas/statistics.py on lines 124..128

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

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

    @classmethod
    def default(cls):
        return cls({
            field_name: field.default
            for field_name, field in cls.fields.items()
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 13 other locations - About 50 mins to fix
il2fb/config/ds/schemas/about.py on lines 41..45
il2fb/config/ds/schemas/anticheat/lags.py on lines 59..63
il2fb/config/ds/schemas/anticheat/lags.py on lines 111..115
il2fb/config/ds/schemas/anticheat/speedhack.py on lines 62..66
il2fb/config/ds/schemas/connection.py on lines 62..66
il2fb/config/ds/schemas/console.py on lines 120..124
il2fb/config/ds/schemas/events.py on lines 52..56
il2fb/config/ds/schemas/hud.py on lines 52..56
il2fb/config/ds/schemas/misc.py on lines 87..91
il2fb/config/ds/schemas/morse.py on lines 50..54
il2fb/config/ds/schemas/refly.py on lines 77..81
il2fb/config/ds/schemas/statistics.py on lines 87..91
il2fb/config/ds/schemas/statistics.py on lines 124..128

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

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

    def to_ini(self, ini):
        for field_name in self.iter():
            self[field_name].to_ini(ini)
Severity: Major
Found in il2fb/config/ds/schemas/console.py and 3 other locations - About 30 mins to fix
il2fb/config/ds/schemas/__init__.py on lines 77..79
il2fb/config/ds/schemas/anticheat/lags.py on lines 138..140
il2fb/config/ds/schemas/device_link.py on lines 96..98

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

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