Overrides of the default LibraryExtractionScannerConfig
InternalCohesion score = weighted average of:
Location is weighted highest: for library extraction, artifacts in the same shared folder belong in the same library regardless of whether they import each other (most UI components are independent by design).
Calculate reusability score (0-100).
Formula: score = locationBonus + crossModuleUsage * 0.3 + isPubliclyExported * 0.15 + minimalDependencies * 0.15 + hasTestFile * 0.1
locationBonus: 30 points for any file already placed in a shared/libs/common/core folder — the developer already decided it belongs there.
crossModuleUsage is normalized to min(count/3, 1): each additional importer above 1 increases the score (3+ usages = max contribution).
minimalDependencies = 1 - min(dependencyCount / 10, 1) — uses /10 instead of /5 so Angular components importing @angular/core etc. aren't penalised as heavily.
Data-only artifacts (interfaces / types / enums / consts) never have spec files, so their 10-point test slot is filled with importer evidence instead: min(crossModuleUsage / 5, 1). A model imported from 5+ other folders is as proven as a tested component.
Scan all source files in the context's project for library extraction opportunities.
Library extraction scanner.
Finds artifacts in the target folders that could move into dedicated Angular libraries with secondary entry points:
minReusabilityScoremodelsclusterminCohesionScoreand reports each as a LibraryExtractionOpportunityPure TypeScript weighted scoring, no external ML dependency.