Skip to main content

Practice · 1 of 3

Syntax metrics

CHALLENGE
Difficulty: advanced+25 XP

Implement static (int methods, int classes, int invocations) Metrics(string source): parse the source and count MethodDeclarationSyntax nodes, ClassDeclarationSyntax nodes, and InvocationExpressionSyntax nodes. This is the code-metric tool every linter starts with.

Back to lesson: Practice: Roslyn drills