• 0.17

What is Quality and how to achieve it?

Quality Java code, as we understand it, compiles and complies to static analysis rules. Qulice uses a number of open-source components (in order to avoid reinventing the wheel). We pre-configured these tools for your convenience and extended them with our specific rules.

Checkstyle

Inherited rules.

Our custom rules:

If you want to disable some rule (this may happen, but try to avoid such situations at all cost):

/**
 * @checkstyle ParameterNumber (3 lines)
 */
public void funcWithManyParams(int a, int b, int c, int d) {
  // @checkstyle MagicNumber (1 line)
  int num = 5;
  // ...
}

PMD

Inherited rules.

Rules can be disabled (again, try to avoid this at all cost):

@SuppressWarnings("PMD.UseConcurrentHashMap")
public void func() {
  Map<String, String> map = new HashMap<String, String>();
  // ...
}

Cobertura

Every class, method, and package should be covered by unit tests. Qulice will complain when coverage is not sufficient. To enable cobertura checks add <goal>instrument</goal> to plugin executions section:

<build>
   <plugins>
       <plugin>
           <groupId>com.qulice</groupId>
           <artifactId>qulice-maven-plugin</artifactId>
           <version>0.17</version>
           <configuration>
               <license>file:${basedir}/LICENSE.txt</license>
           </configuration>
           <executions>
               <execution>
                   <goals>
                       <goal>instrument</goal>
                       <goal>check</goal>
                   </goals>
               </execution>
           </executions>
       </plugin>
   </plugins>
</build>

In order to get a visual presentation of your coverage add this to your pom.xml:

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.1</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

And run mvn cobertura:cobertura. Then open target/site/cobertura/index.html in any browser.

You can't disable Cobertura checks.

CodeNarc

Inherited rules.

You can't disable CodeNarc rules.