Java Code Analysis

Enterprise-grade analysis of Java applications, Spring Boot services, and Maven/Gradle multi-module projects

What Axiom Refract Analyzes in Java

Package and Class Dependency Mapping

Resolves Java import statements, including wildcard imports, static imports, and inner class references. Maps the complete dependency graph at the package, class, and method level across multi-module projects.

Spring Framework Integration

Detects Spring Boot component scanning, dependency injection patterns, bean definitions, and conditional configuration. Maps the Spring application context as an architectural overlay on the code dependency graph.

Annotation Processing Analysis

Parses Java annotations from Lombok, MapStruct, JPA/Hibernate, Jackson, and other annotation processors. Extracts dependency relationships created by annotation-driven code generation.

Interface and Abstract Class Hierarchy

Maps complete inheritance hierarchies including interface implementations, abstract class extensions, and sealed class/interface relationships (Java 17+). Identifies architectural patterns like Strategy, Factory, and Observer from structural analysis.

Multi-Module Build Analysis

Resolves cross-module dependencies in Maven multi-module projects and Gradle composite builds. Maps the module dependency graph alongside the code-level dependency graph.

How It Works

Java is parsed using a hand-hardened Tree-sitter grammar supporting Java 8 through 21 syntax, including records, sealed classes, pattern matching for instanceof and switch, text blocks, and virtual threads. The parser resolves package declarations and import statements against the project's source root structure. Maven pom.xml and Gradle build files are parsed for module dependency information and plugin configuration.

Common Findings in Java Codebases

God Service Anti-Pattern

Enterprise Java applications frequently develop oversized service classes that accumulate hundreds of methods and become architectural bottlenecks. Axiom identifies these classes by centrality score and method count.

Spring Context Over-Coupling

Spring's dependency injection makes it easy to inject services broadly, creating coupling that is invisible in the source code. Axiom maps the injection graph and identifies beans with excessive dependent counts.

DTO Explosion

Java codebases often develop parallel hierarchies of DTOs, entities, and view models with mapper classes between them. Axiom identifies these parallel structures and their coupling impact.

Circular Module Dependencies

Maven multi-module projects can develop circular dependencies between modules that the build system may tolerate but that create architectural fragility. Axiom detects these cycles at both the module and class level.

Polyglot Support

Java is one of 145+ languages Axiom Refract supports through Tree-sitter AST parsing. Java analysis covers Maven pom.xml, Gradle build files (Groovy and Kotlin DSL), Maven wrapper, Gradle wrapper, and dependency lockfiles. Repository configurations, plugin dependencies, and BOM imports are parsed for comprehensive dependency resolution. Your entire codebase is analyzed in a single scan — regardless of how many languages it contains.

Analyze your Java codebase.