btelman96/letsrobot-android

View on GitHub
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt

Summary

Maintainability
C
1 day
Test Coverage

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

    /**
     * Camera orientation of video
     */
    @Suppress("UNCHECKED_CAST")
    val orientation = Preference.fromEnumId(preferenceManager, context,
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 131..133
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 135..137

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

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

    @Suppress("UNCHECKED_CAST")
    val communication = Preference.fromEnumId(preferenceManager, context,
            CommunicationType.values()[0], R.string.robotConnectionTypeKey)
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 53..58
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 135..137

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

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

    @Suppress("UNCHECKED_CAST")
    val protocol = Preference.fromEnumId(preferenceManager, context,
            ProtocolType.values()[0], R.string.robotProtocolTypeKey)
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 53..58
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 131..133

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

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

    /**
     * stream output bitrate for video
     */
    val videoBitrate = Preference.fromId(preferenceManager, context,
            "512", R.string.cameraBitrateKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 29..33
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 47..51
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 77..81
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 83..87

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

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

    /**
     * Camera Stream Key that is used as authentication with some Let's Robot sockets
     */
    val cameraPass = Preference.fromId(preferenceManager, context,
            "hello", R.string.connectionCameraPassKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 41..45
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 47..51
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 77..81
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 83..87

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

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

    /**
     * Audio In volume boost for use with FFmpeg
     */
    val micVolumeBoost = Preference.fromId(preferenceManager, context,
            "1", R.string.micVolumeBoostKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 29..33
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 41..45
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 47..51
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 83..87

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

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

    /**
     * Audio In bitrate for use with FFmpeg
     */
    val micBitrate = Preference.fromId(preferenceManager, context,
            "32", R.string.micAudioBitrateKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 29..33
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 41..45
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 47..51
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 77..81

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

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

    /**
     * stream output resolution for video
     */
    val videoResolution = Preference.fromId(preferenceManager, context,
            "640x480", R.string.cameraResolutionKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 29..33
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 41..45
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 77..81
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 83..87

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

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

    /**
     * Should the camera be used?
     */
    val cameraEnabled = Preference.fromId(preferenceManager, context,
            false, R.string.cameraSettingsEnableKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should Internal messages be sent to Text to Speech? (network events, etc...)
     */
    val internalSystemTTSMessagesEnabled =  Preference.fromId(preferenceManager, context,
            false, R.string.audioTTSInternalEnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should Text to speech features be used?
     */
    val ttsEnabled = Preference.fromId(preferenceManager, context,
            false, R.string.audioSettingsEnableKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should we pull Let's Robot messages use Text To Speech for them?
     */
    val ttsLREnabled = Preference.fromId(preferenceManager, context,
            false, R.string.audioSettingsTTSLREnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should the controls hide themselves when the robot is on?
     */
    val autoHideMainControls = Preference.fromId(preferenceManager, context,
            false, R.string.autoHideControlsEnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123

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

    /**
     * Should the mic be used?
     */
    val micEnabled = Preference.fromId(preferenceManager, context,
            false, R.string.microphoneSettingsEnableKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should the chat display be enabled in the main robot activity?
     */
    val chatDisplayEnabled = Preference.fromId(preferenceManager, context,
            false, R.string.displayChatEnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should Text to Speech be used when someone is banned or timed out?
     */
    val timeoutBanTTSNotificationsEnabled =  Preference.fromId(preferenceManager, context,
    false, R.string.audioBanVoiceEnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 101..105
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 9 locations. Consider refactoring.
Open

    /**
     * Should anonymous users be broadcast to Text to Speech?
     */
    val anonTTSEnabled = Preference.fromId(preferenceManager, context,
            false, R.string.audioSettingsTTSAnonEnabledKey) as BooleanPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 35..39
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 71..75
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 89..93
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 95..99
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 107..111
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 113..117
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 119..123
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 125..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 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 2 locations. Consider refactoring.
Open

    /**
     * Robot ID that is used to communicate with some Let's Robot server sockets
     */
    val robotId = Preference.fromId(preferenceManager, context,
            "", R.string.connectionRobotIdKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 23..27

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

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

    /**
     * CameraID that is used to communicate with some Let's Robot server sockets
     */
    val cameraId = Preference.fromId(preferenceManager, context,
            "", R.string.connectionCameraIdKey) as StringPreference
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/settings/LRPreferences.kt on lines 18..22

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

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