-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use Roslyn code analyzer to parse source code #1
base: master
Are you sure you want to change the base?
Conversation
Thanks for the effort. Moving to Roslyn is an essential step forward for this project. One of the things I noticed is that the updated code computes cyclomatic complexity rather than simple complexity. Simple complexity is a metric introduced in Code-Complete, which counts decision points. I tend to keep it as the default metric since it got mainly positive feedbacks so far. We had in the past a feature request to be able to support cyclomatic complexity as well. It seems like we have a trigger to add this support now. |
I assume that code computes the same complexity value as before. Because all existing Unit Tests return the original expected values. Did you have some special reason to separate Parsing business logic and Calculation business logic to different projects? Currently when I use Roslyn it is unnecessarily complicated to parse C# code to some abstract representation (like ISyntaxNode etc.) and pass this instance to Calculator. I assume that it would be better use Roslyn to do everything at one time. I have a few problems to parse C# code in some cases (e.g. C# code is dirty and Roslyn analyzes uncompleted, not compiled code). Of course we can place component behind some interface. Btw. thanks for adding support for VS2017. I will also add into my branch. |
…nd removed VS 2010.
…roblem with unsupported syntax nodes (typically not builded code fragment)
Hi Eli, Mainly I have wanted to share this tool for my colleagues (for use in VS2017 and C# 6.0 features). I hope that it is no problem for you. Kind regards Vojtěch Kačmařík |
Roslyn Code Analyzers are used to C# code analysis.
I implemented C# code analysis using Roslyn.
The original implementation using NRefactory is still existed.
I done this as compatible solution, all of components are used using DI and implementation against interfaces.
I updated a few Unit Tests because I assume that they calculate the wrong values (I compared measured values againts R# Cyclomatic Complexity Extension and also Code Metrics Viewer, Tools included in VS).
The structure of the project is very similar to the original state.
Support for VS2017 is not added yet. I think it would be better to add this commit as separate task.