All Projects → singhalkul → java-quality-checks

singhalkul / java-quality-checks

Licence: Apache-2.0 license
No description or website provided.

Programming Languages

XSLT
1337 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to java-quality-checks

static-code-analysis-plugin
A plugin to simplify Static Code Analysis on Gradle. Not restricted to, but specially useful, in Android projects, by making sure all analysis can access the SDK classes.
Stars: ✭ 36 (+9.09%)
Mutual labels:  findbugs, pmd, checkstyle, code-quality, cpd, spotbugs
Gradle Code Quality Tools Plugin
Gradle plugin that generates ErrorProne, Findbugs, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint Tasks for every subproject.
Stars: ✭ 282 (+754.55%)
Mutual labels:  findbugs, pmd, checkstyle, code-quality
Gradle Static Analysis Plugin
Easy setup of static analysis tools for Android and Java projects.
Stars: ✭ 398 (+1106.06%)
Mutual labels:  findbugs, pmd, checkstyle, code-quality
Okcheck
Incremental scan,integrate Lint、KtLint、UnitTest、Checkstyle、Findbugs、Pmd, powerful and easy to use
Stars: ✭ 285 (+763.64%)
Mutual labels:  findbugs, pmd, checkstyle
Warnings Ng Plugin
Jenkins Warnings Plugin - Next Generation
Stars: ✭ 248 (+651.52%)
Mutual labels:  findbugs, pmd, checkstyle
Jscpd
Copy/paste detector for programming source code.
Stars: ✭ 2,397 (+7163.64%)
Mutual labels:  code-quality, cpd, copy-paste
Android Starter
[Android Architecture] Android starter based on MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Android template project.
Stars: ✭ 522 (+1481.82%)
Mutual labels:  findbugs, pmd, checkstyle
Debt-Manager
A personal app to store people that owe you money or you owe money to. "Mo Money Mo Problems" 🎵 - The Notorious B.I.G. 😎
Stars: ✭ 22 (-33.33%)
Mutual labels:  findbugs, pmd, checkstyle
analysis-model
A library to read static analysis reports into a Java object model
Stars: ✭ 74 (+124.24%)
Mutual labels:  pmd, checkstyle, spotbugs
Quality Checks
Gradle plugin which includes Checkstyle, FindBugs, and PMD basic configuration.
Stars: ✭ 38 (+15.15%)
Mutual labels:  findbugs, pmd, checkstyle
Codeanalysis
Android静态代码分析
Stars: ✭ 31 (-6.06%)
Mutual labels:  findbugs, pmd, checkstyle
Gnag
A Gradle plugin that helps facilitate GitHub PR checking and automatic commenting of violations.
Stars: ✭ 120 (+263.64%)
Mutual labels:  findbugs, pmd, checkstyle
advanced-spring-scaffold
This project provides an advanced baseline to help you kick start a Spring project.
Stars: ✭ 21 (-36.36%)
Mutual labels:  pmd, checkstyle, spotbugs
Kotlin Android Starter
[Kotlin Android] Kotlin Android starter based MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Kotlin Android project.
Stars: ✭ 589 (+1684.85%)
Mutual labels:  findbugs, pmd, checkstyle
Gradle Quality Plugin
Gradle quality plugin for Java and Groovy
Stars: ✭ 97 (+193.94%)
Mutual labels:  findbugs, pmd, checkstyle
JSR305CheckstylePlugin
a plugin which ensures nullness annotations on methods and constructors
Stars: ✭ 19 (-42.42%)
Mutual labels:  findbugs, checkstyle
qulice
Quality Police for Java projects: aggregator of Checkstyle, PMD, and SpotBugs
Stars: ✭ 286 (+766.67%)
Mutual labels:  pmd, checkstyle
spring-boot-java-swing-reservations
The project aims to present how to connect Spring Boot 2 and Java Swing GUI widget toolkit. All application dependencies are provided by Docker Compose. There are also static code analysis tools like FindBugs and Checkstyle.
Stars: ✭ 86 (+160.61%)
Mutual labels:  findbugs, checkstyle
Sputnik
Static code review for your Gerrit patchsets. Runs Checkstyle, PMD, FindBugs, Scalastyle, CodeNarc, JSLint for you!
Stars: ✭ 189 (+472.73%)
Mutual labels:  findbugs, pmd
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (+372.73%)
Mutual labels:  findbugs, code-quality

Java Quality Checks

Code Quality

Tools

Below are some of the tools that make sure that good practices are followed for the following:

  1. Code coverage by unit tests.
  2. Common Coding standard in the team.
  3. Avoid simple mistakes like unused variables, methods, empty catch blocks, eating exceptions instead of throwing etc.
  4. Avoid copy/pasting of code greater than certain number of tokens.

Jacoco

JaCoCo is an open-source toolkit for measuring and reporting Java code coverage.
Gradle configuration for jacoco is located in gradle/jacoco.gradle.

Command:
gradle test integrationTest jacocoTestCoverageVerification

Output: Coverage report

Notice that the service package is excluded as it is considered as integration test in this example. This is just for demo purposes and in real life, unit tests should be written for the service package as well

PMD

PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth.
Gradle configuration for PMD is located in gradle/pmd.gradle. The PMD checks are defined in config/pmd/ruleSet.xml.

Command:
gradle pmdMain

Output: PMD Report

CPD

CPD is Copy/Paste Detector provided by PMD. It helps in finding duplicate code. It is written using Karp-Rabin string matching algorithm.
Gradle configuration for CPD is located in gradle/pmd.gradle.

Command:
gradle cpd

Output:

         > A failure occurred while executing de.aaschmid.gradle.plugins.cpd.internal.worker.CpdAction
            > CPD found duplicate code. See the report at file:///java-quality-checks/build/reports/cpd/cpdCheck.text

Output file: cpdCheck.text

Checkstyle

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.
Gradle configuration for checkstyle is located in gradle/checkstyle.gradle.
The checkstyle rules for production code are defined in config/checkstyle/checkstyle.xml.
The checkstyle rules for test code are definned in config/checkstyle/checkstyleTest.xml.

Command:
gradle checkStyleMain
gradle checkStyleTest

Output: Checkstyle main

Checkstyle test

SpotBugs

SpotBugs is a program which uses static analysis to look for bugs in Java code. SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community.
Gradle configuration for spotbugs is located in gradle/spotbugs.gradle.

Command:
gradle spotBugsMain

Practices

Tests

  • Follow the test pyramid when writing tests for the code. This means a lot of unit tests and handful integration tests.
  • Make sure assertions are written for each and every unit test and they are asserting the functionality under test.
  • Integration tests coverage numbers should not be considered when looking at the coverage numbers.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].