berict/Tapad

View on GitHub

Showing 195 of 426 total issues

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

    public String getStartPage(Context... context) {
        if (this.prefs != null) {
            return prefs.getString(Keys.START_PAGE, Defaults.START_PAGE);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

    public Integer getColor(Context... context) {
        if (this.prefs != null) {
            return prefs.getInt(Keys.COLOR_CURRENT, Defaults.COLOR_CURRENT);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

    public Integer getVersionCode(Context... context) {
        if (this.prefs != null) {
            return prefs.getInt(Keys.VERSION_CODE, Defaults.VERSION_CODE);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

    public Boolean getStopLoopOnSingle(Context... context) {
        if (this.prefs != null) {
            return prefs.getBoolean(Keys.STOP_LOOP_ON_SINGLE, Defaults.STOP_LOOP_ON_SINGLE);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

    public Float getDeckMargin(Context... context) {
        if (this.prefs != null) {
            return prefs.getFloat(Keys.DECK_MARGIN, Defaults.DECK_MARGIN);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

    public String getLastPlayed(Context... context) {
        if (this.prefs != null) {
            return prefs.getString(Keys.LAST_PLAYED, Defaults.LAST_PLAYED);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 46..56
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116

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

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

    public Boolean getStopOnFocusLoss(Context... context) {
        if (this.prefs != null) {
            return prefs.getBoolean(Keys.STOP_ON_FOCUS_LOSS, Defaults.STOP_ON_FOCUS_LOSS);
        } else if (context != null && context.length > 0) {
            this.prefs = context[0].getSharedPreferences(APPLICATION_ID, Context.MODE_PRIVATE);
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 34..44
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 58..68
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 70..80
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 82..92
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 106..116
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 118..128

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

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

        left.setSoundListener(new Sound.SoundListener() {
            @Override
            public void onSoundStart(Sound sound, int playingThreadCount) {
                threadCount++;
                if (threadCount == 1 && !padColorOnPlay) {
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 75..100
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 102..127
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 129..154

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

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

        down.setSoundListener(new Sound.SoundListener() {
            @Override
            public void onSoundStart(Sound sound, int playingThreadCount) {
                threadCount++;
                if (threadCount == 1 && !padColorOnPlay) {
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 75..100
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 102..127
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 156..181

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

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

        up.setSoundListener(new Sound.SoundListener() {
            @Override
            public void onSoundStart(Sound sound, int playingThreadCount) {
                threadCount++;
                if (threadCount == 1 && !padColorOnPlay) {
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 102..127
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 129..154
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 156..181

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

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

        right.setSoundListener(new Sound.SoundListener() {
            @Override
            public void onSoundStart(Sound sound, int playingThreadCount) {
                threadCount++;
                if (threadCount == 1 && !padColorOnPlay) {
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 75..100
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 129..154
app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java on lines 156..181

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

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 (item[position].getHint(context).startsWith("http")) {
                // link available check
                anim.circularRevealTouch(holder.itemLayout, R.id.layout_placeholder,
                        new AccelerateDecelerateInterpolator(), new Runnable() {
                            @Override
app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java on lines 92..102

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

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 (item[position].getHint(context).startsWith("http")) {
                // link available check
                anim.circularRevealTouch(holder.itemLayout, R.id.layout_placeholder,
                        new AccelerateDecelerateInterpolator(), new Runnable() {
                            @Override
app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java on lines 107..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 95.

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 "info_tapad_others_translate":
                exceptionalRunnable = new Runnable() {
                    @Override
                    public void run() {
                        new MaterialDialog.Builder(activity)
app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java on lines 404..423

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

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 "info_berict_action_contribute":
                exceptionalRunnable = new Runnable() {
                    @Override
                    public void run() {
                        new MaterialDialog.Builder(activity)
app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java on lines 336..355

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

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

    public void setVisible(final int viewId, final int delay, final Activity activity) {
        final View view = activity.findViewById(viewId);
        if (view != null) {
            if (delay > 0) {
                Handler handler = new Handler();
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 185..200
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 202..217

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

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

    public void setInvisible(final int viewId, final int delay, final Activity activity) {
        final View view = activity.findViewById(viewId);
        if (view != null) {
            if (delay > 0) {
                Handler handler = new Handler();
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 168..183
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 202..217

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

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

    public void setGone(final int viewId, final int delay, final Activity activity) {
        final View view = activity.findViewById(viewId);
        if (view != null) {
            if (delay > 0) {
                Handler handler = new Handler();
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 168..183
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 185..200

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

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

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

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

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

Refactorings

Further Reading

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

            try {
                ActivityManager.TaskDescription taskDesc =
                        new ActivityManager.TaskDescription(
                                activity.getResources().getString(titleId),
                                icon,
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 251..266

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

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

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

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

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

Refactorings

Further Reading

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

            try {
                ActivityManager.TaskDescription taskDesc =
                        new ActivityManager.TaskDescription(
                                activity.getResources().getString(titleId),
                                icon,
app/src/main/java/com/bedrock/padder/helper/WindowHelper.java on lines 284..299

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language