Playhi/FreezeYou

View on GitHub
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt

Summary

Maintainability
C
7 hrs
Test Coverage

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

    override fun setValue(context: Context?, value: Boolean) {
        if (context == null)
            throw RuntimeException("Context cannot be null when getting keys from sharedPreferences.")

        PreferenceManager.getDefaultSharedPreferences(context).edit()
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageStringKeys.kt on lines 65..71

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

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

    saveSortMethodStatus {
        override fun defaultValue(): Boolean = true
        override fun titleTextStringId(): Int = R.string.saveSortMethodStatus
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_COMMON
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 51..55
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 105..109
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 111..115
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 123..127
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 15..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

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

    saveOnClickFunctionStatus {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = R.string.saveOnClickFunctionStatus
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_COMMON
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 21..25
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 33..37
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 39..43
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 45..49
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 57..61
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 63..67
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 69..73
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 75..79
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 81..85
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 87..91
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 93..97
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 99..103
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 117..121
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 129..133
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 21..25
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 39..43

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

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

    allowEditWhenCreateShortcut {
        override fun defaultValue(): Boolean = true
        override fun titleTextStringId(): Int = R.string.allowEditWhCreateShortcut
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_COMMON
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 51..55
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 105..109
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 111..115
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 123..127
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 33..37

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

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

    cacheApplicationsIcons {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = R.string.cacheApplicationsIcons
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_COMMON
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 21..25
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 33..37
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 39..43
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 45..49
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 57..61
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 63..67
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 69..73
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 75..79
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 81..85
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 87..91
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 93..97
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 99..103
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 117..121
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 129..133
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 21..25
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 27..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 81.

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

    noCaution {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = R.string.nSCaution
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_COMMON
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 21..25
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 33..37
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 39..43
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 45..49
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 57..61
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 63..67
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 69..73
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 75..79
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 81..85
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 87..91
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 93..97
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 99..103
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 117..121
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 129..133
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 27..31
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 39..43

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

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

    enableInstallPkgFunc {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = R.string.enableInstallPkgFunc
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_INSTALL_UNINSTALL
    };
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultMultiProcessMMKVStorageBooleanKeys.kt on lines 163..167

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

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

    firstIconEnabled {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = -1
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_ICON_ENTRY
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 51..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 76.

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

    secondIconEnabled {
        override fun defaultValue(): Boolean = false
        override fun titleTextStringId(): Int = -1
        override fun category(): Int = CATEGORY_SETTINGS or CATEGORY_SETTINGS_ICON_ENTRY
    },
app/src/main/java/cf/playhi/freezeyou/storage/key/DefaultSharedPreferenceStorageBooleanKeys.kt on lines 45..49

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

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