|
How To Use Nitriq Code Analysis
Step 1 - Unzip Nitriq.zip to your prefered location
Step 2 - Launch Nitriq.exe
There is no need to install Nitriq, just run the application. Nitriq REQUIRES .NET 3.5 SP1 to be installed. It is available for download here.
Step 3 - Click New
Step 4 - Pick Assemblies
Browse to the .Net assemblies that you'd like to analyze and query. These assemblies are referred to as
your "Core" assemblies. It is not recommended that you analyze 3rd party assemblies, but
any dependencies your Core assemblies have will be partially analyzed. It is also not recommended
that you analyze multiple versions of the same assembly at the same time.
It is recommended that you
pick assemblies out of your bin/debug directory because Nitriq needs the .pdb files in order to
capture Physical Line Count, Percentage Comment and Cyclomatic Complexity (these features only work
with C# projects, although VB.NET support is planned).
Step 5 - Review Assemblies
Double check the assemblies that you've picked. If you have assemblies in multiple directories
you can add more by clicking "Add Another Assembly". If you've erroneously added an assembly,
simply highlight the row and hit delete. Once you're satisfied, click "Analyze".
Step 6 - Wait for Analysis to Finish
Nitriq will use Mono.Cecil to gather information on your assemblies, including type and method
dependencies, and stores it in an easily queryable object format. After the analysis window
dissappears there may be a few second delay while the treemap is drawn.
Step 7 - Open a Query
Browse through the available queries and double click on a query to open it in the editor window.
Common interactions with the Query window are driven through context menus.
Step 8 - Edit Query
You can now edit the query in the newly created document window. It is important that you assign
your Linq statement to a variable named "results", otherwise your query will fail to compile.
IMPORTANT - Nitriq's editor component
does not yet support full-blown C# autocompletion. However, you can easily see all of the properties
on the important Nitriq types as long as your variables are named appropriately (i.e. if you want
to see autocomplete off an IMethod variable, the variable name needs to equal "m" or contain the
case insenstive string "method"). It is highly recommended you read the additional information available
when you click on "Query/Editor Help" in the upper right hand corner of the query editor.
Step 9 - Execute Query
You can click on the Execute ribbon button, or you can hit F5 to run the active query.
Step 10 - View Results
You can view the results of your query hierarchically by activating the "Code Tree" tool window.
Or, if you'd like to do sorting among all of your results, you can view the results in a single grid
by activating the "Grid" tool window. In order for the Code Tree to work correctly, you must select
one of the following properties in your Linq projection: AssemblyId, NamespaceId, TypeId, MethodId,
FieldId or EventId. Also, multi-level projections are not yet supported with Nitriq (using "group by"
in your query).
Step 11 - View Treemap Results
The results of your query are automatically highlighted in blue in the treemap docking window. If
your query returns Types but the treemap is displaying "Methods - Cyclomatic Complexity", every method
from every Type returned as a result will highlight in blue.
Step 12 - Interact with Results
Double clicking on any code element icon (assembly, namespace, type, etc), the appropriate areas in
the treemap will highlight in red. Below you can see what happens when you click on the namespace
icon for the namespace "FarseerGames.FarseerPhysics.Collisions"
Step 13 - Save/Load/Reanalyze Project
You can save your Nitriq project (the assemblies that were analyzed) by clicking on "Save".
The next time you launch Nitriq, you can click on "Load" to load your project. If you've made significant changes to your
assemblies while Nitriq is still open, you can click on "Reanalyze" and your queries will reflect
the changes you've made.
Step 14 - Give Jon Some Feedback
As you continue to play around with Nitriq, please let me (von@nitriq.com) know if there is anything
that you like/don't like/want changed about Nitriq. I'm just a guy who loves .Net and wants to help out
the community by providing high-power, reasonably priced tools.
|
|
|