You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tune Ruby/Rails architecture findings to cut false positives
Rails snapshots produced noisy, often-wrong findings: Ruby modules are
directories and coupling is synthesized from autoloaded constant
references, so the module graph is nearly complete and bidirectional and
the generic OOP/hexagonal explainers over-fire.
- layers: re-level the Rails pattern to two tiers (delivery=controllers/
views, domain=everything else) so idiomatic model->service/job/helper
references are no longer "violations"; only domain->delivery smells
fire. Also classify interactors/presenters/serializers/notifiers/types.
- god-class, hotspots: dedupe candidates by symbol name (a constant
reopened across N files no longer yields N identical findings, e.g.
RailsAdmin::Config::Actions x50) and cap god-class output at 25.
- cycles: report SCCs larger than 8 modules as one low-confidence
"highly coupled module cluster" note instead of a confidence-1.0
cyclic-dependency alarm; in autoloaded Rails a giant SCC is expected.
- ruby extractor: tag synthetic coupling edges with coupling_kind and
exclude ActiveRecord associations from cycle detection (has_many/
belongs_to pairs are bidirectional by nature); add framework constants
(I18n, Rails, Logger, GlobalID, Mime) to the fan-in ignore list.
- bump cacheVersion v94->v95 (+ cachecov coverage entry).
Description: fmt.Sprintf("The following modules form a dependency cycle: %s. This can cause initialization issues, make refactoring harder, and indicates tight coupling.", cyclePath),
51
74
Confidence: 1.0, // Deterministic
@@ -61,6 +84,39 @@ func (e *CycleExplainer) Explain(ctx context.Context, store *facts.Store) ([]fac
61
84
returninsights, nil
62
85
}
63
86
87
+
// coupledClusterInsight reports an oversized SCC as a soft coupling signal rather
88
+
// than a discrete cycle. The title deliberately does NOT start with "Cyclic
89
+
// dependency" so pkg/explain does not fold it into the cycle count.
0 commit comments