IL2HorusTeam/il2fb-game-log-parser

View on GitHub
il2fb/parsers/game_log/transformers.py

Summary

Maintainability
F
3 days
Test Coverage

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

def get_ai_aircraft_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    flight_field_name = '{0}_flight'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 1 other location - About 5 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 162..175

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

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

def get_moving_unit_member_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    moving_unit_field_name = '{0}_moving_unit'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 1 other location - About 5 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 83..96

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

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

def get_moving_unit_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    moving_unit_field_name = '{0}_moving_unit'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 4 other locations - About 3 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 24..35
il2fb/parsers/game_log/transformers.py on lines 126..137
il2fb/parsers/game_log/transformers.py on lines 182..193
il2fb/parsers/game_log/transformers.py on lines 199..210

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

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

def get_building_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    building_field_name = '{0}_building'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 4 other locations - About 3 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 24..35
il2fb/parsers/game_log/transformers.py on lines 126..137
il2fb/parsers/game_log/transformers.py on lines 144..155
il2fb/parsers/game_log/transformers.py on lines 199..210

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

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

def get_bridge_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    bridge_field_name = '{0}_bridge'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 4 other locations - About 3 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 24..35
il2fb/parsers/game_log/transformers.py on lines 126..137
il2fb/parsers/game_log/transformers.py on lines 144..155
il2fb/parsers/game_log/transformers.py on lines 182..193

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

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

def get_stationary_unit_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    stationary_unit_field_name = '{0}_stationary_unit'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 4 other locations - About 3 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 24..35
il2fb/parsers/game_log/transformers.py on lines 144..155
il2fb/parsers/game_log/transformers.py on lines 182..193
il2fb/parsers/game_log/transformers.py on lines 199..210

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

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

def get_human_transformer(dst_field_name, src_field_prefix=None):
    if not src_field_prefix:
        src_field_prefix = dst_field_name

    callsign_field_name = '{0}_callsign'.format(src_field_prefix)
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 4 other locations - About 3 hrs to fix
il2fb/parsers/game_log/transformers.py on lines 126..137
il2fb/parsers/game_log/transformers.py on lines 144..155
il2fb/parsers/game_log/transformers.py on lines 182..193
il2fb/parsers/game_log/transformers.py on lines 199..210

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

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

def transform_date(data):
    value = data['date']
    data['date'] = datetime.datetime.strptime(value, LOG_DATE_FORMAT).date()
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 1 other location - About 1 hr to fix
il2fb/parsers/game_log/transformers.py on lines 14..16

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

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

def transform_time(data):
    value = data['time']
    data['time'] = datetime.datetime.strptime(value, LOG_TIME_FORMAT).time()
Severity: Major
Found in il2fb/parsers/game_log/transformers.py and 1 other location - About 1 hr to fix
il2fb/parsers/game_log/transformers.py on lines 19..21

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

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