Playhi/FreezeYou

View on GitHub

Showing 285 of 313 total issues

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

package cf.playhi.freezeyou.ui.fragment.settings

import android.os.Bundle
import androidx.annotation.Keep
import androidx.preference.PreferenceFragmentCompat
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsAppearanceFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsCommonFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsFufFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsNotificationFufFragment.kt on lines 1..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 152.

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

package cf.playhi.freezeyou.ui.fragment.settings

import android.os.Bundle
import androidx.annotation.Keep
import androidx.preference.PreferenceFragmentCompat
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsBackgroundServiceFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsCommonFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsFufFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsNotificationFufFragment.kt on lines 1..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 152.

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

package cf.playhi.freezeyou.ui.fragment.settings

import android.os.Bundle
import androidx.annotation.Keep
import androidx.preference.PreferenceFragmentCompat
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsAppearanceFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsBackgroundServiceFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsFufFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsNotificationFufFragment.kt on lines 1..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 152.

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

package cf.playhi.freezeyou.ui.fragment.settings

import android.os.Bundle
import androidx.annotation.Keep
import androidx.preference.PreferenceFragmentCompat
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsAppearanceFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsBackgroundServiceFragment.kt on lines 1..20
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsCommonFragment.kt on lines 1..19
app/src/main/java/cf/playhi/freezeyou/ui/fragment/settings/SettingsNotificationFufFragment.kt on lines 1..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 152.

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

        ) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.bluetoothPermissionIsNotGranted),
                    getApplication<Application>().getString(R.string.mayCannotUseScheduledTaskToEnableOrDisableBluetooth),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noMRootPermission),
                    getApplication<Application>().getString(R.string.someFuncMayRestrict),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noIgnoringBO),
                    getApplication<Application>().getString(R.string.someFuncMayBeAff),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noNotifyPermission),
                    getApplication<Application>().getString(R.string.mayCannotNotify),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.notUpdatedForALongTime),
                    getApplication<Application>().getString(R.string.someNewFuncMayPub),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        if (isDeviceOwner(getApplication())) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noMRootPermission),
                    getApplication<Application>().getString(R.string.someFuncMayRestrict),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.inPowerSaveMode),
                    getApplication<Application>().getString(R.string.someFuncMayBeAff),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        if (Build.VERSION.SDK_INT >= 24 && !notificationManager.areNotificationsEnabled()) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noNotifyPermission),
                    getApplication<Application>().getString(R.string.mayCannotNotify),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        ) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.inPowerSaveMode),
                    getApplication<Application>().getString(R.string.someFuncMayBeAff),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        ) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noIgnoringBO),
                    getApplication<Application>().getString(R.string.someFuncMayBeAff),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.sysVerLow),
                    getApplication<Application>().getString(R.string.someFuncUn),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noRootPermission),
                    getApplication<Application>().getString(R.string.someFuncMayRestrict),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 372..381

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

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

        if (!hasPermission || value != 0) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.noRootPermission),
                    getApplication<Application>().getString(R.string.someFuncMayRestrict),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        if (isOutdated(getApplication<Application>())) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.notUpdatedForALongTime),
                    getApplication<Application>().getString(R.string.someNewFuncMayPub),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 120..129
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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

        } else {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.bluetoothPermissionIsNotGranted),
                    getApplication<Application>().getString(R.string.mayCannotUseScheduledTaskToEnableOrDisableBluetooth),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 129..138
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 213..222
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 235..244
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 257..266
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 295..304
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 320..329
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 344..353

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

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

        if (Build.VERSION.SDK_INT < 21) {
            problemsList.value!!.add(
                generateHashMap(
                    getApplication<Application>().getString(R.string.sysVerLow),
                    getApplication<Application>().getString(R.string.someFuncUn),
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 204..213
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 226..235
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 248..257
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 286..295
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 311..320
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 335..344
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 363..372
app/src/main/java/cf/playhi/freezeyou/viewmodel/AutoDiagnosisViewModel.kt on lines 421..430

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

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