TiagoMSSantos/MobileRT

View on GitHub
app/src/androidTest/java/puscas/mobilertapp/MainRendererTest.java

Summary

Maintainability
A
1 hr
Test Coverage

Method createAndGetIndexOfShader has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private int createAndGetIndexOfShader(final String shaderCode, final int shaderType)
        throws InterruptedException {

        final DrawView drawView = UtilsT.getPrivateField(activity, "drawView");
        Preconditions.checkNotNull(drawView, "drawView shouldn't be null");
Severity: Minor
Found in app/src/androidTest/java/puscas/mobilertapp/MainRendererTest.java - About 1 hr to fix

    Define and throw a dedicated exception instead of using a generic one.
    Open

                throw new RuntimeException(errorMessage + " (" + latch + ")", ex);

    Using such generic exceptions as Error, RuntimeException, Throwable, and Exception prevents calling methods from handling true, system-generated exceptions differently than application-generated errors.

    Noncompliant Code Example

    public void foo(String bar) throws Throwable {  // Noncompliant
      throw new RuntimeException("My Message");     // Noncompliant
    }
    

    Compliant Solution

    public void foo(String bar) {
      throw new MyOwnRuntimeException("My Message");
    }
    

    Exceptions

    Generic exceptions in the signatures of overriding methods are ignored, because overriding method has to follow signature of the throw declaration in the superclass. The issue will be raised on superclass declaration of the method (or won't be raised at all if superclass is not part of the analysis).

    @Override
    public void myMethod() throws Exception {...}
    

    Generic exceptions are also ignored in the signatures of methods that make calls to methods that throw generic exceptions.

    public void myOtherMethod throws Exception {
      doTheThing();  // this method throws Exception
    }
    

    See

    Wrong lexicographical order for 'java.io.InputStream' import. Should be before 'org.junit.Test'.
    Open

    import java.io.InputStream;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'java.util.logging.Logger' import. Should be before 'org.junit.Test'.
    Open

    import java.util.logging.Logger;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'org.junit.Assert'
    Open

    import org.junit.Assert;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'java.io.InputStream'
    Open

    import java.io.InputStream;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'java.util.concurrent.CountDownLatch' import. Should be before 'org.junit.Test'.
    Open

    import java.util.concurrent.CountDownLatch;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 106).
    Open

            final String errorMessage = "UtilsShader#loadShader should be called by the GL rendering thread.";

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Line is longer than 100 characters (found 126).
    Open

                    UtilsLogging.logThrowable(ex, this.testName.getMethodName() + ": MainRendererTest#createAndGetIndexOfShader");

    Checks for long lines.

    Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'java.util.concurrent.atomic.AtomicInteger' import. Should be before 'org.junit.Test'.
    Open

    import java.util.concurrent.atomic.AtomicInteger;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Wrong lexicographical order for 'java.util.concurrent.TimeUnit' import. Should be before 'org.junit.Test'.
    Open

    import java.util.concurrent.TimeUnit;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'puscas.mobilertapp.exceptions.FailureException'
    Open

    import puscas.mobilertapp.exceptions.FailureException;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    Extra separation in import group before 'com.google.common.base.Preconditions'
    Open

    import com.google.common.base.Preconditions;

    Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

    This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

    There are no issues that match your filters.

    Category
    Status