Playhi/FreezeYou

View on GitHub
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt

Summary

Maintainability
D
2 days
Test Coverage

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

    @JvmStatic
    fun checkAndShowAppStillNotifyingToast(context: Context, pkgName: String?) {
        val label = ApplicationLabelUtils.getApplicationLabel(
            context,
            null,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 2 hrs to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 439..453

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

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

    @JvmStatic
    fun checkAndShowAppIsForegroundApplicationToast(context: Context, pkgName: String?) {
        val label = ApplicationLabelUtils.getApplicationLabel(
            context,
            null,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 2 hrs to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 423..437

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

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

            if (context.getString(R.string.onlyUnfreeze) != target) {
                context.startActivity(
                    Intent(context, AskRunActivity::class.java)
                        .putExtra("pkgName", pkgName)
                        .putExtra("target", target)
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/fuf/FreezeYouFUFSinglePackage.kt on lines 104..112

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

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

            context, Intent(context, FUFService::class.java)
                .putExtra("askRun", askRun)
                .putExtra("pkgName", pkgName)
                .putExtra("target", target) //目标 Activity
                .putExtra("tasks", tasks) //追加任务
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/utils/LauncherShortcutUtils.kt on lines 40..46

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

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

                try {
                    val component = ComponentName(pkgName, target)
                    val intent = Intent()
                    intent.component = component
                    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/fuf/FreezeYouFUFSinglePackage.kt on lines 138..145

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

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 (e.message!!.lowercase(Locale.getDefault())
                        .contains("permission denied") || e.message!!.lowercase(
                        Locale.getDefault()
                    ).contains("not found")
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 589..592

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

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 (e.message!!.lowercase(Locale.getDefault())
                    .contains("permission denied") || e.message!!.lowercase(
                    Locale.getDefault()
                ).contains("not found")
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 316..319

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

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 == false || lesserToast.getValue())
                    null
                else
                    getPreProcessedFUFResultToastString(
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 723..730

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

            FUFSinglePackage.ERROR_NO_ERROR_SUCCESS -> {
                if (showUnnecessaryToast == false || lesserToast.getValue())
                    null
                else
                    getPreProcessedFUFResultToastString(
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 715..722

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

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

            FUFSinglePackage.ERROR_INSUFFICIENT_PERMISSION,
            FUFSinglePackage.ERROR_NO_SUFFICIENT_PERMISSION_TO_START_THIS_ACTIVITY ->
                getPreProcessedFUFResultToastString(
                    context, context.getString(R.string.insufficientPermission)
                )
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 743..747

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

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_DPM_EXECUTE_FAILED_FROM_SYSTEM,
            FUFSinglePackage.ERROR_PROFILE_OWNER_EXECUTE_FAILED_FROM_SYSTEM ->
                getPreProcessedFUFResultToastString(
                    context, context.getString(R.string.executeFailedFromSystem)
                )
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 776..780

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

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

            FUFSinglePackage.ERROR_SINGLE_PACKAGE_NAME_IS_BLANK -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.packageNameIsEmpty)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_NOT_PROFILE_OWNER -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.isNotProfileOwner)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_NO_ROOT_PERMISSION -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.noRootPermission)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_NOT_SYSTEM_APP -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.isNotSystemApp)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_NOT_DEVICE_POLICY_MANAGER -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.isNotDevicePolicyManager)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_OTHER -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.unknownError)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_DEVICE_ANDROID_VERSION_TOO_LOW -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.sysVerLow)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_INSUFFICIENT_PERMISSION -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.insufficientPermission)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 674..679
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            FUFSinglePackage.ERROR_NO_SUCH_API_MODE -> {
                showPreProcessFUFResultAndShowToastAndReturnIfResultBelongsSuccess(
                    context, context.getString(R.string.noSuchApiMode)
                )
                false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 8 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 637..642
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 643..648
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 649..654
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 662..667
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 668..673
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 680..685
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 686..691
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 692..697

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                        ToastUtils.showToast(
                            context,
                            context.getString(R.string.exceptionHC) + e.localizedMessage
                        )
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 315..315

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                ToastUtils.showToast(context, context.getString(R.string.exception) + e.message)
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt and 1 other location - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/FUFUtils.kt on lines 377..380

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status