berict/Tapad

View on GitHub

Showing 231 of 426 total issues

File IntentHelper.java has 387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.bedrock.padder.helper;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/IntentHelper.java - About 5 hrs to fix

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

        public void setPresetInfo() {
            toolbar.setActionBar(a, v);
            toolbar.setActionBarTitle(R.string.about);
            toolbar.setActionBarPadding(a, v);
            toolbar.setActionBarDisplayHomeAsUpIcon(R.drawable.ic_close_white);
    Severity: Major
    Found in app/src/main/java/com/bedrock/padder/fragment/AboutFragment.java - About 5 hrs to fix

      File PresetStoreActivity.java has 375 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package com.bedrock.padder.activity;
      
      import android.Manifest;
      import android.app.Activity;
      import android.content.pm.PackageManager;

        Method setAdapter has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void setAdapter() {
                if (isPresetDownloading) {
                    // attach adapter while its not null
                    presetStoreAdapter = new PresetStoreAdapter(
                            online,

          Method initListener has 115 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void initListener() {
                  normal.setSoundListener(new Sound.SoundListener() {
                      @Override
                      public void onSoundStart(Sound sound, int playingThreadCount) {
                          threadCount++;
          Severity: Major
          Found in app/src/main/java/com/bedrock/padder/model/sound/GesturePad.java - About 4 hrs to fix

            SettingsActivity has 35 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class SettingsActivity extends AppCompatActivity {
            
                private WindowHelper w = new WindowHelper();
                private AnimateHelper anim = new AnimateHelper();
                private IntentHelper intent = new IntentHelper();
            Severity: Minor
            Found in app/src/main/java/com/bedrock/padder/activity/SettingsActivity.java - About 4 hrs to fix

              IntentHelper has 35 methods (exceeds 20 allowed). Consider refactoring.
              Open

              @SuppressWarnings("unchecked")
              
              public class IntentHelper {
                  public void intent(final Activity activity, String name, int delay) {
                      final String classname = "com.bedrock.padder." + name;
              Severity: Minor
              Found in app/src/main/java/com/bedrock/padder/helper/IntentHelper.java - About 4 hrs to fix

                File SettingsActivity.java has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                package com.bedrock.padder.activity;
                
                import android.app.Activity;
                import android.content.DialogInterface;
                import android.os.Bundle;
                Severity: Minor
                Found in app/src/main/java/com/bedrock/padder/activity/SettingsActivity.java - About 4 hrs to fix

                  Method initUi has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void initUi() {
                          switch (MODE_TAG) {
                              case "song":
                                  // layout
                                  RelativeLayout songLayout = findViewById(R.id.feedback_song);
                  Severity: Major
                  Found in app/src/main/java/com/bedrock/padder/activity/FeedbackActivity.java - About 4 hrs to fix

                    ItemAdapter has 33 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.DetailViewHolder> {
                        private Item[] item;
                        private int rowLayout;
                        private Context context;
                        private Activity activity;
                    Severity: Minor
                    Found in app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java - About 4 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 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 doInBackground has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                      Open

                              @Override
                              protected Void doInBackground(Void... params) {
                                  if (previousPreset != null) {
                                      Log.i(TAG, "Preset \"" + currentPreset.getTag() + "\" loading");
                                      for (int i = 0; i < 4; i++) {
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.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 onBindViewHolder has a Cognitive Complexity of 26 (exceeds 5 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: Minor
                        Found in app/src/main/java/com/bedrock/padder/adapter/ItemAdapter.java - About 3 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 validateEditText has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private boolean validateEditText(EditText editText) {
                                Log.d(TAG, "validateEditText");
                                switch (MODE_TAG) {
                                    case "song":
                                        if (editText == songName) {
                        Severity: Major
                        Found in app/src/main/java/com/bedrock/padder/activity/FeedbackActivity.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

                            PresetStoreActivity has 27 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            public class PresetStoreActivity extends AppCompatActivity implements FileChooserDialog.FileCallback {
                            
                                private WindowHelper window = new WindowHelper();
                                private AnimateHelper anim = new AnimateHelper();
                                private ToolbarHelper toolbar = new ToolbarHelper();

                              Method buttonRevealAnimation has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private void buttonRevealAnimation(final int buttonRectIndex) {
                                      final Rect buttonRects[] = {
                                              window.getRect(R.id.btn00, activity),
                                              window.getRect(R.id.tgl1, activity),
                                              window.getRect(R.id.tgl2, activity),
                              Severity: Major
                              Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.java - About 3 hrs to fix

                                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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language