【问题标题】:Count the number of indirectly used assemblies in NDepend计算 NDepend 中间接使用的程序集的数量
【发布时间】:2020-07-23 10:02:44
【问题描述】:

我正在尝试计算 间接 程序集引用。以下内容不起作用,因为 IsIndirectlyUsing 需要一个常量字符串:“仅接受常量文字字符串作为 IsIndirectlyUsing(string) 的输入”

有没有办法让 indirect 程序集被使用?

from a in Assemblies 

let indirectlyUsed = 
  from dep in Assemblies
  let depName = a.FullName
  where a.IsIndirectlyUsing(depName)
  select dep

where a.PDBFound orderby a.AssembliesUsed.Count() descending
select new { a, a.AssembliesUsed, indirectlyUsed, a.NbLinesOfCode, a.NbILInstructions }```

【问题讨论】:

    标签: ndepend


    【解决方案1】:

    NDepend.API 方法 FillIterative() 可以提供帮助:

    from a in Assemblies 
    
    let indirectlyUsed = a.AssembliesUsed.FillIterative(
        asms => asms.SelectMany(a1 => a1.AssembliesUsed)).DefinitionDomain
    
    where a.PDBFound orderby indirectlyUsed .Count() descending
    select new { a, a.AssembliesUsed, indirectlyUsed, a.NbLinesOfCode, a.NbILInstructions }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-03
      • 1970-01-01
      • 2012-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-30
      相关资源
      最近更新 更多