Architexa is an Eclipse plugin for code analysis. I tested it on a fairly large application. My expecation going in was that it would only be useful to get up to speed- in fact, the diagramming functionality would help me answer common questions. E.g. Which screens use external services, how much of the project is covered by tests, where is this unused class referenced.
Eclipse provides great code browsing tools. Sometimes these are overwhelmed by code that is generated, or related through several layers of abstraction. Architexa allows you to view these relationships, collapsing intermediate layers by Java package.
The main tool is a diagram editor, showing all all classes rolled up by package. One of the main feature of the diagramming tool is highlighting package or class relationships- when you hover over a package, it shows arrows representing the relationships to other packages.
Packages and classes are sorted by usage – classes that reference other classes but are rarely referenced are at the top. Packages are sized like a tag cloud, but appear sorted by application layer. Roughly, seemed work well for my project.
The layers this identifies for my project are, roughly:
- Unit test packages and scheduled jobs
- REST API and Ajax packages
- UI components
- Reporting and security
- Database layer
Each layer had some random packages in it – an unavoidable artifact of the this sorting method. It can’t identify application layers beyond what is clear from code organization, and they’re not necessarily all in the order I expected. I suspect this is contingent on how well the project is organized.
If you double-click a package, it expands to see sub-packages. Unlike a lot of reporting packages, drilling expands the package, but without removing the other packages. When I expand our UI package, this product really starts to shine. Hovering over individual UI components shows related UI components, as well as related data layer packages.
I can tell, for example, which components have dependencies on several specific external services, which UI components orchestrate the others, which are unused, and which have unit tests.
Feature-wise, this single screen is pretty powerful. The UI gets packed quickly, although they allow you to control-click and select multiple packages. Unfortunately there isn’t a good way to only see a single dependency direction, and there does not appear to be a way to query their database.
The installation is fairly simple, as Eclipse plugins go, although it does require a login. Make sure to validate your account before logging in- if there are errors, they are not reported. While supposedly free, it does look up the license information every time Eclipse loads, and Eclipse doesn’t need any help running more slowly.
If you’re evaluating this tool, there are a few questions I’m not certain of the answer- does this work in IntelliJ? Does it work on non-Java JVM languages (e.g Scala, Clojure) Can it be applied to a jar (one of the most common instances of dealing with unknown code)? And does it require your code to compile inside Eclipse (while ideal, is not always feasible, if missing external dependencies, or on a new project)