Visualising your code as a city

I was looking at visualising some code recently and came across CodeCity. It’s somewhat useful and quite interesting, but getting it to work is not as simple as it once was…

This is because CodeCity uses the Famix 2.1 model to visualise your code, and very few of the tools referenced on the CodeCity website and most other blog posts are still available.

I did however find this useful blog post that highlights one tool still available: Analyzing a Java Codebase with CodeCity in 2016

Essentially, you need to download CodeCity and iPlasma.

iPlasma ScreenshotThen you use iPlasma’s Swing interface to import your codebase and then generate a Famix model of your code (This takes a while). After all this you end up with a rather strange looking screen from where you can run the “Moose MSE exporter” tool.

This finally gives you a Famix 2.1 model which you can import into CodeCity and (after some more waiting) generate a city visualising your code.

I found that this works fairly well, however some of my classes seems to be missing from the visualisation (Some big god objects), and I haven’t been able to figure out why yet.

Still, it’s an interesting way to look at your code. It also let’s you generate visualisations of multiple versions of your code and show you how the “city” evolved.