berict/Tapad

View on GitHub
app/src/main/java/com/bedrock/padder/model/preset/store/Item.java

Summary

Maintainability
F
1 wk
Test Coverage

File Item.java has 820 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.bedrock.padder.model.preset.store;

import android.animation.Animator;
import android.app.Activity;
import android.app.Notification;
Severity: Major
Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 day to fix

    Method draw has 246 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void draw() {
            final PresetSchema presetSchema = getPresetSchema();
            final Preset preset = presetSchema.getPreset();
    
            // load preset image
    Severity: Major
    Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 day to fix

      Item has 50 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class Item {
      
          private static final transient String TAG = "Store.Item";
      
          private transient PresetStore presetStore = null;
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 7 hrs to fix

        Method doInBackground has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

                @Override
                protected Integer doInBackground(Void... voids) {
                    // new http file download
        
                    input = null;
        Severity: Minor
        Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method doInBackground has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                @Override
                protected Integer doInBackground(Void... voids) {
                    // new http file download
        
                    input = null;
        Severity: Major
        Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 3 hrs to fix

          Method draw has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              private void draw() {
                  final PresetSchema presetSchema = getPresetSchema();
                  final Preset preset = presetSchema.getPreset();
          
                  // load preset image
          Severity: Minor
          Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method onPostExecute has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  @Override
                  protected void onPostExecute(Integer integer) {
                      if (!isCancelled()) {
                          // Completed downloading
                          item.clear();
          Severity: Minor
          Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 hr to fix

            Method download has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void download(final Runnable onFinish, final Activity activity) {
                    // download the preset from presetStore
                    final Item item = this;
                    if (isConnected(activity)) {
                        if (isWifiConnected(activity)) {
            Severity: Minor
            Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 hr to fix

              Method onPreExecute has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      @Override
                      protected void onPreExecute() {
                          if (isConnected(activity)) {
                              // create preset project folder
                              new File(PROJECT_LOCATION_PRESETS + "/" + tag).mkdirs();
              Severity: Minor
              Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 hr to fix

                Method cancel has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        void cancel() {
                            isPresetDownloading = false;
                            if (item != null) {
                                item.setBytesTransferred(-1);
                                item.setTotalByteCount(-1);
                Severity: Minor
                Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 hr to fix

                  Method onProgressUpdate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          @Override
                          protected void onProgressUpdate(Boolean... args) {
                              // update progress
                              if (mProgress > previousProgressCount) {
                                  // less updates
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 1 hr to fix

                    Method removeLocalPreset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void removeLocalPreset(String presetName, Runnable onSuccess, Runnable onFailure) {
                            if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N_MR1) {
                                ShortcutManager shortcutManager = activity.getSystemService(ShortcutManager.class);
                                if (shortcutManager != null) {
                                    shortcutManager.removeDynamicShortcuts(Arrays.asList(presetName));
                    Severity: Minor
                    Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 55 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Method onProgressUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                            @Override
                            protected void onProgressUpdate(Boolean... args) {
                                // update progress
                                if (mProgress > previousProgressCount) {
                                    // less updates
                    Severity: Minor
                    Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Method init has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public void init(PresetStoreAdapter.PresetViewHolder vh,
                                         PresetStoreAdapter ad,
                                         PresetStore ps,
                                         Preferences prefs,
                                         Activity a) {
                    Severity: Minor
                    Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 35 mins to fix

                      Method cancel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                              void cancel() {
                                  isPresetDownloading = false;
                                  if (item != null) {
                                      item.setBytesTransferred(-1);
                                      item.setTotalByteCount(-1);
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/model/preset/store/Item.java - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                                      mBuilder.setContentTitle(item.getPreset().getAbout().getTitle())
                                              .setContentText(getStringFromId(R.string.preset_store_download_notification_text_downloading, activity))
                                              .setSmallIcon(android.R.drawable.stat_sys_download)
                                              .setLargeIcon(BitmapFactory.decodeResource(activity.getResources(), android.R.drawable.stat_sys_download))
                                              .setOngoing(true)
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 963..969

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

                      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 {
                                          mBuilder.setProgress(0, 0, false)
                                                  .setContentText(getStringFromId(R.string.preset_store_download_notification_text_failed, activity))
                                                  .setSmallIcon(android.R.drawable.stat_sys_download_done)
                                                  .setLargeIcon(BitmapFactory.decodeResource(activity.getResources(), android.R.drawable.stat_sys_download_done))
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 689..697

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

                      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

                                                      mBuilder.setContentTitle(item.getPreset().getAbout().getTitle())
                                                              .setContentText(getStringFromId(R.string.preset_store_download_notification_text_complete, activity))
                                                              .setSmallIcon(android.R.drawable.stat_sys_download_done)
                                                              .setLargeIcon(BitmapFactory.decodeResource(activity.getResources(), android.R.drawable.stat_sys_download_done))
                                                              .setOngoing(false)
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 754..760

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

                      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 (isCancelled()) {
                                          mBuilder.setProgress(0, 0, false)
                                                  .setContentText(getStringFromId(R.string.preset_store_download_notification_text_cancelled, activity))
                                                  .setSmallIcon(android.R.drawable.stat_sys_download_done)
                                                  .setLargeIcon(BitmapFactory.decodeResource(activity.getResources(), android.R.drawable.stat_sys_download_done))
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 697..705

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

                      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 {
                                          if (output != null)
                                              output.close();
                                          if (input != null)
                                              input.close();
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 849..856

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 48.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      try {
                                          if (output != null)
                                              output.close();
                                          if (input != null)
                                              input.close();
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 867..874

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 48.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  holder.download.setOnClickListener(new View.OnClickListener() {
                                      @Override
                                      public void onClick(View v) {
                                          download(new Runnable() {
                                              @Override
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 297..310

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 45.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  holder.download.setOnClickListener(new View.OnClickListener() {
                                      @Override
                                      public void onClick(View v) {
                                          download(new Runnable() {
                                              @Override
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 538..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 45.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      YoYo.with(Techniques.FadeIn)
                                              .delay(200)
                                              .duration(200)
                                              .onStart(new YoYo.AnimatorCallback() {
                                                  @Override
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 331..340
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 946..955

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                          private boolean isConnected(Context context) {
                              // returns whether the device is connected to the internet
                              ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
                      
                              NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 310..316
                      app/src/main/java/com/bedrock/padder/helper/AdMobHelper.java on lines 59..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 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  YoYo.with(Techniques.FadeIn)
                                          .delay(200)
                                          .duration(200)
                                          .onStart(new YoYo.AnimatorCallback() {
                                              @Override
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 734..743
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 946..955

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      new MaterialDialog.Builder(activity)
                                              .title(R.string.preset_store_download_data_usage_title)
                                              .content(R.string.preset_store_download_data_usage_text)
                                              .contentColorRes(R.color.dark_secondary)
                                              .positiveText(R.string.proceed_ac)
                      app/src/main/java/com/bedrock/padder/activity/PresetStoreActivity.java on lines 134..139
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 187..192
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 251..256
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 350..355
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 464..469

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                                  new MaterialDialog.Builder(activity)
                                                          .title(R.string.preset_store_action_repair_dialog_title)
                                                          .content(R.string.preset_store_action_repair_dialog_text)
                                                          .contentColorRes(R.color.dark_primary)
                                                          .positiveText(R.string.preset_store_action_repair)
                      app/src/main/java/com/bedrock/padder/activity/PresetStoreActivity.java on lines 134..139
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 187..192
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 251..256
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 173..178
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 350..355

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      YoYo.with(Techniques.FadeIn)
                                              .delay(200)
                                              .duration(200)
                                              .onStart(new YoYo.AnimatorCallback() {
                                                  @Override
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 331..340
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 734..743

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                          new MaterialDialog.Builder(activity)
                                                  .title(R.string.preset_store_gesture_help_dialog_title)
                                                  .content(R.string.preset_store_gesture_help_dialog_text)
                                                  .contentColorRes(R.color.dark_primary)
                                                  .positiveText(R.string.dialog_close)
                      app/src/main/java/com/bedrock/padder/activity/PresetStoreActivity.java on lines 134..139
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 187..192
                      app/src/main/java/com/bedrock/padder/fragment/PresetStoreOnlineFragment.java on lines 251..256
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 173..178
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 464..469

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 44.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                              YoYo.with(Techniques.FadeOut)
                                                      .duration(200)
                                                      .onEnd(new YoYo.AnimatorCallback() {
                                                          @Override
                                                          public void call(Animator animator) {
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 936..944

                      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

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

                                      YoYo.with(Techniques.FadeOut)
                                              .duration(200)
                                              .onEnd(new YoYo.AnimatorCallback() {
                                                  @Override
                                                  public void call(Animator animator) {
                      app/src/main/java/com/bedrock/padder/model/preset/store/Item.java on lines 424..432

                      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

                      There are no issues that match your filters.

                      Category
                      Status