Playhi/FreezeYou

View on GitHub
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt

Summary

Maintainability
F
3 days
Test Coverage

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

    private fun doApiV2Action(context: Context, pkgName: String, apiMode: Int): Int {
        return runBlocking {
            var result = ERROR_OTHER
            launch {
                result =
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 236..254

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

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

                } else {
                    if (FUFUtils.checkRootFrozen(context, pkgName, null)) {
                        if (FUFUtils.processRootAction(
                                pkgName, null, null,
                                context, enable = true, askRun = false, runImmediately = false,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 83..96

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

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

                    } else if (FUFUtils.checkRootFrozen(context, pkgName, null)) {
                        if (FUFUtils.processRootAction(
                                pkgName, null, null,
                                context, enable = true, askRun = false, runImmediately = false,
                                activity = null, finish = false, showUnnecessaryToast = false
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 127..142

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

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 (FUFUtils.checkMRootFrozen(context, pkgName)) {
                        if (FUFUtils.processMRootAction(
                                context, pkgName, null,
                                null, hidden = false, askRun = false,
                                runImmediately = false, activity = null,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 2 hrs to fix
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 71..83

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

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 (FUFUtils.checkMRootFrozen(context, pkgName)) {
                        if (FUFUtils.processMRootAction(
                                context, pkgName, null,
                                null, hidden = false, askRun = false,
                                runImmediately = false, activity = null,
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 2 hrs to fix
app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt on lines 105..117

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

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

    override fun query(
        uri: Uri, projection: Array<String>?, selection: String?,
        selectionArgs: Array<String>?, sortOrder: String?
    ): Cursor? {
        return null
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 21..26

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

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

            @Suppress("DEPRECATION")
            FUFMode.MODE_LEGACY_AUTO -> {
                bundle.putInt(
                    "result",
                    @Suppress("DEPRECATION")
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 179..189

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

    override fun update(
        uri: Uri,
        values: ContentValues?,
        selection: String?,
        selectionArgs: Array<String>?
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 40..47

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

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

    override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int {
        return 0
    }
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/export/Unfreeze.kt and 1 other location - About 45 mins to fix
app/src/main/java/cf/playhi/freezeyou/export/Freeze.kt on lines 36..38

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

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_ROOT_HIDE_UNHIDE -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName, FUFSinglePackage.API_FREEZEYOU_ROOT_UNHIDE_HIDE
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 155..163
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/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 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

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 -> {
                bundle.putInt(
                    "result",
                    doApiV2Action(
                        context, pkgName, FUFSinglePackage.API_FREEZEYOU_SYSTEM_APP_ENABLE_DISABLE
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 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 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/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 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 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/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 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 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

There are no issues that match your filters.

Category
Status