krygal/samsung_multiroom

View on GitHub

Showing 30 of 52 total issues

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

Severity: Major
Found in samsung_multiroom/event/type/speaker_mute_changed.py and 1 other location - About 6 hrs to fix
samsung_multiroom/event/type/speaker_player_shuffle_changed.py on lines 0..33

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

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

samsung_multiroom/event/type/speaker_mute_changed.py on lines 0..33

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

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

Severity: Major
Found in samsung_multiroom/service/tunein/service.py and 1 other location - About 2 hrs to fix
samsung_multiroom/service/dlna/service.py on lines 0..19

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

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

Severity: Major
Found in samsung_multiroom/service/dlna/service.py and 1 other location - About 2 hrs to fix
samsung_multiroom/service/tunein/service.py on lines 0..19

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

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

        if '@type' in data and data['@type'] == '2':
            kwargs['object_type'] = 'tunein_radio'
        else:
            kwargs['object_type'] = 'container'
Severity: Major
Found in samsung_multiroom/service/tunein/browser.py and 1 other location - About 2 hrs to fix
samsung_multiroom/service/dlna/browser.py on lines 52..55

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

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

        if 'type' in data and data['type'] == 'AUDIO':
            kwargs['object_type'] = 'dlna_audio'
        else:
            kwargs['object_type'] = 'container'
Severity: Major
Found in samsung_multiroom/service/dlna/browser.py and 1 other location - About 2 hrs to fix
samsung_multiroom/service/tunein/browser.py on lines 47..50

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

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

        if 'thumbnail' in music_info and 'http' in music_info['thumbnail']:
            track_kwargs['thumbnail_url'] = music_info['thumbnail']
Severity: Major
Found in samsung_multiroom/service/dlna/player.py and 2 other locations - About 1 hr to fix
samsung_multiroom/service/app/player.py on lines 110..111
samsung_multiroom/service/tunein/player.py on lines 96..97

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

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

        if 'thumbnail' in radio_info and 'http' in radio_info['thumbnail']:
            track_kwargs['thumbnail_url'] = radio_info['thumbnail']
Severity: Major
Found in samsung_multiroom/service/tunein/player.py and 2 other locations - About 1 hr to fix
samsung_multiroom/service/app/player.py on lines 110..111
samsung_multiroom/service/dlna/player.py on lines 145..146

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

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

        if 'thumbnail' in playlist_item and 'http' in playlist_item['thumbnail']:
            track_kwargs['thumbnail_url'] = playlist_item['thumbnail']
Severity: Major
Found in samsung_multiroom/service/app/player.py and 2 other locations - About 1 hr to fix
samsung_multiroom/service/dlna/player.py on lines 145..146
samsung_multiroom/service/tunein/player.py on lines 96..97

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

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

            track_kwargs['duration'] = int(hours) * 3600 + int(minutes) * 60 + int(float(seconds))
Severity: Major
Found in samsung_multiroom/service/dlna/player.py and 1 other location - About 1 hr to fix
samsung_multiroom/service/dlna/browser.py on lines 69..69

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

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

            kwargs['metadata']['duration'] = int(hours) * 3600 + int(minutes) * 60 + int(float(seconds))
Severity: Major
Found in samsung_multiroom/service/dlna/browser.py and 1 other location - About 1 hr to fix
samsung_multiroom/service/dlna/player.py on lines 149..149

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

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

            parent_id = next(iter([i.object_id for i in items if i.name == folder]), None)
Severity: Minor
Found in samsung_multiroom/service/app/browser.py and 1 other location - About 40 mins to fix
samsung_multiroom/service/tunein/browser.py on lines 28..28

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

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

            parent_id = next(iter([i.object_id for i in items if i.name == folder]), None)
Severity: Minor
Found in samsung_multiroom/service/tunein/browser.py and 1 other location - About 40 mins to fix
samsung_multiroom/service/app/browser.py on lines 33..33

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

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

        if 'thumbnail' in data:
            kwargs['metadata']['thumbnail_url'] = data['thumbnail']
Severity: Major
Found in samsung_multiroom/service/dlna/browser.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 67..68
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 63..64
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 72..73
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 152..153
samsung_multiroom/service/dlna/player.py on lines 154..155
samsung_multiroom/service/tunein/browser.py on lines 56..57

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

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

        if 'artist' in data:
            kwargs['metadata']['artist'] = data['artist']
Severity: Major
Found in samsung_multiroom/service/app/browser.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 63..64
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 70..71
samsung_multiroom/service/dlna/browser.py on lines 72..73
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 152..153
samsung_multiroom/service/dlna/player.py on lines 154..155
samsung_multiroom/service/tunein/browser.py on lines 56..57

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

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

        if 'thumbnail' in data:
            kwargs['metadata']['thumbnail_url'] = data['thumbnail']
Severity: Major
Found in samsung_multiroom/service/tunein/browser.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 67..68
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 63..64
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 70..71
samsung_multiroom/service/dlna/browser.py on lines 72..73
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 152..153
samsung_multiroom/service/dlna/player.py on lines 154..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 33.

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 is_active(self, function, submode=None):
        """
        Check if this player is active based on current function/submode.

        :returns: Boolean True if function/submode is supported
Severity: Minor
Found in samsung_multiroom/service/dlna/player.py and 2 other locations - About 35 mins to fix
samsung_multiroom/service/app/player.py on lines 124..130
samsung_multiroom/service/tunein/player.py on lines 101..107

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

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

        if 'device_udn' in music_info:
            track_kwargs['metadata']['device_udn'] = music_info['device_udn']
Severity: Major
Found in samsung_multiroom/service/dlna/player.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 67..68
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 63..64
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 70..71
samsung_multiroom/service/dlna/browser.py on lines 72..73
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 154..155
samsung_multiroom/service/tunein/browser.py on lines 56..57

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

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

        if 'artist' in data:
            kwargs['metadata']['artist'] = data['artist']
Severity: Major
Found in samsung_multiroom/service/dlna/browser.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 67..68
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 70..71
samsung_multiroom/service/dlna/browser.py on lines 72..73
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 152..153
samsung_multiroom/service/dlna/player.py on lines 154..155
samsung_multiroom/service/tunein/browser.py on lines 56..57

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

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

        if 'thumbnail_JPG_LRG' in data:
            kwargs['metadata']['thumbnail_url'] = data['thumbnail_JPG_LRG']
Severity: Major
Found in samsung_multiroom/service/dlna/browser.py and 13 other locations - About 35 mins to fix
samsung_multiroom/service/app/browser.py on lines 67..68
samsung_multiroom/service/app/browser.py on lines 69..70
samsung_multiroom/service/app/browser.py on lines 73..74
samsung_multiroom/service/app/player.py on lines 112..113
samsung_multiroom/service/dlna/browser.py on lines 63..64
samsung_multiroom/service/dlna/browser.py on lines 65..66
samsung_multiroom/service/dlna/browser.py on lines 70..71
samsung_multiroom/service/dlna/browser.py on lines 74..75
samsung_multiroom/service/dlna/browser.py on lines 76..77
samsung_multiroom/service/dlna/browser.py on lines 78..79
samsung_multiroom/service/dlna/player.py on lines 152..153
samsung_multiroom/service/dlna/player.py on lines 154..155
samsung_multiroom/service/tunein/browser.py on lines 56..57

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

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