Code metrics .NET Core application RRS feed

  • Question

  • Hello,

    I use Roslyn metrics tool to compute code metrics. In our project metrics are computing in night and next day I can say programmer there is long and complex method which should be rewriting. 

    I use two metrics only - lines of code (max. 25) but if there is low complexity, programmer can writer longer methods. Second metrics is cyclomatic complexity (max. 10). 

    I want to prevent huge complexity methods with many lines. Our programmers prefer write condition for some case better than write new class. At the end of code process there could be method with huge complexity and more then 200 lines. It is unreadable, unmaintainable, ... 

    We started with .NET Core projects but there are not code metrics supported in Visual Studio. I tried to compute it by Roslyn metrics tool but there is problem that solution or project file is in newer format and could not be opened. This tool uses CodeAnalysis and Roslyn libraries. 

    Is there any way to compute metrics by free tool with automated computing and exporting result to excel? I need only two metrics - complexity and lines count (without comments). 


    Saturday, February 24, 2018 12:40 PM


  • Hi Petr B,

    Thank you posting here.

    This forum is discussing Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    According to your description, the issue is more related to ASP.NET Core, I suggest you post this issue to the ASP.NET Core forum for a professional answer.


    Thanks for your understanding.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Judy ZhuY Tuesday, February 27, 2018 9:48 AM
    • Marked as answer by Petr B Friday, March 2, 2018 6:02 AM
    Monday, February 26, 2018 6:25 AM