Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code - Is there a way to calculate all the lines of code in a project?

Is there native functionality or a recommended extension to get the number of lines of code in a project/workspace or folder in VS Code?

I found this older post below for for VS 2010 & 2013 using Analyze --> Calculate Code Metrics as native functionality. I'm looking at extensions that might do this as well. Also, I am using a specific theme I like (Dracula Official) so I'd prefer not to have to add another theme if possible.

VS 2010 & 2013 Analze -> Calculate Code Metrics

like image 963
Jason_L Avatar asked Aug 20 '20 19:08

Jason_L


People also ask

How do I count lines of code in Visual Studio project?

In VS2010 there is a in-built tool that counts all lines of code and other values too: Go to View -> Other Windows -> Code metrics results.

How do I find line of code?

To use cloc simply type cloc followed by the file or directory which you wish to examine. Now lets run cloc on it. As you can see it counted the number of files, blank lines, comments and lines of code. Another cool feature of cloc is that can even be used on compressed files.

How do you find a word in a whole project in VS Code?

VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.

How to count lines of code in a Visual Studio project?

In this article we covered using visual studio to count lines of code in a .net solution.With the tool Code Metrics in Visual Studio you can measure C# LOC or count the lines of code in any project within Visual Studio Ultimate edition.We hope you understood and enjoyed the article. I would like to have your feedback in the comment section below.

What is the lines of code extension for Visual Studio Code?

The Lines of code extension for Visual Studio Code counts and displays the lines of code, the lines of comment, the lines of blank. Count the number of lines of current opened file. Count the number of lines of workspace files. Also, you can custom the includes/excludes file pattern.

How can I measure my programming progress by lines of code?

Measuring programming progress by lines of code is like measuring aircraft building progress by weight. ... Anyway, to measure the LOC in Visual Studio I am using Visual Studio 2017 Community Edition, open you solution and right click on it and find Calculate Code Metrics.

How do I calculate lines of source code in a window?

That displays the window. Then you have to go on the Analyze Window, and click Calculate Code Metrics. However you might want to take these with a pinch of salt. As I understand it, Lines of Source Code is calculated from the il code output from the compiler.


1 Answers

check this extension for vscode counting lines of code in a particular directory, workspace and provides many other feature as well.

https://marketplace.visualstudio.com/items?itemName=uctakeoff.vscode-counter

like image 109
prashant kumar Avatar answered Oct 17 '22 10:10

prashant kumar