@@ -105,6 +105,16 @@ let TestHardcodedFiles() =
105105 |> Seq.iter ( fun ( KeyValue ( idx , deps )) -> printfn $" {graph.Files[idx].Name} -> %+A {deps |> Array.map(fun d -> graph.Files[d].Name)}" )
106106
107107 analyseEfficiency graph
108+
109+ let totalDeps = graph.Graph |> Seq.sumBy ( fun ( KeyValue ( k , v )) -> v.Length)
110+ let topFirstDeps =
111+ graph.Graph
112+ |> Seq.sumBy (
113+ fun ( KeyValue ( k , v )) ->
114+ if v.Length = 0 then 0
115+ else v |> Array.map ( fun d -> graph.Graph[ d]. Length) |> Array.max
116+ )
117+ printfn $" TotalDeps: {totalDeps}, topFirstDeps: {topFirstDeps}"
108118
109119let private parseProjectAndGetSourceFiles ( projectFile : string ) =
110120 let m = AnalyzerManager()
@@ -129,9 +139,9 @@ let TestProject (projectFile : string) =
129139 { Name = f; Code = code; AST = ast}
130140 )
131141 |> Array.filter ( fun x ->
132- true
133- // ASTVisit.extractModuleRefs x.AST
134- // |> Array.forall (function | ReferenceOrAbbreviation.Reference _ -> true | ReferenceOrAbbreviation.Abbreviation _ -> false)
142+ // true
143+ ASTVisit.extractModuleRefs x.AST
144+ |> Array.forall ( function | ReferenceOrAbbreviation.Reference _ -> true | ReferenceOrAbbreviation.Abbreviation _ -> false )
135145 )
136146 let N = files.Length
137147 log $" {N} files read and parsed"
@@ -149,4 +159,15 @@ let TestProject (projectFile : string) =
149159
150160 log $" Analysed {N} files, detected {totalDeps}/{maxPossibleDeps} file dependencies (%.1f {100.0 * double(totalDeps) / double(maxPossibleDeps)}%%)."
151161 log $" Wrote graph in {path}"
152- analyseEfficiency graph
162+
163+ analyseEfficiency graph
164+
165+ let totalDeps = graph.Graph |> Seq.sumBy ( fun ( KeyValue ( k , v )) -> v.Length)
166+ let topFirstDeps =
167+ graph.Graph
168+ |> Seq.sumBy (
169+ fun ( KeyValue ( k , v )) ->
170+ if v.Length = 0 then 0
171+ else v |> Array.map ( fun d -> graph.Graph[ d]. Length) |> Array.max
172+ )
173+ printfn $" TotalDeps: {totalDeps}, topFirstDeps: {topFirstDeps}, diff: {totalDeps - topFirstDeps}"
0 commit comments