berict/Tapad

View on GitHub
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java

Summary

Maintainability
D
2 days
Test Coverage

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

    public void setStopLoopOnSingle(Boolean value) {
        if (this.prefs != null) {
            if (prefs.edit().putBoolean(Keys.STOP_LOOP_ON_SINGLE, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.STOP_LOOP_ON_SINGLE + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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 void setVersionCode(Integer value) {
        if (this.prefs != null) {
            if (prefs.edit().putInt(Keys.VERSION_CODE, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.VERSION_CODE + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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 void setDeckMargin(Float value) {
        if (this.prefs != null) {
            if (prefs.edit().putFloat(Keys.DECK_MARGIN, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.DECK_MARGIN + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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 void setStartPage(String value) {
        if (this.prefs != null) {
            if (prefs.edit().putString(Keys.START_PAGE, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.START_PAGE + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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 void setColor(Integer value) {
        if (this.prefs != null) {
            if (prefs.edit().putInt(Keys.COLOR_CURRENT, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.COLOR_CURRENT + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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 void setLastPlayed(String value) {
        if (this.prefs != null) {
            if (prefs.edit().putString(Keys.LAST_PLAYED, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.LAST_PLAYED + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 165..175
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235

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

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 void setStopOnFocusLoss(Boolean value) {
        if (this.prefs != null) {
            if (prefs.edit().putBoolean(Keys.STOP_ON_FOCUS_LOSS, value).commit()) {
                Log.i("Preferences", "Added value [" + value + "] to key [" + Keys.STOP_ON_FOCUS_LOSS + "]");
            } else {
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 153..163
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 177..187
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 189..199
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 201..211
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 225..235
app/src/main/java/com/bedrock/padder/model/preferences/Preferences.java on lines 237..247

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

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

There are no issues that match your filters.

Category
Status