berict/Tapad

View on GitHub

Showing 231 of 426 total issues

Method fade has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void fade(final int id, final float startAlpha, final float endAlpha, final int delay, final long duration, String handlerName, Activity activity) {
        final AlphaAnimation fade = new AlphaAnimation(startAlpha, endAlpha);
        final View view = activity.findViewById(id);
        PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);

Severity: Major
Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 2 hrs to fix

    File Tutorial.java has 286 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.bedrock.padder.model.tutorial;
    
    import android.app.Activity;
    import android.os.AsyncTask;
    import android.os.Handler;
    Severity: Minor
    Found in app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.java - About 2 hrs to fix

      File FileHelper.java has 285 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.bedrock.padder.helper;
      
      import android.app.Activity;
      import android.content.DialogInterface;
      import android.os.AsyncTask;
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/helper/FileHelper.java - About 2 hrs to fix

        AboutFragment has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class AboutFragment extends Fragment {
        
            private WindowHelper w = new WindowHelper();
            private AdMobHelper ad = new AdMobHelper();
            private IntentHelper intent = new IntentHelper();
        Severity: Minor
        Found in app/src/main/java/com/bedrock/padder/fragment/AboutFragment.java - About 2 hrs to fix

          Method onBindViewHolder has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void onBindViewHolder(final DetailViewHolder holder, int position) {
                  holder.itemText.setText(item[position].getText(context));
          
                  if (item[position].getHint(context) == null || item[position].getHint(context).equals("")) {
          Severity: Major
          Found in app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java - About 2 hrs to fix

            File PresetStoreOnlineFragment.java has 279 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package com.bedrock.padder.fragment;
            
            import android.content.Context;
            import android.content.DialogInterface;
            import android.content.pm.PackageInfo;

              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

                Tutorial has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Tutorial {
                
                    public static TimingListener TIMING_LISTENER;
                
                    private String tag;
                Severity: Minor
                Found in app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.java - About 2 hrs to fix

                  FeedbackActivity has 24 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class FeedbackActivity extends AppCompatActivity {
                  
                      final String TAG = "FeedbackActivity";
                      String MODE_TAG = "";
                  
                  
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/activity/FeedbackActivity.java - About 2 hrs to fix

                    Method setDeckMargin has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void setDeckMargin() {
                            // deck margin
                    
                            deckMarginEditText = ((EditText) a.findViewById(R.id.layout_settings_deck_margin_input));
                            deckMarginSeekbar = ((SeekBar) a.findViewById(R.id.layout_settings_deck_margin_slider));
                    Severity: Major
                    Found in app/src/main/java/com/bedrock/padder/activity/SettingsActivity.java - About 2 hrs to fix

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

                              @Override
                              public void run() {
                                  // Current sync
                                  Sync sync = syncs.get(currentSyncIndex++);
                      
                      
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.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 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 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 onBindViewHolder has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            public void onBindViewHolder(final DetailViewHolder holder, int position) {
                                Log.d("Holder", String.valueOf(itemColor.getColorButtonRecent(position)));
                                final int color = itemColor.getColorButtonRecent(position);
                        
                        
                        Severity: Major
                        Found in app/src/main/java/com/bedrock/padder/adapter/ColorAdapter.java - About 2 hrs to fix

                          File GesturePad.java has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          package com.bedrock.padder.model.sound;
                          
                          import android.app.Activity;
                          import android.util.Log;
                          import android.view.View;
                          Severity: Minor
                          Found in app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java - About 2 hrs to fix

                            PresetStoreOnlineFragment has 22 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public class PresetStoreOnlineFragment extends Fragment implements Refreshable {
                            
                                private WindowHelper window = new WindowHelper();
                                private AnimateHelper anim = new AnimateHelper();
                                private ApiHelper api = new ApiHelper();

                              Consider simplifying this complex logical expression.
                              Open

                                      if (preset != null) {
                                          String presetName = preset.getTag();
                                          // preset available
                                          File folderSound = new File(PROJECT_LOCATION_PRESETS + "/" + presetName + "/sounds");
                                          File folderTiming = new File(PROJECT_LOCATION_PRESETS + "/" + presetName + "/timing");
                              Severity: Critical
                              Found in app/src/main/java/com/bedrock/padder/helper/FileHelper.java - About 2 hrs to fix

                                Method onFling has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        @Override
                                        public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                                            boolean result = false;
                                            try {
                                                float diffY = e2.getY() - e1.getY();
                                Severity: Minor
                                Found in app/src/main/java/com/bedrock/padder/helper/OnSwipeTouchListener.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

                                File AboutFragment.java has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                package com.bedrock.padder.fragment;
                                
                                import android.content.Context;
                                import android.net.Uri;
                                import android.os.Bundle;
                                Severity: Minor
                                Found in app/src/main/java/com/bedrock/padder/fragment/AboutFragment.java - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language