Reputation: 30904
Current static source analysis tools for C# (or other .NET languages) usually operate on the assembly-level. They use reflection to analyse the code.
Are there tools available that operate on a source code level only (like lint for C)?
Upvotes: 2
Views: 1138
Reputation: 95354
My company provides Metrics analysis and code duplication analysis for C#, as well as a general tool for constructing arbitrary analysis and/or transformations, directly on C# source code. The tools can operate on complete systems of files as well as individual files.
Upvotes: 0
Reputation: 11876
If you are considering commercial analyzers, I've evaluated Klocwork Insight, and it is clearly source based analysis for C#.
Upvotes: 0
Reputation: 4865
Have you looked into StyleCOP? It parses your source code and raises source-level issues. Otherwise, what's the issue with running on the IL?
Upvotes: 0
Reputation: 57688
IIRC, SourceMonitor works at the code level and also Microsoft StyleCop.
SourceMonitor:
The freeware program SourceMonitor lets you see inside your software source code to find out how much code you have and to identify the relative complexity of your modules.
StyleCop:
StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project.
Upvotes: 1
Reputation: 23770
There are several tools (even R# does it), the right tool depends on the analysis you want to perform.
A dedicated tool that does it is CodeIt.Right.
Another way is to use a parser (like the one Sharp Develop uses) and perform the analysis using your own code.
Upvotes: 1