Metropolis - a codebase visualization tool

Usage no npm install needed!

<script type="module">
  import metropolisCore from '';



Please use npm package metropolis

What is Metropolis?

Metropolis is a code visualization aid to help in review and analysis.

How to Install

  1. Install NodeJS on Windows
  2. Run Set-ExecutionPolicy remotesigned in your powershell console
  3. npm install -g metropolis-core

Currently, Metropolis only support Windows sorry no WPF on Mono yet.

We plan on supporting the command line interface using Mono at some point in the near future.

How it Works

Metropolis maps every code unit (for C# or Java this is a class, for Javascript this is a file) into a city building. The default is to create taller building based on lines of code and the color of that building based on how healthy the code is. All the green and short buildings are good. The tall red ones need to be reviewed by the techinical team to ensure that code quality is maintained or improved.

For more information on code health please read Erik Doernenburg's awesome article on How Toxic is Your Code?. It explains toxicity scales and how they are calculated for Java. Toxicity is essentially a Richter Scale of code health. If your code has an average toxicity of higher than 0.500 (e.g. C#, Java, Javascript/ECMA) then it's likely a good idea to refocus on code quality to improve the maintainability and extensibility of the code.

Example - Hibernate

Cityscape of Hibernate

Hibernate is an object relational mapping tool used to speed up development of applications. Hibernate has over 330,000 lines of code and an average toxicity of 1.335. You can see some areas are very good, but given the size and complexity of this project there are areas of concern highlighted in red. Using Metropolis's code inspector you can view these classes to review this code.

Getting Started

Beginner's Guide is a good place to start as is the Code Analysis Primer.


Metropolis is licensed under BSD (see LICENSE).

Metropolis depends on the following open source software: