berict/Tapad

View on GitHub

Showing 231 of 426 total issues

Method circularRevealInPx has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void circularRevealInPx(int view,
                                   int centerX, int centerY,
                                   int startRad, int endRad, TimeInterpolator interpolator,
                                   int duration, int delay, Activity activity) {

Severity: Minor
Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

    Method circularRevealAnimator has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public Animator circularRevealAnimator(int view,
                                               int centerX, int centerY,
                                               int startRad, int endRad, TimeInterpolator interpolator,
                                               int duration, int delay, Activity activity) {
    
    
    Severity: Minor
    Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

      Method setDecks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void setDecks(int color, int colorDef, Activity activity) {
              Preferences preferences = new Preferences(activity);
              this.color = preferences.getColor();
              this.colorDef = colorDef;
              decks = new Deck[]{
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.java - About 1 hr to fix

        Method run has 34 lines of code (exceeds 25 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 1 hr to fix

          Method circularRevealinDP has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void circularRevealinDP(int view,
                                             int centerX, int centerY,
                                             int startRad, int endRad, TimeInterpolator interpolator,
                                             int duration, int delay, Activity activity) {
          
          
          Severity: Minor
          Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

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

                @Override
                public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
                    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
                    switch (requestCode) {
                        case REQUEST_WRITE_STORAGE:

              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 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 setPadColor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      void setPadColor(int row, int column, final int color, int duration, int delay) {
                          if (row * column != 0) {
                              final View pad = getViewFromId("btn" + column + row, activity);
                              if (getBackgroundColor(pad) != getColor(color, activity) && getBackgroundColor(pad) != getColor(color, activity)) {
                                  // was not pressed
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/model/sound/Pad.java - About 1 hr 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 setNavigationBar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void setNavigationBar(int colorId, Activity activity) {
                          if (Build.VERSION.SDK_INT >= 16) {
                              if (colorId == R.color.transparent) {
                                  activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
                                  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/helper/WindowHelper.java - About 1 hr 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 loadColor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void loadColor(int color) {
                          if (decks != null && currentPreset != null) {
                              for (Deck deck : decks) {
                                  for (Pad pad : deck.getPads()) {
                                      if (pad != null) {
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.java - About 1 hr 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 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 setLoadingFailed has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void setLoadingFailed(boolean isFailed) {
                            if (isFailed) {
                                Log.e(TAG, "Loading failed");
                                anim.fadeOut(recyclerView, 0, 200, a);
                                anim.fadeOut(recyclerViewLoading, 0, 200, a);

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

                          public boolean isPresetAvailable(Preset preset) {
                              // with sound count check
                              if (preset != null) {
                                  String presetName = preset.getTag();
                                  // preset available
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/helper/FileHelper.java - About 1 hr to fix

                        Method onCreate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            protected void onCreate(Bundle savedInstanceState) {
                                super.onCreate(savedInstanceState);
                                setContentView(R.layout.activity_preset_store);
                        
                        

                          Method setUi has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private void setUi() {
                                  // toolbar
                                  toolbar.setActionBar(this);
                                  toolbar.setStatusBarTint(this);
                                  toolbar.setActionBarPadding(this);
                          Severity: Minor
                          Found in app/src/main/java/com/bedrock/padder/activity/ColorActivity.java - About 1 hr to fix

                            Method setActions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private void setActions() {
                                    window.setOnClick(R.id.activity_help_contact_email, new Runnable() {
                                        @Override
                                        public void run() {
                                            intent.intentEmail(activity, R.string.feedback_email,
                            Severity: Minor
                            Found in app/src/main/java/com/bedrock/padder/activity/HelpActivity.java - About 1 hr to fix

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

                                      @Override
                                      protected void onPostExecute(Integer integer) {
                                          Log.d(TAG, "onPostExecute");
                                          super.onPostExecute(integer);
                                          // finished unzipping, delete the original zip file
                              Severity: Minor
                              Found in app/src/main/java/com/bedrock/padder/helper/FileHelper.java - About 1 hr to fix

                                Method scaleIn has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public void scaleIn(final int id, int touchX, int touchY, final int delay, final long duration, String handlerName, Activity activity) {
                                        final View view = activity.findViewById(id);
                                        float x = touchX / window.getWindowWidthPx(activity);
                                        float y = touchY / window.getWindowHeightPx(activity);
                                        final ScaleAnimation scaleOut = new ScaleAnimation(0, 1, 0, 1, Animation.ABSOLUTE, x, Animation.ABSOLUTE, y);
                                Severity: Minor
                                Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

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

                                          @Override
                                          protected Integer doInBackground(Void... params) {
                                              try {
                                                  FileInputStream fileInputStream = new FileInputStream(zipLocation);
                                                  ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
                                  Severity: Minor
                                  Found in app/src/main/java/com/bedrock/padder/helper/FileHelper.java - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language