Skip to content
Method

How RepoHIVE builds a hierarchy

RepoHIVE reads a repository’s source files and the dependencies between them, then decides for each package whether to keep it as written or rebuild it from those dependencies. Every decision is recorded with the numbers behind it.

Regions

Every package the authors wrote is a region. Regions are judged one at a time, so a well-organised part of a codebase can be kept while a tangled part next to it is rebuilt.

Scoring a region

Two measurements go into a region’s score. Cohesion is how strongly the region’s files depend on each other. Coupling is how much of their dependency weight leaves the region. Cohesion is squashed into the range 0 to 1, coupling is turned into independence, and the score is their weighted mean.

squash(c) = c / (c + k)
independence = 1 − coupling
score = (w₁ × squash(cohesion) + w₂ × independence) / (w₁ + w₂)

The squash constant k and the weights w₁ and w₂ are settings of the run. Each snapshot records the ones it used, and the Adaptivity page lists them.

Kept or rebuilt

A region scoring at or above the boundary keeps its package. The boundary is 0.5 unless a run sets another, and each snapshot records the one it used. Below it, the region is rebuilt by community detection over its dependencies. A score close to the boundary is a close call, and the Decisions page lists those.

Regions too small to measure

A region with fewer than two files, no dependencies inside it, or no internal strength cannot be measured. It scores 0 by rule and is rebuilt without assessment. Shares such as “kept” count the assessed regions only, and every page that shows one says so.

Same input, same output

Group ids are hashes of their sorted member ids and clustering uses a fixed seed. Indexing the same commit twice produces byte-identical files, so a link to a region or a decision stays valid.

The views

  • Overview: the repository in figures, and its largest regions.
  • Map: the hierarchy as nested cards you zoom into.
  • Hierarchy: every level at once; radius is depth, sweep is files.
  • Decisions: each region's score, the boundary, and the values behind the decision.
  • Architecture: level sizes, dependencies between groups, how far packages were split.
  • Baseline: the flat file graph before any hierarchy, for comparison.
  • Adaptivity: how many regions were kept, and how scores are spread.