Apparently there is an 'analyse' tab to be able to view the metrics but I can't see it,(using latest version) don't think its in this version. I already have LOC as I downloaded an extension but how would I get other metrics? Languages are Java, CSS and HTML
3 Answers
Did you say vscode
? There seems to be no built-in code metrics in Visual Studio Code. There is a code metrics tool in Visual Studio! However I don't know whether it'll work for the languages you have mentioned.
Also, there are two extensions I've used for code metrics in vscode. But these are for JavaScript/TypeScript only.
I liked the first one better.

- 943
- 2
- 19
- 35
I am using the latest version of VS Code. There is no Analyse Tab in it. I installed the CodeMetrics extension from MarketPlace. It worked out of the box. Though there are a few things you can check:
- Whether Codemetrics › Basics: Diagnostics Enabled is checked in CodeMetrics settings.
- Your CodeMetrics is configured for your language and requirements are configured as per your need. Most of the Lua configurations are present along with the score they add to the complexity. These scores are subjective
Example: I had a function which has 1 if, 3 else if blocks, and 1 else block. All of which adds 1 to complexity - So the total complexity of my function was 5.
That's all

- 23
- 5
Did you try Analyze menu -> “Calculate Code Metrics for Solution.”
-
1I said in my OP that there is no 'analyse' menu – Kirsty Liv Apr 09 '22 at 22:14
-
@KirstyLiv Oops my bad – Shutirtha Roy Apr 10 '22 at 23:58