<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code metrics | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/code-metrics/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Sun, 18 Oct 2020 10:16:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>Code metrics | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>How to count lines of code in Visual Studio</title>
		<link>https://learncgames.com/how-to-count-lines-of-code-in-visual-studio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-count-lines-of-code-in-visual-studio</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 20 Oct 2020 23:00:45 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[Code metrics]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1640</guid>

					<description><![CDATA[<p>Until this morning, I didn&#8217;t realise that Visual Studio (even the free Community Edition) has this built in. I was curious to see how much code I&#8217;d written so far for my game processing engine.  Development comes in leaps and bounds during evenings and weekends. Visual Studio has Code Metrics in it. You can do [&#8230;]</p>
The post <a href="https://learncgames.com/how-to-count-lines-of-code-in-visual-studio/">How to count lines of code in Visual Studio</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:437,&quot;href&quot;:&quot;https:\/\/docs.microsoft.com\/en-us\/visualstudio\/code-quality\/code-metrics-values?view=vs-2019&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20220819175356\/https:\/\/docs.microsoft.com\/en-us\/visualstudio\/code-quality\/code-metrics-values?view=vs-2019&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 15:02:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 20:37:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 22:36:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 03:15:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 11:50:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 10:47:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 17:29:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 09:19:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-12 05:47:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-18 11:36:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-23 13:05:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 13:04:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-31 08:50:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 17:00:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-07 11:48:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-10 11:59:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 15:06:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 15:40:24&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 15:40:24&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img fetchpriority="high" decoding="async" class="alignleft size-full wp-image-1641" src="https://learncgames.com/wp-content/uploads/2020/10/code-metrics-in-visual-studio.png" alt="Calucating Code metrics in Visual Studio" width="376" height="133" srcset="https://learncgames.com/wp-content/uploads/2020/10/code-metrics-in-visual-studio.png 376w, https://learncgames.com/wp-content/uploads/2020/10/code-metrics-in-visual-studio-300x106.png 300w" sizes="(max-width: 376px) 100vw, 376px" />Until this morning, I didn&#8217;t realise that Visual Studio (<em>even the free Community Edition</em>) has this built in. I was curious to see how much code I&#8217;d written so far for my game processing engine.  Development comes in leaps and bounds during evenings and weekends.</p>
<p>Visual Studio has Code Metrics in it. You can do this for any project that builds correctly. To show this you have to do <strong>View =&gt; Other Windows =&gt; Code Metrics Results</strong>. That displays the window. Then you have to go on the <strong>Analyze</strong> Window, and click <strong>Calculate Code Metrics</strong>.</p>
<p><img decoding="async" class="size-full wp-image-1642 alignnone" src="https://learncgames.com/wp-content/uploads/2020/10/lines-of-code.png" alt="Lines of code" width="946" height="115" srcset="https://learncgames.com/wp-content/uploads/2020/10/lines-of-code.png 946w, https://learncgames.com/wp-content/uploads/2020/10/lines-of-code-300x36.png 300w, https://learncgames.com/wp-content/uploads/2020/10/lines-of-code-768x93.png 768w" sizes="(max-width: 946px) 100vw, 946px" /></p>
<p>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. The last column (<em>Lines of executable code</em>) suggests that most of my program is comments which is wrong! There is however a fair amount of data in the form of Constructor initializations, and one file of 1290 lines has over 1,000 such initializations.  You can read what the other columns mean and everything you ever wanted to know about code metrics on the <a title="Link to Code Metrics on Microsoft's website" href="https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-values?view=vs-2019" target="_blank" rel="nofollow noopener noreferrer">Microsoft site</a>.</p>
<p>Out of curiosity, I manually counted the number of lines in this project. There are 15 files and they added up to 3700 lines but that includes comments and blank lines.  A quick search for // found 119 which probably means I should improve my commenting. Blank lines is probably something similar. So we&#8217;re talking 3700-1000 (<em>constructor initializers</em>)-119 (<em>comments</em>) -119 (<em>blank lines</em>) = 2462 lines of code so far. That&#8217;s working tested code mind you.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/how-to-count-lines-of-code-in-visual-studio/">How to count lines of code in Visual Studio</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1640</post-id>	</item>
	</channel>
</rss>
