btelman96/letsrobot-android

View on GitHub

Showing 55 of 66 total issues

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

    /**
     * LiveData object for whether or not we have a valid connection to the service
     */
    private val serviceBoundObserver: MutableLiveData<Operation> by lazy {
        MutableLiveData<Operation>()
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotControlApi.kt on lines 22..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 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 2 locations. Consider refactoring.
Open

    /**
     * LiveData object for whether or not the service has the components enabled
     */
    private val serviceStateObserver: MutableLiveData<Operation> by lazy {
        MutableLiveData<Operation>()
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotControlApi.kt on lines 29..34

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

                fFmpeg.execute(UUID, null, command.split(" ")
                        .toTypedArray(), this)
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt on lines 181..181

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

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

        ffmpeg.execute(UUID, null, command.split(" ").toTypedArray(), this)
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/AudioComponent.kt on lines 103..104

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

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

                ATTACH_COMPONENT -> {
                    (msg.obj as? IComponent)?.let {
                        addToLifecycle(it)
                    }
                }
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotService.kt on lines 53..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 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

    /**
     * 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

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

        port = JsonObjectUtils.getValueJsonObject(
            String.format("https://letsrobot.tv/get_video_port/%s", config.cameraId),
                "mpeg_stream_port"
        )
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt 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 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

                DETACH_COMPONENT -> {
                    (msg.obj as? IComponent)?.let {
                        removeFromLifecycle(it)
                    }
                }
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotService.kt on lines 48..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 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

        host = JsonObjectUtils.getValueJsonObject(
                String.format("https://letsrobot.tv/get_websocket_relay_host/%s", config.cameraId),
                "host"
        )
letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt on lines 56..59

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

Severity
Category
Status
Source
Language