Posts

Showing posts with the label quality

Digital Marketing

Java Code Quality Matrices

Matrices Definition and Explanation Number of Classes For same project, more classes mean better abstracted. But try to keep this number down if applicable. Lines of Code (LOC) For same project, fewer lines of code mean better design and less maintenance. Number of Children (NOC) Number of immediate sub-classes of a class. Try to keep it down to avoid classes become too complex. Response for Class (RFC) Number of all methods implemented within the class plus the number of methods accessible to an object of this class due to implementation. The h igher the RFC, the more difficult to make changes. Try to keep it lower. Depth of Inheritance Tree (DIT) Maximum inheritance path from the class to the root class. Try to keep it under 5. Weighted Methods Per Class (WMC) Average number of methods defined in class. Try to keep it under 14. Coupling between Object Classes (CBO) Number of classes to which a class is coupled. Try to keep it under 14. Lack of Cohesion of Methods (LCOM4) It measures ...

Tools for Java code quality

Avoid common mistakes: Checkstyle ,  Crap4j Jenkins ,  TeamCity Sonar  ( which integrates  Findbugs  and a bunch of other static analysis tools like  PMD  etc. ) ,  Stan4J ,  JDepend   Sonar Plugin for Maven based projects.  https://github.com/hmvictor/radar-netbeans https://github.com/giancosta86/EasyPmd Existing functionality should not easily break because of new code. Unit testing framework:  JUnit ,  TestNG Unit test coverage tool:  EclEmma ,  Cobertura

How to Use sonar to analyze maven project

SonarQube ® software (previously called Sonar) is an open source quality management platform, dedicated to continuously analyze and measure technical quality, from project portfolio to method. Run sonar : $ cd Downloads/sonarqube-4.1/bin/linux-x86-64 $ ./sonar.sh console & Put the following in ~/.m2/settings.xml <settings>     <profiles>         <profile>             <id>sonar</id>             <activation>                 <activeByDefault>true</activeByDefault>             </activation>             <properties>                 <!-- optional URL to server. Default value is http://localhost:9000 -->                 <sonar.host.url>     ...