En este repositorio simplemente demostramos como utilizar Github actions para incorporar integración continua a nuestro proyecto. Utilizando maven, corremos test de JUnit y análisis estático:
- Checkstyle. Utilizamos la guía de estilos de Google.
- PMD. Utilizamos las siguientes reglas PMD Rules, excepto las relacionadas con la documentation (javadoc).
- Spotbugs. Éstas son las reglas que spotbugs verifica: Spotbugs Rules.
También utilizamos el plugin de maven Jacoco para generar reportes de covertura de código. Luego, enviamos los reportes mediante una acción de Github a Codecov, para mostrar el badge con el porcentaje de covertura.
Ademas, utilizamos Code Climate, otro analizador de código estático que ranquea nuestros fuentes segun las siguientes métricas:
- Argument count: Methods or functions defined with a high number of arguments
- Complex logic: Boolean logic that may be hard to understand
- File length: Excessive lines of code within a single file
- Identical blocks of code: Duplicate code which is syntactically identical (but may be formatted differently)
- Method complexity: Functions or methods that may be hard to understand
- Method count: Classes defined with a high number of functions or methods
- Method length: Excessive lines of code within a single function or method
- Nested control flow: Deeply nested control structures like if or case
- Return statements: Functions or methods with a high number of return statements
- Similar blocks of code: Duplicate code which is not identical but shares the same structure (e.g. variable names may differ)
Para habilitar en cualquier proyecto de Github code climate y codecov hay que registrarse utilizando la cuenta de github.