2

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)?

5 Answers 5

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

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?

1 Comment

We're looking into a solution to analyze source-code in a changeset before that changeset is added to a branch. This requires analysis on a source-code level, because there has been no build yet. Personally I believe FxCop gives you more information, but FxCop cannot be used in the scenario I describe above.
0

If you are considering commercial analyzers, I've evaluated Klocwork Insight, and it is clearly source based analysis for C#.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.