TiagoMSSantos/MobileRT

View on GitHub

Showing 666 of 666 total issues

File MainActivity.java has 630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package puscas.mobilertapp;

import android.app.Activity;
import android.app.ActivityManager;
import android.content.ActivityNotFoundException;
Severity: Major
Found in app/src/main/java/puscas/mobilertapp/MainActivity.java - About 1 day to fix

    File MainRenderer.java has 474 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package puscas.mobilertapp;
    
    import android.app.ActivityManager;
    import android.graphics.Bitmap;
    import android.graphics.Color;
    Severity: Minor
    Found in app/src/main/java/puscas/mobilertapp/MainRenderer.java - About 7 hrs to fix

      MainRenderer has 40 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public final class MainRenderer implements GLSurfaceView.Renderer {
      
          /**
           * Logger for this class.
           */
      Severity: Minor
      Found in app/src/main/java/puscas/mobilertapp/MainRenderer.java - About 5 hrs to fix

        File AbstractTest.java has 369 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package puscas.mobilertapp;
        
        import android.Manifest;
        import android.app.Activity;
        import android.app.ActivityManager;
        Severity: Minor
        Found in app/src/androidTest/java/puscas/mobilertapp/AbstractTest.java - About 4 hrs to fix

          MainActivity has 37 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public final class MainActivity extends Activity {
          
              /**
               * Logger for this class.
               */
          Severity: Minor
          Found in app/src/main/java/puscas/mobilertapp/MainActivity.java - About 4 hrs to fix

            Method onActivityResult has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                protected void onActivityResult(final int requestCode,
                                                final int resultCode,
                                                @Nullable final Intent data) {
                    super.onActivityResult(requestCode, resultCode, data);
            Severity: Minor
            Found in app/src/main/java/puscas/mobilertapp/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 waitUntil has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static void waitUntil(final String testName,
                                             @NonNull final MainActivity activity,
                                             final String expectedButtonText,
                                             final State... expectedStates) throws TimeoutException {
                    logger.info("waitUntil start, expected button: " + expectedButtonText + ", expected state(s): " + Arrays.toString(expectedStates));
            Severity: Major
            Found in app/src/androidTest/java/puscas/mobilertapp/utils/UtilsContextT.java - About 2 hrs to fix

              File DrawView.java has 252 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              package puscas.mobilertapp;
              
              import android.app.Activity;
              import android.app.ActivityManager;
              import android.content.Context;
              Severity: Minor
              Found in app/src/main/java/puscas/mobilertapp/DrawView.java - About 2 hrs to fix

                Method onActivityResult has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    protected void onActivityResult(final int requestCode,
                                                    final int resultCode,
                                                    @Nullable final Intent data) {
                        super.onActivityResult(requestCode, resultCode, data);
                Severity: Minor
                Found in app/src/main/java/puscas/mobilertapp/MainActivity.java - About 1 hr to fix

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

                      @Override
                      public void perform(final UiController uiController, final View view) {
                          Object value = null;
                          if (this.delayMillis == 0) {
                              do {
                  Severity: Minor
                  Found in app/src/androidTest/java/puscas/mobilertapp/ViewActionWait.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 isPathReadable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static boolean isPathReadable(final File file) {
                          final boolean readable = file.setReadable(true);
                          if (!file.canRead() && !readable) {
                              final File parentFile = file.getParentFile();
                              if (parentFile == null) {
                  Severity: Minor
                  Found in app/src/main/java/puscas/mobilertapp/utils/UtilsContext.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 waitUntil has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static void waitUntil(final String testName,
                                                   @NonNull final MainActivity activity,
                                                   final String expectedButtonText,
                                                   final State... expectedStates) throws TimeoutException {
                          logger.info("waitUntil start, expected button: " + expectedButtonText + ", expected state(s): " + Arrays.toString(expectedStates));

                  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 testPreviewSceneOrthographicCamera has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Test
                      @Order(order = 1)
                      @FlakyTest
                      public void testPreviewSceneOrthographicCamera() throws TimeoutException {
                          logger.info("testPreviewSceneOrthographicCamera start");
                  Severity: Minor
                  Found in app/src/androidTest/java/puscas/mobilertapp/PreviewTest.java - About 1 hr to fix

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

                    package puscas.mobilertapp.constants;
                    
                    import androidx.annotation.NonNull;
                    
                    import java.util.logging.Logger;
                    Severity: Major
                    Found in app/src/main/java/puscas/mobilertapp/constants/Shader.java and 1 other location - About 1 hr to fix
                    app/src/main/java/puscas/mobilertapp/constants/Scene.java on lines 1..78

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

                    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

                    package puscas.mobilertapp.constants;
                    
                    import androidx.annotation.NonNull;
                    
                    import java.util.logging.Logger;
                    Severity: Major
                    Found in app/src/main/java/puscas/mobilertapp/constants/Scene.java and 1 other location - About 1 hr to fix
                    app/src/main/java/puscas/mobilertapp/constants/Shader.java on lines 1..78

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

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

                        private static void executeShellCommand(final String shellCommand) {
                            try {
                                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                    final ParcelFileDescriptor parcelFileDescriptor = InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand(shellCommand);
                                    parcelFileDescriptor.checkError();
                    Severity: Minor
                    Found in app/src/androidTest/java/puscas/mobilertapp/AbstractTest.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

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

                            Espresso.onView(ViewMatchers.withId(R.id.drawLayout))
                                .inRoot(RootMatchers.isTouchable())
                                .perform(new ViewActionWait<>(0, R.id.drawLayout))
                                .check((view, exception) -> {
                                    UtilsT.rethrowException(exception);
                    app/src/androidTest/java/puscas/mobilertapp/PreviewTest.java on lines 93..103

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

                    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

                            Espresso.onView(ViewMatchers.withId(R.id.drawLayout))
                                .inRoot(RootMatchers.isTouchable())
                                .perform(new ViewActionWait<>(0, R.id.drawLayout))
                                .check((view, exception) -> {
                                    UtilsT.rethrowException(exception);
                    app/src/androidTest/java/puscas/mobilertapp/PreviewTest.java on lines 107..117

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

                    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 cleanStoragePath has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @NonNull
                        public static String cleanStoragePath(@NonNull final String storagePath) {
                            String storagePathCleaned = storagePath;
                    
                            // Remove Android path
                    Severity: Minor
                    Found in app/src/main/java/puscas/mobilertapp/utils/UtilsContext.java - About 1 hr to fix

                      Method executeShellCommand has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static void executeShellCommand(final String shellCommand) {
                              try {
                                  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                                      final ParcelFileDescriptor parcelFileDescriptor = InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand(shellCommand);
                                      parcelFileDescriptor.checkError();
                      Severity: Minor
                      Found in app/src/androidTest/java/puscas/mobilertapp/AbstractTest.java - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language