berict/Tapad

View on GitHub

Showing 231 of 426 total issues

Method moveXYinDP has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void moveXYinDP(int view,
                           int fromX, int toX,
                           int durationX, int delayX, TimeInterpolator intX,
                           int fromY, int toY,
                           int durationY, int delayY, TimeInterpolator intY,
Severity: Major
Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

    Method select has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private void select(int index) {
            Log.d("SH", "Index selected " + index);
            // index starts from 0
            if (index == -1) {
                // disable all
    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 moveXYinPX has 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public void moveXYinPX(int view,
                               int fromX, int toX,
                               int durationX, int delayX, TimeInterpolator intX,
                               int fromY, int toY,
                               int durationY, int delayY, TimeInterpolator intY,
    Severity: Major
    Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

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

          @Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.activity_about);
      
      
      Severity: Minor
      Found in app/src/main/java/com/bedrock/padder/activity/AboutActivity.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 onPreExecute has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  @Override
                  protected void onPreExecute() {
                      super.onPreExecute();
                      // started loading
                      isPresetLoading = true;
          Severity: Minor
          Found in app/src/main/java/com/bedrock/padder/helper/SoundHelper.java - About 1 hr to fix

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

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

              Method moveXYinPX has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public void moveXYinPX(View view,
                                         int fromX, int toX,
                                         int durationX, int delayX, TimeInterpolator intX,
                                         int fromY, int toY,
                                         int durationY, int delayY, TimeInterpolator intY,
              Severity: Major
              Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

                Method send has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private boolean send() {
                        if (validateAll() == true) {
                            switch (MODE_TAG) {
                                case "song":
                                    sendMessage =   "Song title   = \"" + songNameString    + "\"" + br +
                Severity: Minor
                Found in app/src/main/java/com/bedrock/padder/activity/FeedbackActivity.java - About 1 hr to fix

                  Method fadeOut has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void fadeOut(final int id, final int delay, final long duration, Activity activity) {
                          final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
                          final View view = activity.findViewById(id);
                  
                          if (view.getVisibility() == View.VISIBLE) {
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.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 fadeOut has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void fadeOut(final View view, final int delay, final long duration, Activity activity) {
                          final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
                  
                          if (view.getVisibility() == View.VISIBLE) {
                              PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.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 getPadStringFromIndex has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private String getPadStringFromIndex(int padIndex) {
                          switch (padIndex) {
                              case 0:
                                  return "00";
                              case 1:
                  Severity: Minor
                  Found in app/src/main/java/com/bedrock/padder/model/preset/Preset.java - About 1 hr to fix

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

                        @Override
                        protected void onCreate(Bundle savedInstanceState) {
                            super.onCreate(savedInstanceState);
                    
                            setButtonBackVisible(false);

                      Method setIntents has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void setIntents() {
                              // presets
                              (a.findViewById(R.id.layout_settings_preset)).setOnClickListener(new View.OnClickListener() {
                                  @Override
                                  public void onClick(View v) {
                      Severity: Minor
                      Found in app/src/main/java/com/bedrock/padder/activity/SettingsActivity.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 play has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              void play() {
                                  try {
                                      Log.i(TAG, "Attempted to play " + soundPoolId);
                                      if (isLooping && canLoop) {
                                          canLoop = false;
                          Severity: Minor
                          Found in app/src/main/java/com/bedrock/padder/model/sound/Sound.java - About 1 hr to fix

                            Method fadeOutInvisible has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public void fadeOutInvisible(final int id, final int delay, final long duration, View parentView, Activity activity) {
                                    final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
                                    final View view = parentView.findViewById(id);
                                    PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
                            
                            
                            Severity: Minor
                            Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

                              Method fadeOutInvisible has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public void fadeOutInvisible(final int id, final int delay, final long duration, Activity activity) {
                                      final AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0.0f);
                                      final View view = activity.findViewById(id);
                                      PowerManager powerManager = (PowerManager) activity.getSystemService(POWER_SERVICE);
                              
                              
                              Severity: Minor
                              Found in app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java - About 1 hr to fix

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

                                    private void init() {
                                        handler = new Handler(Looper.getMainLooper());
                                
                                        for (int i = 0; i < decks.length; i++) {
                                            decks[i] = activity.findViewById(getId("tgl" + String.valueOf(i + 1) + "_tutorial"));
                                Severity: Minor
                                Found in app/src/main/java/com/bedrock/padder/model/tutorial/Tutorial.java - About 1 hr to fix

                                  Method doInBackground has 35 lines of code (exceeds 25 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 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language