coding-blocks/DigitalOceanApp

View on GitHub

Showing 47 of 1,612 total issues

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

                "{\n" +
                        "  \"sizes\": [\n" +
                        "    {\n" +
                        "      \"slug\": \"512mb\",\n" +
                        "      \"memory\": 512,\n" +
doandroidlib/src/main/java/in/tosc/doandroidlib/mockapi/MockResponses.java on lines 363..551

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

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

                "{\n" +
                        "  \"regions\": [\n" +
                        "    {\n" +
                        "      \"name\": \"New York 1\",\n" +
                        "      \"slug\": \"nyc1\",\n" +
doandroidlib/src/main/java/in/tosc/doandroidlib/mockapi/MockResponses.java on lines 134..322

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

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.switch_private_network:
                if (isChecked) {
                    doaClient.performAction(droplet.getId(),
                            ActionType.ENABLE_PRIVATE_NETWORKING,
                            null)
app/src/main/java/in/tosc/digitaloceanapp/activities/DetailDropletActivity.java on lines 200..240

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

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.switch_ipv6:
                if (isChecked) {
                    doaClient.performAction(droplet.getId(), ActionType.ENABLE_IPV6, null)
                            .enqueue(new Callback<Action>() {
                                @Override
app/src/main/java/in/tosc/digitaloceanapp/activities/DetailDropletActivity.java on lines 242..282

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

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

    class DataCenterViewHolder extends RecyclerView.ViewHolder {

        TextView countryName;
        ImageView img;
        LinearLayout countryLayout;
app/src/main/java/in/tosc/digitaloceanapp/adapters/ImageAdapter.java on lines 150..163

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

    class ViewHolder extends RecyclerView.ViewHolder {
        ImageView imageImage;
        TextView imageName;
        TextView imageDistribution;
        CardView imageCard;
app/src/main/java/in/tosc/digitaloceanapp/adapters/DataCenterAdapter.java on lines 121..139

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

        doClient.getImages(1, 100, "distribution").enqueue(new Callback<Images>() {
            @Override
            public void onResponse(Call<Images> call, Response<Images> response) {
                imageList = response.body().getImages();
                imageAdapter = new ImageAdapter(imageList, getContext());
app/src/main/java/in/tosc/digitaloceanapp/fragments/SelectSizeFragment.java on lines 46..59

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

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

        doClient.getSizes().enqueue(new Callback<Sizes>() {
            @Override
            public void onResponse(Call<Sizes> call, Response<Sizes> response) {
                sizeList = response.body().getSizes();
                selectSizeAdapter = new SelectSizeAdapter(sizeList, getContext());
app/src/main/java/in/tosc/digitaloceanapp/fragments/SelectImageFragment.java on lines 52..65

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

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

  public static ActionType fromValue(String value) {
    if (null == value || "".equals(value)) {
      throw new IllegalArgumentException("Value cannot be null or empty!");
    }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

    public static PeriodType fromValue(String value) {
        if (null == value || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

  public static ImageType fromValue(String value) {
    if (null == value || "".equals(value)) {
      throw new IllegalArgumentException("Value cannot be null or empty!");
    }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

    public static StatisticsType fromValue(String value) {
        if (null == value || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73

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

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

  public static ResourceType fromValue(String value) {
    if (null == value || "".equals(value)) {
      throw new IllegalArgumentException("Value cannot be null or empty!");
    }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

  public static ActionStatus fromValue(String value) {
    if (null == value || "".equals(value)) {
      throw new IllegalArgumentException("Value cannot be null or empty!");
    }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/DropletStatus.java on lines 59..71
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

  public static DropletStatus fromValue(String value) {
    if (null == value || "".equals(value)) {
      throw new IllegalArgumentException("Value cannot be null or empty!");
    }

doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionStatus.java on lines 55..67
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ActionType.java on lines 133..145
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ImageType.java on lines 60..72
doandroidlib/src/main/java/in/tosc/doandroidlib/common/PeriodType.java on lines 31..43
doandroidlib/src/main/java/in/tosc/doandroidlib/common/ResourceType.java on lines 61..73
doandroidlib/src/main/java/in/tosc/doandroidlib/common/StatisticsType.java on lines 28..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 70.

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

    @Before
    public void setUp() {
        aboutActivity = activityRule.getActivity();
        Runnable wakeUpDevice = new Runnable() {
            public void run() {
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/DropletActivityTest.java on lines 45..56
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/DropletCreateActivityTest.java on lines 32..46

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

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

    @Before
    public void setUp() {
        dropletCreateActivity = actRule.getActivity();
        Runnable wakeUpDevice = new Runnable() {
            public void run() {
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/AboutActivityTest.java on lines 39..50
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/DropletActivityTest.java on lines 45..56

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

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

    @Before
    public void setUp() {
        dropletActivity = actRule.getActivity();
        Runnable wakeUpDevice = new Runnable() {
            public void run() {
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/AboutActivityTest.java on lines 39..50
app/src/androidTest/java/in/tosc/digitaloceanapp/activities/DropletCreateActivityTest.java on lines 32..46

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

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 static DigitalOceanStatisticsClient getDOStatsClient(@NonNull String authToken) {

        if (clientId == null || callbackUrl == null) {
            (new ClientInitializationException("DigitalOcean.init() and/or DigitalOcean.onLoggedIn() wasn't called. " +
                "You need to initialize before getting access to client")).printStackTrace();
doandroidlib/src/main/java/in/tosc/doandroidlib/DigitalOcean.java on lines 167..178

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

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 static DigitalOceanClient getDOClient(@NonNull String authToken) {

        if (clientId == null || callbackUrl == null) {
            (new ClientInitializationException("DigitalOcean.init() and/or DigitalOcean.onLoggedIn() wasn't called. " +
                    "You need to initialize before getting access to client")).printStackTrace();
doandroidlib/src/main/java/in/tosc/doandroidlib/DigitalOcean.java on lines 186..196

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

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