Playhi/FreezeYou

View on GitHub

Showing 285 of 313 total issues

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

                    case "ff":
                        if (length >= 4 && parseTaskAndReturnIfNeedExecuteImmediately(context, asTasks, taskTrigger))
                            startService(
                                    context,
                                    new Intent(context, FUFService.class)
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/TasksUtils.java and 1 other location - About 45 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/TasksUtils.java on lines 210..218

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

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

        if (jsonContentString == null) {
            HashMap<String, String> keyValuePair = new HashMap<>();
            keyValuePair.put("title", getString(R.string.failed));
            keyValuePair.put("spKey", "Failed!");
            keyValuePair.put("category", "Failed!");
app/src/main/java/cf/playhi/freezeyou/ui/BackupImportChooserActivity.java on lines 80..86
app/src/main/java/cf/playhi/freezeyou/ui/BackupImportChooserActivity.java on lines 72..78

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

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

            if (jsonObject == null) {
                HashMap<String, String> keyValuePair = new HashMap<>();
                keyValuePair.put("title", getString(R.string.parseFailed));
                keyValuePair.put("spKey", "Failed!");
                keyValuePair.put("category", "Failed!");
app/src/main/java/cf/playhi/freezeyou/ui/BackupImportChooserActivity.java on lines 80..86
app/src/main/java/cf/playhi/freezeyou/ui/BackupImportChooserActivity.java on lines 60..66

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

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

            if (DefaultSharedPreferenceStorageBooleanKeys.firstIconEnabled.name().equals(s)
                    || DefaultSharedPreferenceStorageBooleanKeys.secondIconEnabled.name().equals(s)
                    || DefaultSharedPreferenceStorageBooleanKeys.thirdIconEnabled.name().equals(s)
                    || DefaultMultiProcessMMKVStorageBooleanKeys.enableAuthentication.name().equals(s)) {
                continue;
app/src/main/java/cf/playhi/freezeyou/utils/BackupUtils.java on lines 366..371

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

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

            if (DefaultSharedPreferenceStorageBooleanKeys.firstIconEnabled.name().equals(s)
                    || DefaultSharedPreferenceStorageBooleanKeys.secondIconEnabled.name().equals(s)
                    || DefaultSharedPreferenceStorageBooleanKeys.thirdIconEnabled.name().equals(s)
                    || DefaultMultiProcessMMKVStorageBooleanKeys.enableAuthentication.name().equals(s)) {
                continue;
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/BackupUtils.java and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/ui/BackupImportChooserActivity.java on lines 205..210

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

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

                    ACTION_MODE_UNFREEZE -> {
                        withContext(Dispatchers.Main) {
                            onUFApplications(context, singlePackageName)
                        }
                        checkAndCreateFUFQuickNotification(context, singlePackageName)
app/src/main/java/cf/playhi/freezeyou/fuf/FreezeYouFUFSinglePackage.kt on lines 61..66

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

                case SORT_BY_LAST_INSTALLED:
                    setSortByDefault(AppList);
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
                        public int compare(Map<String, Object> m0, Map<String, Object> m1) {
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 716..724

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

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

                case SORT_BY_LAST_UPDATED:
                    setSortByDefault(AppList);
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
                        public int compare(Map<String, Object> m0, Map<String, Object> m1) {
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 707..715

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

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

                    ACTION_MODE_FREEZE -> {
                        withContext(Dispatchers.Main) {
                            onFApplications(context, singlePackageName)
                        }
                        deleteNotification(context, singlePackageName)
app/src/main/java/cf/playhi/freezeyou/fuf/FreezeYouFUFSinglePackage.kt on lines 67..72

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

            FUFSinglePackage.ERROR_NO_ERROR_SUCCESS -> {
                if (showUnnecessaryToast) showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.success)
                )
                true
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 625..630

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

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

                        alertDialogMessage.append(
                                String.format(
                                        getString(R.string.existed_colon_vN_longVC),
                                        pi.versionName,
                                        Build.VERSION.SDK_INT < 28 ?
app/src/main/java/cf/playhi/freezeyou/ui/InstallPackagesActivity.java on lines 260..268

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

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

                .setTitle(
                    String.format(
                        getString(R.string.welcomeToUseAppName),
                        getString(R.string.app_name)
                    )
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/ui/AboutActivity.kt and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/ui/AboutActivity.kt on lines 143..148

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

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

            FUFSinglePackage.ERROR_NO_ERROR_CAUGHT_UNKNOWN_RESULT -> {
                if (showUnnecessaryToast) showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.unknownResult_probablySuccess)
                )
                true
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 631..636

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

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

                .setMessage(
                    String.format(
                        getString(R.string.welcomeToUseAppName),
                        getString(R.string.app_name)
                    )
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/ui/AboutActivity.kt and 1 other location - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/ui/AboutActivity.kt on lines 136..141

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

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

                    alertDialogMessage.append(
                            String.format(
                                    getString(R.string.version_colon_vN_longVC),
                                    packageInfo.versionName,
                                    Build.VERSION.SDK_INT < 28 ?
app/src/main/java/cf/playhi/freezeyou/ui/InstallPackagesActivity.java on lines 247..255

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

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

            FUFMode.MODE_DPM -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName, FUFSinglePackage.API_FREEZEYOU_MROOT_DPM
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 13 other locations - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 152..160
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 161..169
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 170..178
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 190..198
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 199..208
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 209..218
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 219..228
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 155..163
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 164..172
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 184..192
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 193..202
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 203..212
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 213..222

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

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

            FUFMode.MODE_PROFILE_OWNER -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt and 13 other locations - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 152..160
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 161..169
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 170..178
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 190..198
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 199..208
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 209..218
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 146..154
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 155..163
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 164..172
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 184..192
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 193..202
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 203..212
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 213..222

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

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

            FUFMode.MODE_ROOT_DISABLE_ENABLE -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName, FUFSinglePackage.API_FREEZEYOU_ROOT_DISABLE_ENABLE
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 13 other locations - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 152..160
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 161..169
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 170..178
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 190..198
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 199..208
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 209..218
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 219..228
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 146..154
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 164..172
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 184..192
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 193..202
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 203..212
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 213..222

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

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

            FUFMode.MODE_SYSTEM_APP_ENABLE_DISABLE_UNTIL_USED -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt and 13 other locations - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 152..160
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 161..169
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 170..178
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 190..198
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 199..208
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 219..228
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 146..154
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 155..163
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 164..172
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 184..192
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 193..202
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 203..212
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 213..222

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

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

            FUFMode.MODE_SYSTEM_APP_ENABLE_DISABLE_USER -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt and 13 other locations - About 40 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 152..160
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 161..169
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 170..178
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 190..198
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 209..218
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 219..228
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 146..154
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 155..163
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 164..172
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 184..192
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 193..202
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 203..212
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 213..222

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

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