Visual studio how many lines




















Now select "Find All". At the bottom of the Find Results window, you will see "Matching Lines" which is the lines of code count. Note: anything between the braces would be included in the search, but in this example only 4 lines of code would count, instead of 18 actual non-blank lines:.

I created this to give me a much more accurate LOC count than some previous options, and figured I would share. The bosses love LOC counts, so I'm stuck with it for a while. I hope someone else can find this helpful, let me know if you have any questions or need help getting it to work. Now it won't specifically run on a VS solution file, but it can recurse through directories, and you can set up filename filters as you see fit.

The third generation equivalent scale is a rough estimate of how much code it would take in a third generation language. Not terribly useful, but interesting anyway. Answers here are a little bit out of date, may be from vs time. Thus there are no reason to use any extension or tools for it.

Feature to count lines of code - Calculate Metrics. With it you can calculate your metrics LOC, Maintaince index, Cyclomatic index, Depth of inheritence for each project or solution. Later data for analysis and aggregation could be imported to Excel. Also in Excel you can filter out generated classes, or other noise from your metrics.

These metrics including Lines of code LOC could be gathered also during build process, and included in build report. Regular expressions have changed between VS and , so most of the regular expression solutions here no longer work.

It's got a load of utilities built in including a line counter which says how many lines are blank, code, and etc. A simple solution is to search in all files. Which would match all lines. At the end of the find results window you should see a line of the sort:. Of course this is not very good for large projects, since all lines are mached and loaded into memory to be dispayed at the find results window.

This script finds all the. For each file that is included for compilation it creates an object with properties: Solution, Project, File, Lines. It stores all these objects in a list, and then groups and projects the data as needed. It's a command-line utility that calculates a few metrics on managed code for you including lines of code.

You can get a VS plugin that brings the tool into Visual Studio , and makes it as quick as selecting the menu item and clicking "Analyze Solution.

Agree with Ali Parr. The WndTab Line Counter addin is a such tool. It's also a good idea to search from download site to find some related tool. You can use free tool SourceMonitor. Normally it doesn't work with Visual Studio , but it does with a helpful. I came up with a quick and dirty powershell script for counting lines in a folder structure. It's not nearly as full featured as some of the other tools referenced in other answers, but I think it's good enough to provide a rough comparison of the size of code files relative to one another in a project or solution.

Try neptuner. It also gives you stuff like spaces, tabs, Lines of comments in addition to LoC. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How do you count the lines of code in a Visual Studio solution? Ask Question.

Asked 12 years, 3 months ago. Active 3 months ago. Viewed k times. Improve this question. Rob 5, 5 5 gold badges 38 38 silver badges 61 61 bronze badges.

Fermin Fermin I agree that it doesn't help much but if management are asking for it LoC is simply a metric and is particulairly interresting in 2 cases: 1 to get an idea how big the code base is i. Some people here are saying that counting lines of code is useless without giving it good thought. It is quite useful as it is a metric that should generally be minimized. It is a simple way to measure complexity of the solution not efficiency and if the problem is known to be simple, the more lines of code, generally the lower the quality.

Another thing is why do people bother responding if it is just to say the question is a bad one? What would you think if a teacher told you your question just shouldn't be asked. A little button in the corner that looks like a calendar, click that, the tooltip should say Calculate code metrics for soulution, and let VS do it's thing. The person doesn't always need to tell you why they want to count code.

When the question is this simply stated, the case around why is irrelevant. Just answer his question. I hate that. There are times to ask why when clearly you need to and then there are times you don't when you personally don't see a need Show 12 more comments.

Features Count the code lines of source code in workspace or directory. Count the code lines of the current file in real time. Count in any directory Open Explorer and right click on the folder. Select Count lines in directory. Count the range of the selected text Check available languages Open the command palette and select VSCodeCounter: Check available languages.

Available languages can be increased by adding language extensions. Save language configurations VSCode Counter is able to aggregate in unknown languages by referring to the information in the installed language extensions. First, launch VSCode on your local. Then settings. What is maintainability index? Maintainability Index is a software metric which measures how maintainable easy to support and change the source code is.

The maintainability index is calculated as a factored formula consisting of Lines Of Code, Cyclomatic Complexity and Halstead volume. Is lines of code a lot? The same applies to writing code. If your friend spent two months writing 10, lines of code that doesn't do much of anything, it's not impressive and is a sign that they need help learning to code properly.

How many lines of code is Facebook? The Android operating system runs on million lines. The Large Hadron Collider uses 50 million lines. Not including backend code, Facebook runs on 62 million lines of code. How many lines of code is Python? This counts as 1 line of code and 3 lines of comments. How do I count lines of code in GitHub? Can you get the number of lines of code from a GitHub repository? It doesn't, however, display how many lines of code the project consists of.



0コメント

  • 1000 / 1000