berict/Tapad

View on GitHub
app/src/main/java/com/bedrock/padder/activity/MainActivity.java

Summary

Maintainability
F
1 wk
Test Coverage

File MainActivity.java has 766 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.bedrock.padder.activity;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
Severity: Major
Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 1 day to fix

    MainActivity has 53 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class MainActivity
            extends AppCompatActivity
            implements AboutFragment.OnFragmentInteractionListener {
    
        public static final String TAG = "MainActivity";
    Severity: Major
    Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 7 hrs to fix

      Method onCreate has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
      
      
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 7 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 showTutorial has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          private void showTutorial() {
              final ImageView tutorialToolbar = findViewById(R.id.toolbar_tutorial_icon);
      
              if (isTutorialVisible == false) {
                  isTutorialVisible = true;
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.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 onCreate has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_main);
      
      
      Severity: Major
      Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 3 hrs to fix

        Method setToolbar has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void setToolbar() {
                // set bottom margin
                w.setMarginRelativePX(R.id.toolbar, 0, 0, 0, w.getNavigationBarFromPrefs(a), a);
        
                View info = findViewById(R.id.toolbar_info);
        Severity: Major
        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 3 hrs to fix

          Method onWindowFocusChanged has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void onWindowFocusChanged(boolean hasFocus) {
                  Log.i("MainActivity", "onWindowFocusChanged");
          
                  if (preferences.getStopOnFocusLoss()) {
          Severity: Major
          Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 2 hrs to fix

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

                private void setButtonLayout() {
                    int screenWidthPx = (int) (w.getWindowWidthPx(a) * preferences.getDeckMargin());
                    int marginPx = w.getWindowWidthPx(a) / 160;
                    int newWidthPx;
                    int newHeightPx;
            Severity: Minor
            Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.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 showTutorial has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void showTutorial() {
                    final ImageView tutorialToolbar = findViewById(R.id.toolbar_tutorial_icon);
            
                    if (isTutorialVisible == false) {
                        isTutorialVisible = true;
            Severity: Major
            Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 2 hrs to fix

              Method onWindowFocusChanged has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public void onWindowFocusChanged(boolean hasFocus) {
                      Log.i("MainActivity", "onWindowFocusChanged");
              
                      if (preferences.getStopOnFocusLoss()) {
              Severity: Minor
              Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.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 setButtonLayout has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void setButtonLayout() {
                      int screenWidthPx = (int) (w.getWindowWidthPx(a) * preferences.getDeckMargin());
                      int marginPx = w.getWindowWidthPx(a) / 160;
                      int newWidthPx;
                      int newHeightPx;
              Severity: Minor
              Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 1 hr to fix

                Method checkVersion has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private void checkVersion() {
                        try {
                            currentVersionCode = a.getPackageManager().getPackageInfo(a.getPackageName(), 0).versionCode;
                            Log.i("versionCode", "versionCode retrieved = " + String.valueOf(currentVersionCode));
                        } catch (android.content.pm.PackageManager.NameNotFoundException e) {
                Severity: Minor
                Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 1 hr to fix

                  Method onResume has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public void onResume() {
                          super.onResume();
                  
                          Log.d("MainActivity", "onResume");
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 1 hr to fix

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

                        private void setPresetInfo() {
                            if (isAboutVisible == false && currentPreset != null) {
                                themeColor = currentPreset.getAbout().getColor();
                                toolbar.setActionBarTitle(0);
                                toolbar.setActionBarColor(themeColor, a);
                    Severity: Minor
                    Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 1 hr to fix

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

                          @Override
                          public void onBackPressed() {
                              Log.i("BackPressed", "isAboutVisible " + String.valueOf(isAboutVisible));
                              if (isToolbarVisible == true) {
                                  if (isAboutVisible) {
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.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

                      Avoid deeply nested control flow statements.
                      Open

                                              if (tutorial == null) {
                                                  tutorial = new Tutorial(currentPreset.getTag(), a);
                                                  tutorial.setTutorialListener(new Tutorial.TutorialListener() {
                                                      @Override
                                                      public void onLoadStart(Tutorial tutorial) {
                      Severity: Major
                      Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java - About 45 mins to fix

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

                            private void checkVersion() {
                                try {
                                    currentVersionCode = a.getPackageManager().getPackageInfo(a.getPackageName(), 0).versionCode;
                                    Log.i("versionCode", "versionCode retrieved = " + String.valueOf(currentVersionCode));
                                } catch (android.content.pm.PackageManager.NameNotFoundException e) {
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.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

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

                                    final View buttonViews[] = {
                                            a.findViewById(R.id.btn00),
                                            a.findViewById(R.id.tgl1),
                                            a.findViewById(R.id.tgl2),
                                            a.findViewById(R.id.tgl3),
                        app/src/main/java/com/bedrock/padder/helper/SoundHelper.java on lines 350..376
                        app/src/main/java/com/bedrock/padder/helper/SoundHelper.java on lines 444..470

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

                        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

                                int buttons[][] = {
                                        // first row is root view
                                        {R.id.ver0, R.id.tgl1, R.id.tgl2, R.id.tgl3, R.id.tgl4, R.id.btn00},
                                        {R.id.ver1, R.id.btn11, R.id.btn12, R.id.btn13, R.id.btn14, R.id.tgl5},
                                        {R.id.ver2, R.id.btn21, R.id.btn22, R.id.btn23, R.id.btn24, R.id.tgl6},
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 549..556

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

                        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

                                int tutorialButtons[][] = {
                                        // first row is root view
                                        {R.id.ver0_tutorial, R.id.tgl1_tutorial, R.id.tgl2_tutorial, R.id.tgl3_tutorial, R.id.tgl4_tutorial, R.id.btn00_tutorial},
                                        {R.id.ver1_tutorial, R.id.btn11_tutorial, R.id.btn12_tutorial, R.id.btn13_tutorial, R.id.btn14_tutorial, R.id.tgl5_tutorial},
                                        {R.id.ver2_tutorial, R.id.btn21_tutorial, R.id.btn22_tutorial, R.id.btn23_tutorial, R.id.btn24_tutorial, R.id.tgl6_tutorial},
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 540..547

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

                        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

                                settings.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View v) {
                                        anim.circularRevealInPx(R.id.placeholder,
                                                coordinate[2], coordinate[3],
                        app/src/main/java/com/bedrock/padder/fragment/AboutFragment.java on lines 245..255

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

                        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

                                            if (preferences.getLastPlayed() != null) {
                                                try {
                                                    currentPreset = gson.fromJson(file.getStringFromFile(getCurrentPresetLocation() + "/about/json"), PresetSchema.class).getPreset();
                                                    if (!file.isPresetAvailable(currentPreset)) {
                                                        // preset corrupted or doesn't exist
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 184..196
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 221..233

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

                                            if (preferences.getLastPlayed() != null) {
                                                try {
                                                    currentPreset = gson.fromJson(file.getStringFromFile(getCurrentPresetLocation() + "/about/json"), PresetSchema.class).getPreset();
                                                    if (!file.isPresetAvailable(currentPreset)) {
                                                        // preset corrupted or doesn't exist
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 167..179
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 221..233

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

                                            if (preferences.getLastPlayed() != null) {
                                                try {
                                                    currentPreset = gson.fromJson(file.getStringFromFile(getCurrentPresetLocation() + "/about/json"), PresetSchema.class).getPreset();
                                                    if (!file.isPresetAvailable(currentPreset)) {
                                                        // preset corrupted or doesn't exist
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 167..179
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 184..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 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

                                        anim.circularRevealInPx(R.id.placeholder,
                                                coordinate[0], coordinate[1],
                                                (int) Math.hypot(coordinate[0], coordinate[1]) + 200, 0, new AccelerateDecelerateInterpolator(),
                                                circularRevealDuration, 200, a);
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java and 1 other location - About 45 mins to fix
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 856..859

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

                        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

                                    anim.circularRevealInPx(R.id.placeholder,
                                            coordinate[2], coordinate[3],
                                            (int) Math.hypot(coordinate[2], coordinate[3]) + 200, 0, new AccelerateDecelerateInterpolator(),
                                            circularRevealDuration, 200, a);
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java and 1 other location - About 45 mins to fix
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 869..872

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

                        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

                                preset.setOnTouchListener(new View.OnTouchListener() {
                                    @Override
                                    public boolean onTouch(View v, MotionEvent event) {
                                        coordinate[0] = (int) event.getRawX();
                                        coordinate[1] = (int) event.getRawY();
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 639..647
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 699..707
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 717..725
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1176..1184
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1203..1211

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

                        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

                                tutorial.setOnTouchListener(new View.OnTouchListener() {
                                    @Override
                                    public boolean onTouch(View v, MotionEvent event) {
                                        coordinate[0] = (int) event.getRawX();
                                        coordinate[1] = (int) event.getRawY();
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 639..647
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 674..682
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 717..725
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1176..1184
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1203..1211

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

                        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

                                info.setOnTouchListener(new View.OnTouchListener() {
                                    @Override
                                    public boolean onTouch(View v, MotionEvent event) {
                                        coordinate[0] = (int) event.getRawX();
                                        coordinate[1] = (int) event.getRawY();
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 674..682
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 699..707
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 717..725
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1176..1184
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1203..1211

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

                        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

                                settings.setOnTouchListener(new View.OnTouchListener() {
                                    @Override
                                    public boolean onTouch(View v, MotionEvent event) {
                                        coordinate[2] = (int) event.getRawX();
                                        coordinate[3] = (int) event.getRawY();
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 639..647
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 674..682
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 699..707
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1176..1184
                        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 1203..1211

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

                        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 == 0) {
                                                ((TextView) a.findViewById(buttons[i][j])).setTextSize(TypedValue.COMPLEX_UNIT_PX, (float) (newHeightPx / 3));
                                            }
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java and 1 other location - About 35 mins to fix
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 573..575

                        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

                                            if (i != 0) {
                                                ((TextView) a.findViewById(buttons[i][j])).setTextSize(TypedValue.COMPLEX_UNIT_PX, (float) (newWidthPx / 3));
                                            }
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java and 1 other location - About 35 mins to fix
                        app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 581..583

                        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

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

                                w.setMarginRelativePX(R.id.fab, 0, 0, w.convertDPtoPX(20, a), w.getNavigationBarFromPrefs(a) + w.convertDPtoPX(20, a), a);
                        Severity: Minor
                        Found in app/src/main/java/com/bedrock/padder/activity/MainActivity.java and 1 other location - About 30 mins to fix
                        app/src/main/java/com/bedrock/padder/activity/PresetStoreActivity.java on lines 392..395

                        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

                        There are no issues that match your filters.

                        Category
                        Status