nDepend - get filtered assemblies to analyze - ndepend

I am using nDepend and I wonder how can I tell nDepend that I'd like to analyze assemblies which names start with specfiic string (Test for example). What I see is that I need to provide full names of the assemblies and I cannot use any sort of wildcards.

Have you tried this?
NDepend Start Page
Analyze VS Solutions and VS Projects
Select a VS solution file
then on the up-right corner of the DataGridView use the filter capabilities (shown in screenshot below)

Related

Exclude test projects from Ndepend Analysis

I have a visual studio solution which has a lot of projects including unit test projects. I am using NDepend API to analyze the solution. The intention is to get the relationship between methods. I am doing this by using MethodsCalled and MethodsCallingMe. Since there are test projects in the solution. I am ending up with lot many relationships as the unit testcases call the actual implementation, which is unnecessary for what I am trying to achieve.
Is there a way to exclude unit test projects when analyzing the solution?
Ndepend - exclude assembly in some ways but not others
The link has some information not sure if this can be used with NDepend API.
Any help appreciated.
Are you getting your assemblies through this code?
// 2) obtains assemblies file path to analyze
var assembliesFilePath = (from vsSlnOrProjFilePath in vsSlnOrProjFilePaths
from assembliesFilePathTmp in visualStudioManager.GetAssembliesFromVisualStudioSolutionOrProject(vsSlnOrProjFilePath)
select assembliesFilePathTmp).Distinct().ToArray();
What about a LINQ filtering by assembly name, something like:
visualStudioManager.GetAssembliesFromVisualStudioSolutionOrProject(vsSlnOrProjFilePath)
.Where(a => !a.Name.ToLower().Contains("test"))

asp.net decompiled function is same but ndepend shows difference

I have decompiled 2 .net 2.0 dlls (using a decompiler tool) and when I compare a function both are same. But when I compare these 2 assemblies, ndepend shows difference in ILInstructions and NBLinesOfCode.
Please let me know why ndepend is showing the function difference but decompiled code is same? if having differences (IL Instructions and LOC) in ndepend means the functionality is really different for 2 dlls?
What steps I can take to make the 2 assemblies same so that ndepend doesn't show difference in that function?
Please note I have lost original source code and I am trying to re-build the source code to make it original dll.

How do you query .Net source for methods containing a string using NDepend?

I would like to find out all classes that have an inline SQL Statement in them. How do you write an NDepend CQL query that scans the method body looking for the use of say "Select"? Is it possible?
Thanks in Advance.
NDepend is more about code structure, code quality, code metrics, code diff ... It doesn't know about string constants content, so this is not the right tool for what you need to do.
For that I'd advise using Mono.Cecil which is an assembly content reader API (OSS/free) pretty well done! Btw NDepend relies on Cecil for reading assemblies and I can say it is a great API with high performances and pretty close to bug free!.

JBehave Sentance "API" Generator available

I'm trying to provide my QA team a list of available sentences in JBehave based on methods annotated with Given, When, Then, and Alias. As follows:
Then $userName is logged in.
Then user should be taken to the "$pageTitle"
I recently wrote a simple script to do this. Before I put more work into it I wanted to be sure there wasn't something better out there.
For one there is the Eclipse integration for JBehave, which offers code completion, thus providing all steps directly from the code ( http://jbehave.org/eclipse-integration.html ). Note that it doesn't go through dependent .jars though - only what it can find in the source tree.
i.e, enter "Given", hit Ctrl+Space and get all the available given steps.
But there has also been some work parsing the run results with a "Story Navigator" ( http://paulhammant.com/blog/introducing-story-navigator.html ), which offers a listing of the steps. But I'm not sure whether it can list unused steps; Furthermore this one seems more like a proof of concept to me (I wasn't able to make proper use of it).

Creating a Visual Studio project directory using T4

I am trying to use T4 for source code generation. Mostly, I am able to generate individual files using it. How do I create a complete Visual Studio directory (preferably separate from the T4 template directory) having the below sample structure:
/MyProject – Contains MyProject.sln.
/app - Contains the core project layers.
/MyProject.ApplicationServices
/MyProject.Core
/MyProject.Data
/MyProject.Web
/MyProject.Web.Controllers
/build - Empty folder for housing build related stuff.
/lib - Contains the solution items for the deployable application.
/db - Contains database schema information; e.g., the result of scaffolding and/or NHibernate's schema export.
/docs - Project documents.
/logs - Output location for log files.
/tests
/MyProject.Tests
/tools
/lib - Contains the solution items for the tests project and all other non-deployable assemblies.
/CrudScaffolding - Customizable CRUD, scaffolding generation code.
You may take a look at the Guidance Automation Extensions and Toolkit for Visual Studio from Microsoft. They are intended for exactly that purpose to be able to author project and solution generation wizards and leverage T4 a lot. In fact, they are the reason why T4 came into being in the first place. However, as they can be seen as a "Software Factory Factory", they do have a steep learning curve.
As herzmeister der welten mentions, I do think Guidance Automation could do this sort of job, but it is quite a learning curve.
Here are a couple of other options:
Damien Guard has a post on how to generate Multiple outputs from T4. However, it's probably not well-suited for creating lots of different types of files. If you have many files to create of a similar type (e.g. several code files, various project files, etc) that you want to create, his technique would be quite useful.
Another option would be to combine your existing T4 templates and knowledge and create your outputs using command line T4. For example, you could simply use a .bat file that executes various commands to generate the necessary outputs using T4 and your existing templates. The downside here is that it is difficult to pass arguments into the command line utility, but there are some workarounds to that problem too.