Repository Analysis

microsoft/terminal

The new Windows Terminal and the original Windows console host, all in the same place!

3.8 Likely human-written View on GitHub
3.8
Adjusted Score
3.8
Raw Score
100%
Time Factor
2026-05-30
Last Push
103,352
Stars
C++
Language
353,678
Lines of Code
1394
Files
1279
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 3MEDIUM 23LOW 1252

Pattern Findings

1279 matches across 11 categories. Click a row to expand file-level details.

Over-Commented Block1215 hits · 1194 pts
SeverityFileLineSnippet
LOWtools/WindbgExtension.js1
LOW…Y/GUIConsole/GUIConsole.WPF/Properties/AssemblyInfo.cs21// COM, set the ComVisible attribute to true on that type.
LOW…Y/GUIConsole/GUIConsole.WPF/Properties/AssemblyInfo.cs41)]
LOW…onsole/GUIConsole.WPF/Properties/Resources.Designer.cs1//------------------------------------------------------------------------------
LOWsamples/ConPTY/GUIConsole/GUIConsole.ConPTY/Terminal.cs21 /// A stream of VT-100-enabled output from the console.
LOWsamples/ConPTY/MiniTerm/MiniTerm/Program.cs1using System;
LOW…es/ConPTY/MiniTerm/MiniTerm/Properties/AssemblyInfo.cs21
LOWsamples/ConPTY/EchoCon/EchoCon/stdafx.h1// stdafx.h : include file for standard system include files,
LOWsamples/ConPTY/EchoCon/EchoCon/targetver.h1#pragma once
LOWsamples/ConPTY/EchoCon/EchoCon/stdafx.cpp1// stdafx.cpp : source file that includes just the standard includes
LOWscratch/ScratchIslandApp/WindowExe/pch.h21#define WIN32_LEAN_AND_MEAN
LOWscratch/ScratchIslandApp/WindowExe/pch.h41
LOWscratch/ScratchIslandApp/WindowExe/pch.h61// * Media for ScaleTransform
LOWscratch/ScratchIslandApp/WindowExe/pch.h81#include <WinUser.h>
LOWscratch/ScratchIslandApp/WindowExe/SampleMain.cpp1// Copyright (c) Microsoft Corporation.
LOWscratch/ScratchIslandApp/WindowExe/SampleMain.cpp81 // cause WT to start with Ctrl-C disabled. This wouldn't matter, because it's a Windows-subsystem
LOWscratch/ScratchIslandApp/WindowExe/pch.cpp1// Copyright (c) Microsoft Corporation.
LOWscratch/ScratchIslandApp/WindowExe/SampleAppHost.cpp61
LOWscratch/ScratchIslandApp/WindowExe/resource.h1//{{NO_DEPENDENCIES}}
LOWscratch/ScratchIslandApp/WindowExe/resource.h21#ifndef APSTUDIO_READONLY_SYMBOLS
LOW…atch/ScratchIslandApp/WindowExe/SampleIslandWindow.cpp201 OnSize(size.cx, size.cy);
LOWscratch/ScratchIslandApp/SampleApp/pch.h1// Copyright (c) Microsoft Corporation.
LOWscratch/ScratchIslandApp/SampleApp/pch.h21// Windows::UI::Xaml::Media::Animation::IStoryboard::GetCurrentTime
LOWscratch/ScratchIslandApp/SampleApp/pch.h41#include <winrt/Windows.UI.Xaml.Data.h>
LOWscratch/ScratchIslandApp/SampleApp/pch.h61
LOWscratch/ScratchIslandApp/SampleApp/pch.cpp1// Copyright (c) Microsoft Corporation.
LOWscratch/ScratchIslandApp/SampleApp/dll/pch.h1// Copyright (c) Microsoft Corporation.
LOWscratch/ScratchIslandApp/SampleApp/dll/pch.cpp1// Copyright (c) Microsoft Corporation.
LOWdep/Console/winconp.h61#define CONSOLE_REGISTRY_FONTFAMILY L"FontFamily"
LOWdep/Console/winconp.h81#define CONSOLE_REGISTRY_WORD_DELIM L"WordDelimiters"
LOWdep/Console/winconp.h101#define CONSOLE_REGISTRY_COPYCOLOR L"CopyColor"
LOWdep/Console/winconp.h461UnregisterConsoleIME(
LOWdep/Console/winconp.h481#define CONSOLE_OUTPUT_STRING L"CONOUT$"
LOWdep/Console/winconp.h601#define PID_CONSOLE_WRAPTEXT 2
LOWdep/Console/winconp.h661//
LOWdep/Console/condrv.h21 Kernel and user modes.
LOWdep/Console/condrv.h61#define CD_IO_OBJECT_TYPE_CURRENT_OUTPUT 0x02
LOWdep/Console/ntcon.h1//
LOWdep/Console/ntcon.h21
LOWoss/pcg/include/pcg_random.hpp1// PCG Random Number Generation for C++
LOWoss/stb/stb_rect_pack.h1// stb_rect_pack.h - v1.01 - public domain - rectangle packing
LOWoss/stb/stb_rect_pack.h21// No memory allocations; uses qsort() and assert() from stdlib.
LOWoss/stb/stb_rect_pack.h41//
LOWoss/stb/stb_rect_pack.h61//////////////////////////////////////////////////////////////////////////////
LOWoss/stb/stb_rect_pack.h81typedef struct stbrp_context stbrp_context;
LOWoss/stb/stb_rect_pack.h101// You should not try to access the 'rects' array from another thread
LOWoss/stb/stb_rect_pack.h121 stbrp_coord w, h;
LOWoss/stb/stb_rect_pack.h141// Note: to guarantee best results, either:
LOWoss/stb/stb_rect_pack.h201//
LOWoss/stb/stb_rect_pack.h381 }
LOWoss/chromium/base/numerics/safe_math_clang_gcc_impl.h1// Copyright 2017 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_math_arm_impl.h21
LOWoss/chromium/base/numerics/clamped_math_impl.h1// Copyright 2017 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_conversions.h1// Copyright 2014 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_conversions.h281 constexpr StrictNumeric(Src value) // NOLINT(runtime/explicit)
LOWoss/chromium/base/numerics/checked_math_impl.h1// Copyright 2017 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_math.h1// Copyright 2017 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_conversions_impl.h1// Copyright 2014 The Chromium Authors. All rights reserved.
LOWoss/chromium/base/numerics/safe_conversions_impl.h221// truncated to fit the mantissa of the floating point. The direction of
LOWoss/chromium/base/numerics/safe_math_shared_impl.h1// Copyright 2017 The Chromium Authors. All rights reserved.
1155 more matches not shown…
AI Slop Vocabulary16 hits · 45 pts
SeverityFileLineSnippet
MEDIUMoss/chromium/base/numerics/clamped_math.h44 // This is not an explicit constructor because we want a seamless conversion
MEDIUMoss/chromium/base/numerics/checked_math.h44 // This is not an explicit constructor because we want a seamless conversion
MEDIUMsrc/renderer/atlas/BackendD3D.cpp308 // it being simple to implement and robust against more peculiar fonts with unusually large/small descenders, et
MEDIUMsrc/renderer/atlas/BackendD2D.cpp678 // it being simple to implement and robust against more peculiar fonts with unusually large/small descenders, et
MEDIUMsrc/renderer/atlas/BackendD2D.cpp693 // color, it is seamless.
MEDIUMsrc/inc/til/color.h22 // Here, we leverage the spec-legality of using unions for type conversions and the
LOWsrc/tools/vtpipeterm/main.cpp13#else // Building inside Windows, just use the kernel32 ones.
MEDIUMsrc/types/CodepointWidthDetector.cpp22// Fundamentally, the trie is generated by taking all 1114112 codepoints and their assigned values and deduplicating
MEDIUMsrc/types/UiaTextRangeBase.cpp985 // so leverage size_t(-1) being converted to 0xffff...
MEDIUMsrc/host/input.cpp359 // Going back to the Win 7 behavior then should make shutdown a lot more robust.
MEDIUMsrc/terminal/parser/base64.cpp47 // Is 4 enough? Certainly not. 6 on the other hand is just way too much. Clearly 5 is just right.
MEDIUMsrc/terminal/parser/ft_fuzzer/fuzzing_directed.h370 // is designed to leverage the & operator overload to have CFuzzArray
MEDIUMsrc/interactivity/win32/windowio.cpp988 // so they can be faithfully represented as a user "typing" into the client application. The vision would b
LOWsrc/cascadia/TerminalApp/TabManagement.cpp606 // GH#11107 - Always just set the item directly first so that if
MEDIUMsrc/cascadia/TerminalSettingsModel/JsonUtils.h1010 // Cleverly leverage EnumMapper to do the heavy lifting.
MEDIUM…erminalSettingsModel/CascadiaSettingsSerialization.cpp1113 // will fail; we can leverage this to detect when they are equivalent and delete the user's duplicate copies.
Decorative Section Separators7 hits · 32 pts
SeverityFileLineSnippet
MEDIUMdoc/specs/#13000 - In-process ConPTY.md356// ┌──────────────────┐
MEDIUMdoc/specs/#13000 - In-process ConPTY.md360// ╭ ├──────────────────┤ ├── VT scrollback (partially addressed)
MEDIUMdoc/specs/#13000 - In-process ConPTY.md364// Console Buffer ──┤ ├──────────────────┤ ├──── VT Viewport (top y = 1)
MEDIUMdoc/specs/#13000 - In-process ConPTY.md368// ╰ └──────────────────┘
MEDIUMdoc/specs/#13000 - In-process ConPTY.md374// ┌──────────────────┐ ╮
MEDIUMdoc/specs/#13000 - In-process ConPTY.md378// ╭ ├──────────────────┤ ╮ ╯
MEDIUMdoc/specs/#13000 - In-process ConPTY.md382// ╰ └──────────────────┘ ╯
Synthetic Comment Markers3 hits · 22 pts
SeverityFileLineSnippet
HIGH…Console/GUIConsole.WPF/Properties/Settings.Designer.cs3// This code was generated by a tool.
HIGH…onsole/GUIConsole.WPF/Properties/Resources.Designer.cs3// This code was generated by a tool.
HIGHsrc/tools/ColorTool/ColorTool/Resources.Designer.cs3// This code was generated by a tool.
Fake / Example Data10 hits · 15 pts
SeverityFileLineSnippet
LOWsrc/tools/ConsoleBench/main.cpp448static constexpr std::string_view s_payload_utf8{ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusm
LOWsrc/tools/ConsoleBench/main.cpp448static constexpr std::string_view s_payload_utf8{ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusm
LOWsrc/tools/ConsoleBench/main.cpp450static constexpr std::wstring_view s_payload_utf16{ L"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ei
LOWsrc/tools/ConsoleBench/main.cpp450static constexpr std::wstring_view s_payload_utf16{ L"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do ei
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp117 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore m
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp117 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore m
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp118 "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem ape
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp118 "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem ape
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp119 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore m
LOWsrc/terminal/parser/ft_fuzzer/VTCommandFuzzer.cpp119 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore m
Slop Phrases9 hits · 14 pts
SeverityFileLineSnippet
LOWsrc/inc/til/mutex.h68 // ensures you don't forget to do so, unlike with std::mutex/std::shared_mutex.
LOW…olorTool/ConsoleTargets/TerminalSchemeConsoleTarget.cs13 Console.WriteLine("Copy and paste the following text into the schemes array of your Windows Terminal setting
MEDIUMsrc/terminal/adapter/InteractDispatch.cpp77 // It's worth noting that all of this is bad design in either case.
LOWsrc/cascadia/WindowsTerminal/NonClientIslandWindow.cpp661 // GH#5209 - make sure to use MONITOR_DEFAULTTONEAREST, so that this will
LOWsrc/cascadia/TerminalApp/AppCommandlineArgs.cpp397 // GH#10070 - make sure to not use the MRU order when switching
LOWsrc/cascadia/TerminalControl/TermControl.cpp2822 // GH#2061 - make sure to account for the size the padding _will be_ scaled to
LOWsrc/cascadia/TerminalControl/TermControl.cpp2858 // GH#2061 - make sure to account for the size the padding _will be_ scaled to
LOWsrc/cascadia/TerminalConnection/ConptyConnection.cpp484 // GH#11556 - make sure to format the error code to this string as an UNSIGNED int
LOWsrc/cascadia/TerminalConnection/ConptyConnection.cpp521 // GH#11556 - make sure to format the error code to this string as an UNSIGNED int
Verbosity Indicators9 hits · 14 pts
SeverityFileLineSnippet
LOWsrc/terminal/parser/InputStateMachineEngine.cpp889 // Step 1: Translate which button was affected
LOWsrc/terminal/parser/InputStateMachineEngine.cpp945 // Step 2: Decide whether to set or clear that button's bit
LOWsrc/terminal/parser/InputStateMachineEngine.cpp989 // Step 3: check if mouse moved
LOWsrc/terminal/parser/InputStateMachineEngine.cpp995 // Step 4: update internal state before returning, even if we couldn't fully understand this
LOWsrc/interactivity/win32/windowio.cpp343 // we need to check if there is an active popup because otherwise they won't be able to receive shift+key events
LOWsrc/cascadia/TerminalCore/TerminalSelection.cpp480 // so we need to check if we're pointing to that one before returning it.
LOWsrc/cascadia/WindowsTerminal/AppHost.cpp503 // We need to check if the top left point of the titlebar of the window is within any screen
LOW…c/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp437 // so we need to check if they were explicitly set
LOWsrc/cascadia/TerminalConnection/AzureConnection.cpp783 //// Step 8: connecting to said terminal
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALtools/WindbgExtension.js24 return host.namespace.Debugger.Utility.Control.ExecuteCommand("dx Microsoft::Console::Interactivity::ServiceLocator:
Unused Imports7 hits · 7 pts
SeverityFileLineSnippet
LOWsrc/tools/vttests/test-unicode.py16
LOWsrc/tools/vttests/test-unicode.py17
LOWsrc/tools/vttests/test-unicode.py18
LOWsrc/tools/vttests/burrito.py17
LOWsrc/tools/vttests/template.py8
LOWsrc/tools/vttests/template.py9
LOWsrc/tools/vttests/template.py10
Excessive Try-Catch Wrapping1 hit · 2 pts
SeverityFileLineSnippet
MEDIUMdoc/specs/#1595 - Suggestions UI/dump-workflows.py28 print(f"Error parsing {filename}: {e}")
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippet
LOWdoc/specs/#1595 - Suggestions UI/dump-workflows.py6