Code Quality Gates and Tooling

Adapted from docs/developer/CodeQuality.md in the Wikantik repository; current as of release 2.4.56.

This page is for developers who need to know which quality checks exist, how to run them, and what the current ratchet values are. Numbers that change live in one table below with a measurement date; everything else is stable procedure.

Read the current numbers

Last checked against the poms and build-support/ on 2026-10-13. Coverage floors may rise later; the pom is authoritative.

ItemValueSource
Root default line-coverage floor0.80wikantik.coverage.line.minimum in the root pom.xml
Floor 0.90wikantik-ingest, wikantik-insights, wikantik-jdbc, wikantik-main, wikantik-ontologymodule poms
Floor 0.89wikantik-observability, wikantik-utilmodule poms
Floor 0.88wikantik-api, wikantik-connectors, wikantik-extract-cli, wikantik-mcp-coremodule poms
Floor 0.87wikantik-admin-mcpmodule pom
Floor 0.86wikantik-http, wikantik-restmodule poms
Floor 0.85wikantik-cache, wikantik-event, wikantik-knowledgemodule poms
Floor 0.84wikantik-cache-memcached, wikantik-scim, wikantik-toolsmodule poms
PMD complexity baseline entries99non-comment = lines in build-support/pmd-complexity-baseline.properties
TestSchemaSingleSourceTest baseline entries1 (the JDBCPluginCITest carve-out)wikantik-war/src/test/resources/test-ddl-baseline.txt
Frontend (Vitest) thresholdslines 87, statements 85, functions 85, branches 76wikantik-frontend/vite.config.js

wikantik-bom, wikantik-war, wikantik-wikipages, wikantik-it-tests and wikantik-frontend declare no Java floor of their own.

Run the ratchets

Floors only go up, are never set above 0.90, and are the measured value rounded down to a whole percent. Baseline entries only ever come out.

# Per-module line-coverage floors (JaCoCo check goal, coverage-check execution)
mvn clean install -Pcoverage -DskipITs

# Complexity ratchet: fails on any NEW PMD design-rule violation not in the baseline
mvn pmd:check -Pcomplexity-gate

# Persistence ratchets in wikantik-war
mvn -pl wikantik-war test -Dtest='JdbcAccessArchTest,TestSchemaSingleSourceTest'

The war's classpath resolves sibling modules from ~/.m2, so after you change a repository run mvn install -DskipTests before you trust the architecture tests.

The complexity rules are in build-support/pmd-complexity-ruleset.xml (CyclomaticComplexity, CognitiveComplexity, NPathComplexity, NcssCount, ExcessiveParameterList, GodClass, TooManyMethods), with thresholds above PMD defaults. To reduce debt, shrink a class until it clears its rules and delete its line from the baseline. A new baseline line needs a justification in the commit message.

Run the reports

DimensionCommandOutput
Duplication (CPD)mvn -fae org.apache.maven.plugins:maven-pmd-plugin:3.28.0:cpd*/target/cpd.xml
Complexity (PMD, report)mvn -fae -Pcomplexity-report org.apache.maven.plugins:maven-pmd-plugin:3.28.0:pmd*/target/pmd.xml
Bug-finding (PMD)mvn -fae org.apache.maven.plugins:maven-pmd-plugin:3.28.0:pmduses build-support/pmd-ruleset.xml
Coverage, unit onlymvn clean install -Pcoverage -DskipITs -T 1C*/target/site/jacoco/jacoco.csv
Code-health site (coverage, coupling, PMD and more)bin/site.sh (--unit-only, --skip-build)target/staging/index.html

bin/site.sh needs Graphviz (dot) for the module-coupling SVG; without it the site links the raw .dot file. wikantik-coverage-report (added only under the coverage profile) aggregates JaCoCo data across modules.

Run SpotBugs

The root pom configures spotbugs-maven-plugin with effort=Max, threshold=Low, includeTests=false, and the find-sec-bugs plugin. Reasoned suppressions are in build-support/spotbugs-exclude.xml. No workflow runs SpotBugs and it is not in the default build; Run it on demand:

mvn -fae com.github.spotbugs:spotbugs-maven-plugin:check

Know the architecture and drift tests

TestModuleGuards
JdbcAccessArchTestwikantik-warNo JDBC connection or transaction calls outside com.wikantik.jdbc.. (JDBCPlugin excepted); see ADR-0010 (docs/adr/0010-one-data-access-primitive.md)
TestSchemaSingleSourceTestwikantik-warNo hand-written CREATE TABLE in tests beyond the baseline file; JDBCPluginCITest is the permanent carve-out
ConfigSurfaceDriftTestwikantik-warEvery wikantik.* key read in code is declared in ini/wikantik.properties with a default, description and type
DecompositionArchTestwikantik-mainNo new getManager callers or late-bound service fields on WikiEngine

Cluster Hub: Wikantik Platform Development Hub: Architecture, MCP Protocols, and Agent Briefings (wikantik-development)