id.ts ×6

Frontier kind: Code frontier

unlabeled · c_c3e68e615ea1

1251 tests · 5361 LOC · 31 files · introduces 0 tests · 52 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges52 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
814 ranges5361 lines · 31 files · Browse complete extent
All tests (intent)
1251 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 52 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/node/id.ts 37 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- id.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { networkInterfaces } from 'os';
7 > import { TernarySearchTree } from '../common/ternarySearchTree.js';
8 > import * as uuid from '../common/uuid.js';
9 > import { getMac } from './macAddress.js';
10 > import { isWindows } from '../common/platform.js';
11 > import { stripUTF8BOM } from '../common/strings.js';
12 >
13 > // http://www.techrepublic.com/blog/data-center/mac-address-scorecard-for-common-virtual-machine-platforms/
14 > // VMware ESX 3, Server, Workstation, Player 00-50-56, 00-0C-29, 00-05-69
15 > // Microsoft Hyper-V, Virtual Server, Virtual PC 00-03-FF
16 > // Parallels Desktop, Workstation, Server, Virtuozzo 00-1C-42
17 > // Virtual Iron 4 00-0F-4B
18 > // Red Hat Xen 00-16-3E
19 > // Oracle VM 00-16-3E
20 > // XenSource 00-16-3E
21 > // Novell Xen 00-16-3E
22 > // Sun xVM VirtualBox 08-00-27
23 > export const virtualMachineHint: { value(): number } = new class {
24 >
25 > private _virtualMachineOUIs?: TernarySearchTree<string, boolean>;
26 > private _value?: number;
27 >
28 > private _isVirtualMachineMacAddress(mac: string): boolean {
29 if (!this._virtualMachineOUIs) {
30 this._virtualMachineOUIs = TernarySearchTree.forStrings<boolean>();
50 return !!this._virtualMachineOUIs.findSubstr(mac);
51 }
52 > id.ts
53 > value(): number {
54 if (this._value === undefined) {
55 let vmOui = 0;
77 return this._value;
78 }
79 > }; id.ts
80 >
81 > let machineId: Promise<string>;
82 export async function getMachineId(errorLogger: (error: Error) => void): Promise<string> {
83 if (!machineId) {
91 return machineId;
92 }
93 > id.ts
94 async function getMacMachineId(errorLogger: (error: Error) => void): Promise<string | undefined> {
95 try {
102 }
103 }
104 > id.ts
105 > const SQM_KEY: string = 'Software\\Microsoft\\SQMClient';
106 export async function getSqmMachineId(errorLogger: (error: Error) => void): Promise<string> {
107 if (isWindows) {
116 return '';
117 }
118 > id.ts
119 export async function getDevDeviceId(errorLogger: (error: Error) => void): Promise<string> {
120 try {
src/vs/base/node/macAddress.ts 15 introduced LOC · 2 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- macAddress.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { networkInterfaces } from 'os';
7 >
8 > const invalidMacAddresses = new Set([
9 > '00:00:00:00:00:00',
10 > 'ff:ff:ff:ff:ff:ff',
11 > 'ac:de:48:00:11:22'
12 > ]);
13 >
14 function validateMacAddress(candidate: string): boolean {
15 const tempCandidate = candidate.replace(/\-/g, ':').toLowerCase();
16 return !invalidMacAddresses.has(tempCandidate);
17 }
19 > export function getMac(): string {
20 const ifaces = networkInterfaces();
21 for (const name in ifaces) {