User Guides
Code Map (2D treemap): user guide
What the Code Map is
The Code Map is a treemap: the whole code base drawn as nested rectangles. Every rectangle is a code element, and the elements of the same parent are grouped together inside the parent's rectangle, which carries its name (Inventory.Domain, Inventory.IO...). Two metrics are drawn at once:
- Size: the area of a rectangle is proportional to a metric, by default lines of code. A big rectangle is a big element.
- Color: the color shows a second metric, by default maintainability, from green (good) to yellow to orange (poor).
So a large orange rectangle, like standard or decide in the screenshot, is a big method that is hard to maintain: a good place to start refactoring. A sea of small green rectangles is healthy code.

Toolbar reference
| Control | What it does |
|---|---|
| Level | The kind of element drawn: Project, Namespace, Type or Method (see below). |
| Zoom in / Zoom out and the number | Each click zooms the map by 10%. The number shows the zoom level (19 in the screenshots). Use it to read the labels of small elements. |
| Reset view (circular arrow) | Resets the zoom and position, removes the highlight and any baseline diff coloring, and redraws the map. |
| Size | The metric that defines the area of each element. |
| Color (toggle) | Turns coloring on or off. Off gives a plain map where only sizes matter. |
| Color metric (here Maintainability) | The metric that defines the color. |
| Info (blue i) | Show or hide the info tooltip (below). It is on by default. |
| Top N (bar chart) | Highlights the top elements by the current size metric (below). |
| Reset Highlight | Appears when elements are highlighted. Clears the highlight and redraws the map with the current level and metrics. |
Level

The same code base at four levels of detail. Project level shows a few large blocks, method level shows every method (the screenshots). Elements are grouped under their parents, so at method level you still see which namespace each method belongs to. Switching level keeps the size and color metrics.
Size and color metrics
Size

At method level the size can be: lines of code (LOC), cyclomatic complexity (CC), number of methods, overloads, parameters, variables, method level, methods called, methods calling me, method rank, lines of code covered, lines of code not covered. Other levels offer the metrics that make sense for them (for example the number of methods in a type). Choose LOC to see where the code is, CC to see where the complexity is, lines not covered to see where untested code is concentrated.
Color

At method level the color can be: debt, lines of code, lines of comment, percentage comment, maintainability, cyclomatic complexity, flash (bytes), RAM (bytes), overloads, parameters, variables, method level, methods called, methods calling me, method rank, percentage coverage, lines of code covered, lines of code not covered. Colors run from green (low, good) to orange (high, poor) for metrics where high is bad, and the reverse for maintainability and coverage, so green always reads as "fine".
Useful pairs:
| Size | Color | You see |
|---|---|---|
| Lines of code | Maintainability | Big and hard to maintain code (default). |
| Lines of code | Debt | Where the technical debt sits. |
| Cyclomatic complexity | Percentage coverage | Complex methods that are not tested. |
| Lines of code | Percentage comment | Large, undocumented code. |
| Methods calling me | Cyclomatic complexity | Popular methods that are also complex: risky to change. |
| Flash (bytes) | RAM (bytes) | Footprint, when the project provides linker map data. |
Coverage metrics need coverage data imported in the project.
Hovering an element

- The element under the mouse gets a blue frame.
- With the Info button on (default), a detailed tooltip appears (screenshot). From top to bottom it shows:
- the path of the element: project, namespace, type, and the source file with the line number (the small icon next to the line opens the file);
- the name of the element (here the method
standard()); - its metrics: LOC, Debt, MI (maintainability index, colored), Rating (A to E), CC (cyclomatic complexity), Issues, EC (efferent coupling) and COMMENTS;
- a reminder of the actions: Double Click for recommendations, Right Click for advanced actions, and "You can deactivate this tooltip from the toolbar".
- With Info off, only a small popup shows the element name and its LOC (for example
issue(int,constDate&,int), LOC 18). Use this to keep the map uncluttered. - The choice is remembered while you stay in the application.
Highlight the top elements

The bar-chart button offers Select Top 10, 20, 50, 100, 200, 500, 1000, 2000 and 5000. It runs a query on the whole solution and highlights the first elements in the current level (methods, types, namespaces or projects), ranked by the current size metric:
- lines of code, complexity, flash and RAM: the highest values first;
- maintainability: the lowest index first, so you get the least maintainable code;
- other metrics fall back to lines of code.
Highlighted elements stay bright, the others are dimmed, and a banner tells how many elements are highlighted with a Reset City link. Use Reset Highlight to come back. Highlighting is also what other pages do when you "show the result on the map", so the same banner can appear after a query or a graph request.
Acting on an element: right-click

| Item | Result |
|---|---|
| Prompt Builder | Builds an AI prompt about the element (submenu). AI is disabled by default; configure your provider first. |
| Show on Code Insight | Opens the element in Code Insight. |
| Review Diff since Baseline | Shows what changed in the element since the baseline. |
| Open source in CppDepend | Opens the source in the built-in source viewer. |
| Open Source in IDE | Opens the file in your IDE at the element. |
| Show on Dependency Graph | Shows the element in the Call Graph. |
| Append it to Graph | Adds the element to the graph already open. |
| Append it with its dependencies | Adds the element and what it uses and what uses it. |
| Select Issues / Projects / Modules / Namespaces / Types / Methods / Fields... | Selects the related elements of that kind, to continue in other pages or queries. |
Draw any query result on the map

From the Queries page, the Export menu of a result has Export to treemap (next to graph, matrix, HTML, Excel, XML and text). The elements of your CQLinq result are highlighted on the Code Map, at the right level. This is the fastest way to see where in the code base the result lives: for example the methods with a complexity above 20, drawn over the whole map.

After the export, the elements of the result are highlighted: they stay bright while all the other elements are dimmed, so the result stands out against the whole code base. The banner with the number of highlighted elements and the Reset City link appears, and Reset Highlight brings back the normal map.
Recipes
- Where should I refactor first? Size LOC, color Maintainability, method level. Start with large orange rectangles.
- Which modules are the biggest? Project or namespace level, size LOC.
- Where is complexity hiding? Size Cyclomatic Complexity, color Percentage Coverage.
- List the worst 50. Select Top 50, then right-click an element and open it in Code Insight.
- Show a query result. Run a query, Export, Export to treemap.
- Explain a hotspot. Right-click, Show on Dependency Graph, to see who uses it.
