btelman96/letsrobot-android

View on GitHub

Showing 55 of 66 total issues

Method map has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static float map(float input, float inMin, float inMax, float outMin, float outMax, float multiplier) {

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

        @Throws(IllegalStateException::class)
        override fun disable(){
            serviceStateObserver.value = Operation.LOADING
            sendStateUnsafe(LetsRobotService.STOP)
        }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotControlApi.kt on lines 55..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 71.

    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

            status = when {
                successCounter > 5 -> ComponentStatus.STABLE
                successCounter > 2 -> ComponentStatus.INTERMITTENT
                else -> ComponentStatus.CONNECTING
            }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt on lines 196..200

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

    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

        @Throws(IllegalStateException::class)
        override fun enable() {
            serviceStateObserver.value = Operation.LOADING
            sendStateUnsafe(LetsRobotService.START)
        }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/services/LetsRobotControlApi.kt on lines 61..65

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

    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

            status = when {
                successCounter > 5 -> ComponentStatus.STABLE
                successCounter > 2 -> ComponentStatus.INTERMITTENT
                else -> ComponentStatus.CONNECTING
            }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/AudioComponent.kt on lines 114..118

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

    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

        public void makeCurrent(EGLSurface eglSurface) throws EglCoreException {
            if (mEGLDisplay == EGL11.EGL_NO_DISPLAY) {
                // called makeCurrent() before create?
                Log.d(TAG, "NOTE: makeCurrent w/o display");
            }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/utils/EglCore.java on lines 206..214

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

    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

        public void makeCurrent(EGLSurface drawSurface, EGLSurface readSurface) throws EglCoreException {
            if (mEGLDisplay == EGL11.EGL_NO_DISPLAY) {
                // called makeCurrent() before create?
                Log.d(TAG, "NOTE: makeCurrent w/o display");
            }
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/utils/EglCore.java on lines 193..201

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

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

            @Suppress("ConstantConditionIf")
            if(shouldLog)
                Log.d(LOGTAG, "onSuccess : $message")
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt on lines 192..194

    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

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

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

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

            @Suppress("ConstantConditionIf")
            if(shouldLog)
                Log.d(LOGTAG, "onProgress : $message")
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/components/camera/CameraBaseComponent.kt on lines 209..211

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

            telemetryFile = File(context.getExternalFilesDir(null), "${dateFormat.format(sessionStart)}-logs")
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/TelemetryManager.kt on lines 31..31

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

    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

            batteryFile = File(context.getExternalFilesDir(null), "${dateFormat.format(sessionStart)}-battery")
    letsrobotandroid-api/src/main/java/tv/letsrobot/android/api/TelemetryManager.kt on lines 24..24

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

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

    Severity
    Category
    Status
    Source
    Language