Please note: JArchitect is not only available for Mac: it’s also for Linux and Windows. Guess it all looks better on the other platforms.

I got the idea to analyze Apache log4j 2 with it. It took me a few minutes to find out how to include source code into the JArchitect project.

When I looked into the interactive graph (image above) I was not able to click on the source code. I don’t know why, because I started my analysis on base of my source code. Also the interactive graph is not very readable and I had to play a lot with zoom.

The HTML output was better. I recognized some information, like dependencies, wasn’t available. Chances are I configured something wrong.

I soon realized these are the rules which were applied to my report. JArchitect gives you a lot of flexibility to work with such rules because you are able to highly customize the tool. The rule above is something JArchitect provides under the name “Code Query Linq“, CQLinq in short. You can create your own CQLinq which reminds me very much on SQL. You could say, it’s SQL for your code. In combination with JArchitect’s editor you have a powerful tool to select specific parts of your applications.

You could for example select the 10 most complex methods or the most complex methods with lack of documentation. Actually this is really powerful and an impressive feature which can help you to analyze your code from a perspective which you will not get from the most maven based tools out there. In fact this is one of the killer features of JArchitect that I almost missed.

Anyway I could not find huge value for analyzing log4j2 with JArchitect. Most likely this is due to misconfiguration, but the project is also too small. I looked into something bigger, like Apache Struts 2. The report looked much better and much more useful. In my opinion JArchitect aims for big projects (as the name suggests).

To be honest, even the HTML output looks a bit dated. On the other hand it is possible to get out some useful information. This information could be retrieved with other, Maven-based tools too. Except if you want to include your own CQLinq rules, of course.

If you use a tool like JArchitect you definitely need to invest a certain amount of time to learn it properly. It is made for analyzing big software projects and offers a lot with CQLinq, but this power needs its time to explore.

The JArchitect tips I found for Struts 2 are more useful. Besides usual metrics like lines of code (87,260, yay!) and dependency analysis I got tons of alerts. Like, for example, “Methods are too complex” or that we have 481 “potentially dead fields” in Struts 2.

I am going to work a bit more with JArchitect in conjunction with Struts 2. I am not sure if I understand Struts 2 better with this tool, but it gave me some inspiration for how to improve the framework.

However, there are other tools out there that do similar things. If you don’t have a problem with a dated UI and some tricky configurations, you can surely get more out from JArchitect than I did. Personally I have the feeling that this tool will not grown on me very much--mostly because I am not dealing with huge architectures these days. If you have to oversee big software projects with a lot of dependencies you might benefit from the advanced dependency matrix or the customization options.

JArchitect has a trial version available on its website. If you can invest some time into actually learn about it and work on big Java architectures you might find a helpful (but ugly) companion.

Get the top tips for Java developers and best practices to overcome common challenges. Brought to you by Parasoft.