Playhi/FreezeYou

View on GitHub
app/src/main/java/cf/playhi/freezeyou/Main.java

Summary

Maintainability
D
3 days
Test Coverage

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

                case SORT_BY_FF_ASCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> freezeTimesMap = getFreezeTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 511..541
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 635..665

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

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

                case SORT_BY_FF_DESCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> freezeTimesMap1 = getFreezeTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 542..572
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 666..696

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

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

                case SORT_BY_US_DESCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> useTimesMap = getUseTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 542..572
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 604..634

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

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

                case SORT_BY_US_ASCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> useTimesMap1 = getUseTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 511..541
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 573..603

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

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

                case SORT_BY_UF_DESCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> uFreezeTimesMapTimesMap = getUFreezeTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 604..634
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 666..696

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

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

                case SORT_BY_UF_ASCENDING:
                    setSortByDefault(AppList);
                    final HashMap<String, Integer> ufTimesMap = getUFreezeTimesMap();
                    Collections.sort(AppList, new Comparator<Map<String, Object>>() {
                        @Override
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 2 other locations - About 3 hrs to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 573..603
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 635..665

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

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

            case "OS":
                for (int i = 0; i < size; i++) {
                    packageInfo1 = packageInfo.get(i);
                    if ((packageInfo1.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == ApplicationInfo.FLAG_SYSTEM) {
                        Map<String, Object> keyValuePair = processAppStatus(
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 455..472

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

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

            case "OU":
                for (int i = 0; i < size; i++) {
                    packageInfo1 = packageInfo.get(i);
                    if ((packageInfo1.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != ApplicationInfo.FLAG_SYSTEM) {
                        Map<String, Object> keyValuePair = processAppStatus(
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 437..454

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

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

    private void processRemoveFromOneKeyList(String s) {
        int size = selectedPackages.size();
        for (int i = 0; i < size; i++) {
            if (!removeFromOneKeyList(getApplicationContext(), s, selectedPackages.get(i))) {
                showToast(Main.this, selectedPackages.get(i) + getString(R.string.failed));
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1413..1421

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

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

    private void processAddToOneKeyList(String string) {
        int size = selectedPackages.size();
        for (int i = 0; i < size; i++) {
            if (!addToOneKeyList(getApplicationContext(), string, selectedPackages.get(i))) {
                showToast(Main.this, selectedPackages.get(i) + getString(R.string.failed));
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 1 hr to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1423..1431

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

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

                    case APPListViewOnClickMode_autoUFOrFreezeAndRun:
                        if (realGetFrozenStatus(Main.this, pkgName, null)) {
                            processUnfreezeAction(
                                    Main.this, pkgName, null, null,
                                    true, false, null, false);
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 55 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1042..1052

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

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

                    case APPListViewOnClickMode_autoUFOrFreeze:
                        if (realGetFrozenStatus(Main.this, pkgName, null)) {
                            processUnfreezeAction(
                                    Main.this, pkgName, null, null,
                                    false, false, null, false);
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 55 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1088..1098

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

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 (cursor.moveToFirst()) {
                        for (int i = 0; i < cursor.getCount(); i++) {
                            if (label.equals(cursor.getString(cursor.getColumnIndex("label")))) {
                                alreadyExists = true;
                                break;
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 55 mins to fix
app/src/main/java/cf/playhi/freezeyou/utils/Support.java on lines 159..167

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

                search_editText.addTextChangedListener(new TextWatcher() {
                    @Override
                    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

                    }
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 50 mins to fix
app/src/main/java/cf/playhi/freezeyou/ui/FUFLauncherShortcutCreator.java on lines 127..146

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

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

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

                                                    createShortCut(
                                                            getApplicationLabel(Main.this, null, null, pkgName),
                                                            pkgName,
                                                            getApplicationIcon(
                                                                    Main.this,
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 1567..1578

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

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

            createShortCut(
                    getApplicationLabel(Main.this, null, null, pkgName),
                    pkgName,
                    getApplicationIcon(
                            Main.this,
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 983..994

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

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

    private void saveOnClickFunctionStatus(int status) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        if (sharedPreferences.getBoolean(
                saveOnClickFunctionStatus.name(), saveOnClickFunctionStatus.defaultValue())) {
            sharedPreferences.edit().putInt("onClickFunctionStatus", status).apply();
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1520..1525

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

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

    private void saveSortMethodStatus(int status) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        if (sharedPreferences.getBoolean(saveSortMethodStatus.name(), saveSortMethodStatus.defaultValue())) {
            sharedPreferences.edit().putInt("sortMethodStatus", status).apply();
        }
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1512..1518

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

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

                    case R.id.menu_sB_us_descending:
                        AccessibilityUtils.checkAndRequestIfAccessibilitySettingsOff(this);
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 2113..2122

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

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

                    case R.id.menu_sB_us_ascending:
                        AccessibilityUtils.checkAndRequestIfAccessibilitySettingsOff(this);
                        new Thread(new Runnable() {
                            @Override
                            public void run() {
Severity: Minor
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 1 other location - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 2123..2132

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_removeFromOUFList:
                        showToast(Main.this, removeFromOneKeyList(Main.this, getString(R.string.sOneKeyUFApplicationList), pkgName) ? R.string.removed : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1099..1101
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1102..1104
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1105..1107
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1111..1113
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1114..1116

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_addToOFList:
                        showToast(Main.this, addToOneKeyList(Main.this, getString(R.string.sAutoFreezeApplicationList), pkgName) ? R.string.added : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1102..1104
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1105..1107
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1108..1110
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1111..1113
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1114..1116

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_addToFOQList:
                        showToast(Main.this, addToOneKeyList(Main.this, getString(R.string.sFreezeOnceQuit), pkgName) ? R.string.added : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1099..1101
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1102..1104
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1105..1107
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1108..1110
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1114..1116

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_addToOUFList:
                        showToast(Main.this, addToOneKeyList(Main.this, getString(R.string.sOneKeyUFApplicationList), pkgName) ? R.string.added : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1099..1101
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1102..1104
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1108..1110
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1111..1113
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1114..1116

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_removeFromOFList:
                        showToast(Main.this, removeFromOneKeyList(Main.this, getString(R.string.sAutoFreezeApplicationList), pkgName) ? R.string.removed : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1099..1101
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1105..1107
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1108..1110
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1111..1113
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1114..1116

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

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Invalid

                    case APPListViewOnClickMode_removeFromFOQList:
                        showToast(Main.this, removeFromOneKeyList(Main.this, getString(R.string.sFreezeOnceQuit), pkgName) ? R.string.removed : R.string.failed);
                        break;
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 5 other locations - About 35 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1099..1101
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1102..1104
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1105..1107
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1108..1110
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1111..1113

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlyOnekeyShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.onlyOnekey),
                                "OO",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlyFrozenShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.onlyFrozen),
                                "OF",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlyUAShortcut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.onlyUA),
                                "OU",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOneKeyFreezeShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.oneKeyFreeze),
                                "cf.playhi.freezeyou.extra.fuf",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlySAShortcut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.onlySA),
                                "OS",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOneKeyUFShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.oneKeyUF),
                                "cf.playhi.freezeyou.extra.fuf",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createUnfrozenUAShortcut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.unfrozenUA),
                                "UFU",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlyOnekeyUFShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.oneKeyUF),
                                "OOU",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOneKeyLockScreenShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.oneKeyLockScreen),
                                "cf.playhi.freezeyou.extra.oklock",
                                getResources().getDrawable(R.drawable.screenlock),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createOnlyUFShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.onlyUF),
                                "UF",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1862..1870
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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 11 locations. Consider refactoring.
Invalid

                    case R.id.menu_createFreezeOnceQuitShortCut:
                        checkSettingsAndRequestCreateShortcut(
                                getString(R.string.freezeOnceQuit),
                                "FOQ",
                                getResources().getDrawable(R.mipmap.ic_launcher_round),
Severity: Major
Found in app/src/main/java/cf/playhi/freezeyou/Main.java and 10 other locations - About 30 mins to fix
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1799..1807
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1808..1816
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1817..1825
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1826..1834
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1835..1843
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1844..1852
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1853..1861
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1871..1879
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1880..1888
app/src/main/java/cf/playhi/freezeyou/Main.java on lines 1889..1897

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

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