Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Path 通过独立规则构建依赖路径_Path_Dependencies_Ndepend_Cqlinq - Fatal编程技术网

Path 通过独立规则构建依赖路径

Path 通过独立规则构建依赖路径,path,dependencies,ndepend,cqlinq,Path,Dependencies,Ndepend,Cqlinq,我可以使用CQLinq/NDepend查找间接依赖项,并使用神奇的“FillIterative”方法过滤找到的依赖项。之后访问“DefinitionDomain”可以提供依赖路径的深度(跳数) 我现在的问题是: 我是否可以将依赖项路径添加到查询结果中的每个条目中?因此,对于列出成员“Target”的所有间接用法以及用法深度的查询,而不是表单的结果 method depth -----------------------------------------------------

我可以使用CQLinq/NDepend查找间接依赖项,并使用神奇的“FillIterative”方法过滤找到的依赖项。之后访问“DefinitionDomain”可以提供依赖路径的深度(跳数)

我现在的问题是: 我是否可以将依赖项路径添加到查询结果中的每个条目中?因此,对于列出成员“Target”的所有间接用法以及用法深度的查询,而不是表单的结果

method          depth
------------------------------------------------------------------------
Foo             2
Bar             1
Baz             0
method          depth          path
------------------------------------------------------------------------
Foo             2              Foo, Something1, Something2, Target
Bar             1              Bar, Something3, Target
Baz             0              Baz, Target
我会得到表格的结果

method          depth
------------------------------------------------------------------------
Foo             2
Bar             1
Baz             0
method          depth          path
------------------------------------------------------------------------
Foo             2              Foo, Something1, Something2, Target
Bar             1              Bar, Something3, Target
Baz             0              Baz, Target
…这可能吗

编辑:以下是我目前的查询:

// <Name>Async methods must not use non-async variants of EnsureInThisCtx methods, even indirectly</Name>
warnif count > 0
let mse = Methods.WithFullNameLike("DbContext\\.EnsureIsInThisCtx[^A]")
let m1 = mse.First()       // there are two overloads
let m2 = mse.ElementAt(1)  // of the method I want to catch.
let icd1 = m1.ToEnumerable().FillIterative(methods => methods.SelectMany(m => m.MethodsCallingMe.Union(m.OverriddensBase)))
let icd2 = m2.ToEnumerable().FillIterative(methods => methods.SelectMany(m => m.MethodsCallingMe.Union(m.OverriddensBase)))
let hits1 = (from m in icd1.DefinitionDomain where m.IsAsync select m)
let hits2 = (from m in icd2.DefinitionDomain where m.IsAsync select m)
from m in hits1.Union(hits2).Distinct()
let dist1=icd1[m]
let dist2=icd2[m]
select new { m, DepthOfUsageVariant1=dist1, DepthOfUsageVariant2=dist2 }

你能添加你提出的问题吗+这有帮助吗?嘿,我添加了我的尝试。您将我的观点发布到另一个方向的链接(同时查看DepthOfIsUsing和DepthOfIsUsedBy),但我不知道如何合并此链接。请添加您提出的查询+这有帮助吗?嘿,我添加了我的尝试。您将我的观点发布到另一个方向的链接(同时查看DepthOfIsUsing和depthofisuedby),但我不知道如何将其合并。