prasadtalasila/BITS-Darshini

View on GitHub
src/test/java/in/ac/bits/protocolanalyzer/persistence/repository/SaveRepositoryTest.java

Summary

Maintainability
A
0 mins
Test Coverage

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

    public void setup() throws Exception {

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

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

import org.junit.Before;

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.eventbus.EventBus'
Open

import com.google.common.eventbus.EventBus;

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.util.ArrayList'
Open

import java.util.ArrayList;

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 'com.google.common.eventbus.EventBus' import. Should be before 'org.springframework.test.context.support.AnnotationConfigContextLoader'.
Open

import com.google.common.eventbus.EventBus;

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.ArrayList' import. Should be before 'org.junit.Assert.assertNotNull'.
Open

import java.util.ArrayList;

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 109).
Open

@ContextConfiguration(classes = SaveRepositoryTestConfig.class, loader = AnnotationConfigContextLoader.class)

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 'config.in.ac.bits.protocolanalyzer.persistence.repository.SaveRepositoryTestConfig' import. Should be before 'org.springframework.test.context.support.AnnotationConfigContextLoader'.
Open

import config.in.ac.bits.protocolanalyzer.persistence.repository.SaveRepositoryTestConfig;

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.

Local variable name 'l' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

        ArrayList<IndexQuery> l = new ArrayList<IndexQuery>();

Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

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 'config.in.ac.bits.protocolanalyzer.persistence.repository.SaveRepositoryTestConfig'
Open

import config.in.ac.bits.protocolanalyzer.persistence.repository.SaveRepositoryTestConfig;

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