berict/Tapad

View on GitHub

Showing 426 of 426 total issues

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

        final View buttonViews[] = {
                activity.findViewById(R.id.btn00),
                activity.findViewById(R.id.tgl1),
                activity.findViewById(R.id.tgl2),
                activity.findViewById(R.id.tgl3),
app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 339..365
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 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 3 locations. Consider refactoring.
Open

            View buttonViews[] = {
                    activity.findViewById(R.id.btn00),
                    activity.findViewById(R.id.tgl1),
                    activity.findViewById(R.id.tgl2),
                    activity.findViewById(R.id.tgl3),
app/src/main/java/com/bedrock/padder/activity/MainActivity.java on lines 339..365
app/src/main/java/com/bedrock/padder/helper/SoundHelper.java on lines 350..376

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

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

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

            public void scaleOut(final View view, int touchX, int touchY, final int delay, final long duration, String handlerName, Activity activity) {
                float x = touchX / window.getWindowWidthPx(activity);
                float y = touchY / window.getWindowHeightPx(activity);
                final ScaleAnimation scaleOut = new ScaleAnimation(1, 0, 1, 0, Animation.ABSOLUTE, x, Animation.ABSOLUTE, y);
        
        
        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 781..808

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

        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

            public void scaleIn(final View view, int touchX, int touchY, final int delay, final long duration, String handlerName, Activity activity) {
                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);
        
        
        app/src/main/java/com/bedrock/padder/helper/AnimateHelper.java on lines 663..690

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

        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

        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

            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

            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

            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

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