Questions tagged [cqlinq]

CQLinq is a LINQ-like query language used by NDepend to reflectively analyze .NET source code using the NDepend tool.

CQLinq is a LINQ-like query language used by NDepend to reflectively analyze .NET source code using the NDepend tool.

References

52 questions
1
vote
1 answer

NDepend: how to export the result from a query

I've got a CQLinq query which returns a list of methods and a list of members for each of them. Exporting the query result will only show the number of elements. I thought about using a Linq Aggregate( (a,b) => a + ',' + b). Is there a better…
Revious
  • 7,816
  • 31
  • 98
  • 147
1
vote
1 answer

NDepend find private methods without documentation

i'm new to ndepend and i want a cqlinq rule to find all not documented methods. Thats my current query, but there is no documented-Property. from m in Application.Methods .Where(m => !m.IsGeneratedByCompiler && m.Visibility == Visibility.Private &&…
Dosihris
  • 145
  • 9
1
vote
1 answer

Building CQL in NDepend for verifying MVVM patterns

I wanted to verify few design patterns in C# code by static analysis. I want to verify these using NDepend. The application is built with MVVM design style, so typical design patterns that I would like to verify are: 1. View-Model classes do not…
Shaun
  • 199
  • 1
  • 10
1
vote
0 answers

Get value of a field with Ndepend

I'm trying to make a rule for detect fields that hava assigned values with Ndepend. But I don't know if it's possible to get the value of the fields. For example, if I have String X='abc' I want to retrieve the x value that would be 'abc'
Andrew
  • 11
  • 2
1
vote
1 answer

NDepend Report JustMyCode

I would like to get the Abstractness and Instability of a Solution and ignore third party libraries. I know, I can use JustMyCode in CQLinq, but I want to use the diagram produced by the report. How can I enable JustMyCode for Reports? Basically I…
Achim Stuy
  • 53
  • 8
1
vote
1 answer

How can I use NDepend to find the members that cause two types to be intertwined?

I'm trying to disentangle a lot of heavily interdependent types in one of my company's .NET assemblies. It seems like the first step would be to take a couple of classes and look at which members of each cause them to be interdependent. How can I do…
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
1
vote
1 answer

Get the IType from a known type

I need to check if the types that have the name terminating with "Repository" derives from a base class called "DefaultRepositoryBase". I've searched but I' ve not been able to find how to get the IType from a known type...how can I achieve this and…
advapi
  • 3,661
  • 4
  • 38
  • 73
1
vote
0 answers

Build Dependency path via NDepend rule

I can find indirect dependencies using CQLinq / NDepend, and using the magic "FillIterative"-Method I can filter the found dependencies. Accessing the "DefinitionDomain" afterwards can give me the depth of the dependency path (how many hops). My…
1
vote
0 answers

NDepend How to write query for Methods indirectly using some Method with custom filter on the usage path hops

I'm struggling with NDepend a bit. It's a bit hard to explain. I have a method in my codebase (lets call that method 'TheMethod') that mustn't be called by other methods of a certain kind (lets call this kind 'TheKind'), unless they are decorated…
1
vote
1 answer

Refining CQLinq rule for nested visibility

We have NDepend 5.4.1 and we want to alter the queries for field/type/method that could have lower visibility. We want the query to take the scope of the enclosing class into account when deciding whether to consider it a violation. For…
Jerry R
  • 43
  • 4
1
vote
1 answer

CQLINQ for list of methods returning a specific type or interface?

What is the CQLINQ to get list of methods returning a (compatible) specific type or interface?
jimjim
  • 2,414
  • 2
  • 26
  • 46
1
vote
1 answer

CQLINQ for list of methods that take a type as a parameter?

What is the CQLINQ to get list of all the methods taking a (compatible) type or interface at least as one their parameters?
jimjim
  • 2,414
  • 2
  • 26
  • 46
1
vote
1 answer

How to define NDepend API CQLinq execution context in c#?

When I port a NDepend CQLinq query to C# I must allways start defining a codeBase to query to, so this CQLinq query from m in Methods where m.ILCyclomaticComplexity > 10 select new {m} using NDepend API in C# I must port to: ICodeBase…
Kaikus
  • 1,001
  • 4
  • 14
  • 26
1
vote
1 answer

Port NDepend CQLINQ query to c# LINQ

Is it possible to use to port a CQLinq query to a simple C# LINQ query? I am creating a code analyzer tool using NDepend API, and I would like to use the CQLinq queries. Some are easy to port. For example, from m in Methods where…
Kaikus
  • 1,001
  • 4
  • 14
  • 26
1
vote
1 answer

Why does NDepend show CQL errors when run on the command line but not from the GUI?

I've got this bit of CQL: // A stateless class or structure might be turned into a static type warnif count > 0 (from t in Application.Types where t.SizeOfInst ==0 && // For accuracy, this constraint doesn't take // account of…
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87