<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=StatLens%3AScanning</id>
	<title>StatLens:Scanning - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mutigeraffe.com/index.php?action=history&amp;feed=atom&amp;title=StatLens%3AScanning"/>
	<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=StatLens:Scanning&amp;action=history"/>
	<updated>2026-10-21T02:43:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.mutigeraffe.com/index.php?title=StatLens:Scanning&amp;diff=2514&amp;oldid=prev</id>
		<title>Maintenance script: StatLens wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.mutigeraffe.com/index.php?title=StatLens:Scanning&amp;diff=2514&amp;oldid=prev"/>
		<updated>2026-10-20T21:29:39Z</updated>

		<summary type="html">&lt;p&gt;StatLens wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page explains what Stat Lens scans, how it counts lines and when it scans again.&lt;br /&gt;
&lt;br /&gt;
== What is scanned ==&lt;br /&gt;
Only the &amp;#039;&amp;#039;&amp;#039;first folder&amp;#039;&amp;#039;&amp;#039; of the workspace is scanned. In a multi-root workspace the other folders are ignored.&lt;br /&gt;
&lt;br /&gt;
The scan walks through every folder below it and skips:&lt;br /&gt;
* every folder whose name is in &amp;lt;code&amp;gt;projectStats.excludeFolders&amp;lt;/code&amp;gt;, on any level. By default these are &amp;lt;code&amp;gt;node_modules&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obj&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.git&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;dist&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;out&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.vs&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;.vscode&amp;lt;/code&amp;gt;. See [[StatLens:Commands and Settings|Commands and Settings]].&lt;br /&gt;
* everything excluded by the &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; file in the root of the folder. Other &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; files further down are not used for this step.&lt;br /&gt;
* symbolic links, both to files and to folders&lt;br /&gt;
&lt;br /&gt;
Every file that is left counts towards &amp;#039;&amp;#039;Files&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Size&amp;#039;&amp;#039;. Every folder that is left counts towards &amp;#039;&amp;#039;Files&amp;#039;&amp;#039; as a folder. The root folder itself is not counted.&lt;br /&gt;
&lt;br /&gt;
== Lines of code ==&lt;br /&gt;
=== Which files count ===&lt;br /&gt;
Lines are only counted in files that have a language. The language comes from linguist-js, which uses the rules of GitHub Linguist. It works offline with the language data that ships with the extension.&lt;br /&gt;
&lt;br /&gt;
Files without a language add to &amp;#039;&amp;#039;Files&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Size&amp;#039;&amp;#039;, but not to the lines of code. This includes:&lt;br /&gt;
* binary files, such as images or archives&lt;br /&gt;
* files that Linguist treats as vendored, for example bundled third-party libraries&lt;br /&gt;
* files Linguist leaves out for other reasons, including files marked with &amp;lt;code&amp;gt;linguist-vendored&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;linguist-generated&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;linguist-documentation&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;.gitattributes&amp;lt;/code&amp;gt;, and files excluded by a &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; in a subfolder&lt;br /&gt;
* files larger than 20 MB. They are never read line by line.&lt;br /&gt;
&lt;br /&gt;
Programming languages, markup, data and prose formats all count. JSON, YAML, XML or Markdown files therefore add to the lines of code.&lt;br /&gt;
&lt;br /&gt;
=== How lines are counted ===&lt;br /&gt;
* A line counts if it contains anything other than spaces or tabs. Blank lines never count.&lt;br /&gt;
* Files are read as UTF-8.&lt;br /&gt;
* &amp;#039;&amp;#039;Largest File&amp;#039;&amp;#039; is the file with the most counted lines, not the file with the most bytes.&lt;br /&gt;
&lt;br /&gt;
=== Ignoring comment lines ===&lt;br /&gt;
With &amp;lt;code&amp;gt;projectStats.ignoreComments&amp;lt;/code&amp;gt; set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, a line also does not count if it starts with one of these, after leading spaces:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;--&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;&amp;lt;!--&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt; · &amp;lt;code&amp;gt;&amp;#039;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a simple check that is the same for every language. It does not understand the language itself:&lt;br /&gt;
* A line such as &amp;lt;code&amp;gt;x = 1; // note&amp;lt;/code&amp;gt; still counts, because it does not start with a comment.&lt;br /&gt;
* Lines that start with one of these characters but are code also stop counting, for example &amp;lt;code&amp;gt;#include&amp;lt;/code&amp;gt; in C, a Markdown heading with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;, a list item starting with &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; or a line starting with a string in single quotes.&lt;br /&gt;
* The inner lines of a block comment only stop counting if they start with &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt; or one of the other prefixes.&lt;br /&gt;
&lt;br /&gt;
== When it scans ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Event !! What happens&lt;br /&gt;
|-&lt;br /&gt;
| You open a folder for the first time || A scan starts on its own.&lt;br /&gt;
|-&lt;br /&gt;
| You open a folder that was scanned before || The saved result is shown at once, with its date in &amp;#039;&amp;#039;Last Scan&amp;#039;&amp;#039;. No new scan starts.&lt;br /&gt;
|-&lt;br /&gt;
| You click the refresh icon or run &amp;#039;&amp;#039;Stat Lens: Rescan&amp;#039;&amp;#039; || A scan starts.&lt;br /&gt;
|-&lt;br /&gt;
| Files are created, changed or deleted || A scan starts 15 seconds after the last change. Each new change restarts the 15 seconds.&lt;br /&gt;
|-&lt;br /&gt;
| You change &amp;lt;code&amp;gt;projectStats.ignoreComments&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;projectStats.excludeFolders&amp;lt;/code&amp;gt; || A scan starts at once.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Changes inside an excluded folder, for example in &amp;lt;code&amp;gt;node_modules&amp;lt;/code&amp;gt;, do not trigger a scan. Changes to files that are only excluded by &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt; do.&lt;br /&gt;
&lt;br /&gt;
While a scan is running, a second scan is not started. Clicking refresh again simply waits for the running scan.&lt;br /&gt;
&lt;br /&gt;
== Progress ==&lt;br /&gt;
During a scan the view shows &amp;#039;&amp;#039;Scanning …&amp;#039;&amp;#039; and the status bar shows the current step:&lt;br /&gt;
# &amp;lt;code&amp;gt;Searching files …&amp;lt;/code&amp;gt;, with &amp;lt;code&amp;gt;... files found …&amp;lt;/code&amp;gt; every 500 files&lt;br /&gt;
# &amp;lt;code&amp;gt;Detecting languages …&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;Counting lines … done/total&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;Reading dependencies …&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Git figures are read at the same time as the file scan.&lt;br /&gt;
&lt;br /&gt;
== Saved results ==&lt;br /&gt;
After each scan the result is saved in the VS Code storage for this workspace. It is shown again the next time you open the same folder. Nothing is written into the project folder.&lt;br /&gt;
&lt;br /&gt;
{{StatLens Nav}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>