mrksbrg/RacketGhost

View on GitHub

Showing 18 of 42 total issues

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

    public CourtPosition serve()
    {
        CourtPosition servePos = null;
        if (sixPoint) {
            switch (rand.nextInt(6)) {
Severity: Major
Found in app/src/main/java/com/markusborg/logic/GhostPlayer.java and 1 other location - About 3 hrs to fix
app/src/main/java/com/markusborg/logic/GhostPlayer.java on lines 82..125

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

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

    public CourtPosition nextStrike()
    {
        CourtPosition strikePos = null;
        if (sixPoint) {
            switch (rand.nextInt(6)) {
Severity: Major
Found in app/src/main/java/com/markusborg/logic/GhostPlayer.java and 1 other location - About 3 hrs to fix
app/src/main/java/com/markusborg/logic/GhostPlayer.java on lines 29..72

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

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 {
            //Inflate the custom view
            LayoutInflater inflater = callingActivity.getLayoutInflater();
            about = inflater.inflate(R.layout.about_box, (ViewGroup) callingActivity.findViewById(R.id.aboutView));
            tvAbout = (TextView) about.findViewById(R.id.aboutText);
Severity: Major
Found in app/src/main/java/com/markusborg/ui/HelpBox.java and 1 other location - About 1 hr to fix
app/src/main/java/com/markusborg/ui/AboutBox.java on lines 33..41

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

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 {
            //Inflate the custom view
            LayoutInflater inflater = callingActivity.getLayoutInflater();
            about = inflater.inflate(R.layout.about_box, (ViewGroup) callingActivity.findViewById(R.id.aboutView));
            tvAbout = (TextView) about.findViewById(R.id.aboutText);
Severity: Major
Found in app/src/main/java/com/markusborg/ui/AboutBox.java and 1 other location - About 1 hr to fix
app/src/main/java/com/markusborg/ui/HelpBox.java on lines 32..40

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

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

        new AlertDialog.Builder(callingActivity)
                .setTitle(callingActivity.getString(R.string.action_about) + " " + callingActivity.getString(R.string.app_name))
                .setCancelable(true)
                .setIcon(R.mipmap.ic_launcher)
                .setPositiveButton("OK", null)
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/AboutBox.java and 1 other location - About 50 mins to fix
app/src/main/java/com/markusborg/ui/HelpBox.java on lines 46..52

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

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

        new AlertDialog.Builder(callingActivity)
                .setTitle(callingActivity.getString(R.string.app_name) + " " + callingActivity.getString(R.string.action_help))
                .setCancelable(true)
                .setIcon(R.mipmap.ic_launcher)
                .setPositiveButton("OK", null)
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/HelpBox.java and 1 other location - About 50 mins to fix
app/src/main/java/com/markusborg/ui/AboutBox.java on lines 47..53

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

                else if (cornerToFlash.equals("L_MID")) {
                    ball = (ImageView) findViewById(R.id.ballLeftMid);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[5], 1.0f, 0.1f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 411..416
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 399..404
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 393..398
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 387..392
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 381..386

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

                else if (cornerToFlash.equals("L_BACK")) {
                    ball = (ImageView) findViewById(R.id.ballLeftBack);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[4], 1.0f, 0.1f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 411..416
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 405..410
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 399..404
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 387..392
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 381..386

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

                case R.id.seekBarReps:
                    tmp = (TextView) findViewById(R.id.txtReps);
                    tmp.setText("Reps: " + (seekBar.getProgress() + 1));
                    break;
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/MainActivity.java and 1 other location - About 35 mins to fix
app/src/main/java/com/markusborg/ui/MainActivity.java on lines 280..283

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

                else {
                    ball = (ImageView) findViewById(R.id.ballRightMid);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[2], 0.1f, 1.0f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 405..410
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 399..404
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 393..398
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 387..392
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 381..386

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

                else if (cornerToFlash.equals("R_FRONT")) {
                    ball = (ImageView) findViewById(R.id.ballRightFront);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[1], 0.1f, 1.0f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 411..416
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 405..410
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 399..404
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 393..398
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 381..386

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

                if (cornerToFlash.equals("L_FRONT")) {
                    ball = (ImageView) findViewById(R.id.ballLeftFront);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[0], 1.0f, 0.1f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 411..416
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 405..410
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 399..404
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 393..398
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 387..392

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

                case R.id.seekBarSets:
                    tmp = (TextView) findViewById(R.id.txtSets);
                    tmp.setText("Sets: " + (seekBar.getProgress() + 1));
                    break;
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/MainActivity.java and 1 other location - About 35 mins to fix
app/src/main/java/com/markusborg/ui/MainActivity.java on lines 284..287

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

                else if (cornerToFlash.equals("R_BACK")) {
                    ball = (ImageView) findViewById(R.id.ballRightBack);
                    if (mLoaded) {
                        mSoundPool.play(mSoundIDs[3], 0.1f, 1.0f, 1, 0, 1.0f);
                    }
Severity: Major
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 5 other locations - About 35 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 411..416
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 405..410
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 393..398
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 387..392
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 381..386

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

            else {
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    ballIcon = getBallIconNew(1);
                } else {
                    ballIcon = getBallIconOld(1);
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/SessionAdapter.java and 1 other location - About 30 mins to fix
app/src/main/java/com/markusborg/ui/SessionAdapter.java on lines 56..63

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

            if (i.isSquash()) {
                // getDrawable changed with API 22
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                    ballIcon = getBallIconNew(0);
                } else {
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/SessionAdapter.java and 1 other location - About 30 mins to fix
app/src/main/java/com/markusborg/ui/SessionAdapter.java on lines 64..70

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

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            ballIcon = getBallIconNew(ballType);
        } else {
            ballIcon = getBallIconOld(ballType);
        }
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 1 other location - About 30 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 166..171

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

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 (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            d = getBackgroundImageNew(BADMINTON_MODE);
        }
        else {
            d = getBackgroundImageOld(BADMINTON_MODE);
Severity: Minor
Found in app/src/main/java/com/markusborg/ui/GhostingActivity.java and 1 other location - About 30 mins to fix
app/src/main/java/com/markusborg/ui/GhostingActivity.java on lines 140..144

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

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