{"id":46646825,"url":"https://github.com/sbay-dev/mvc-inspect","last_synced_at":"2026-03-12T09:09:14.567Z","repository":{"id":342471403,"uuid":"1174089430","full_name":"sbay-dev/mvc-inspect","owner":"sbay-dev","description":"A .NET global CLI tool that generates a full text structure tree for ASP.NET Core MVC projects — classes, interfaces, enums, delegates, Razor views, and gap analysis.","archived":false,"fork":false,"pushed_at":"2026-03-09T01:14:37.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-09T09:14:52.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/sbay-dev/mvc-inspect","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbay-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-06T03:56:12.000Z","updated_at":"2026-03-09T01:14:40.000Z","dependencies_parsed_at":"2026-03-09T06:02:05.314Z","dependency_job_id":null,"html_url":"https://github.com/sbay-dev/mvc-inspect","commit_stats":null,"previous_names":["sbay-dev/mvc-inspect"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sbay-dev/mvc-inspect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbay-dev%2Fmvc-inspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbay-dev%2Fmvc-inspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbay-dev%2Fmvc-inspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbay-dev%2Fmvc-inspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbay-dev","download_url":"https://codeload.github.com/sbay-dev/mvc-inspect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbay-dev%2Fmvc-inspect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-08T05:00:42.850Z","updated_at":"2026-03-10T07:01:27.851Z","avatar_url":"https://github.com/sbay-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MVC Structure Inspector\n\n\u003e **A Roslyn-powered .NET global CLI tool for static structural analysis of ASP.NET Core MVC projects.**\n\n[![NuGet](https://img.shields.io/nuget/v/MvcStructureInspector?logo=nuget\u0026label=NuGet)](https://www.nuget.org/packages/MvcStructureInspector)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![.NET](https://img.shields.io/badge/.NET-10.0-purple?logo=dotnet)](https://dotnet.microsoft.com)\n[![Tests](https://img.shields.io/badge/Tests-103%20passed-brightgreen)](https://github.com/sbay-dev/mvc-inspect/actions)\n[![Product Page](https://img.shields.io/badge/Product%20Page-sbay--dev.github.io-blue)](https://sbay-dev.github.io/mvc-inspect/)\n\n---\n\n## Overview\n\n**MVC Structure Inspector** performs deep Abstract Syntax Tree (AST) traversal of ASP.NET Core MVC projects using the .NET Compiler Platform (Roslyn). It produces comprehensive structural reports and gap analysis across:\n\n- **C# source files** — namespaces, classes, interfaces, structs, records, enums, delegates, fields, properties, constructors, methods, nested types, attribute metadata, lambda expressions, closures, and captured variable analysis\n- **Razor views** — `@model`, `@inject`, `@section`, `@RenderBody`, `\u003cpartial\u003e`, `asp-for`, `ViewBag`/`ViewData`, form actions, and tag helpers\n- **Static assets** — all files under `wwwroot/` compared via SHA-256 content hashing\n- **Project files** — `.csproj` properties, package references, project references, and `.sln` project registry\n- **Snapshot-based drift detection** — serialize a project baseline, then compare against a live project at any future point\n- **Intelligent `.gitignore` generation** — multi-ecosystem detection (15+ project types), nested/hybrid project awareness, safe merge, custom patterns\n\n---\n\n## Installation\n\n```bash\ndotnet tool install --global MvcStructureInspector\n```\n\n\u003e **Requirements:** .NET 10.0 SDK or later · Windows / Linux / macOS\n\n---\n\n## Commands\n\n### Inspect a Project\n\n```bash\nmvc-inspect \u003cpath\u003e\n```\n\nGenerates a full structural tree report with timestamped filename to prevent overwriting:\n\n```\n[OK] Report saved to:\n     C:\\source\\MyApp\\mvc-structure_20260306_064429.txt\n     Snapshot: C:\\source\\MyApp\\mvc-structure_20260306_064429.snapshot.json\n```\n\nA `.snapshot.json` file is automatically saved alongside the text report for future drift detection.\n\n### Gap Analysis Between Two Projects\n\n```bash\nmvc-inspect --compare \u003creferenceProject\u003e \u003ctargetProject\u003e\n```\n\nCompares project **[A]** (reference) against project **[B]** (target) and produces a detailed gap report with:\n- Executive summary with quantified gap counts\n- Per-file, per-type, and per-member differential analysis\n- Razor view element-level comparison\n- Static asset (wwwroot) content comparison via SHA-256\n- Developer task checklist for alignment\n\n### Drift Detection from Saved Report\n\n```bash\nmvc-inspect --from-report \u003creport.txt|.snapshot.json\u003e \u003cprojectPath\u003e\n```\n\nLoads a previously saved project snapshot as the baseline **[A]** and compares it against a live project **[B]**. This enables tracking structural drift over time without access to the original source.\n\n### Open an Existing Report\n\n```bash\nmvc-inspect open \u003creport-file\u003e\n```\n\nOpens any report file with the system default viewer.\n\n### Generate `.gitignore`\n\n```bash\nmvc-inspect gitignore \u003cpath\u003e\n```\n\nScans the project directory for all ecosystems and generates a comprehensive `.gitignore`:\n\n- **15+ project types**: .NET, Node.js, Python, Rust, Go, Java, Ruby, PHP, Swift, Dart/Flutter, Unity, Terraform, Docker, Visual Studio, JetBrains\n- **Nested/hybrid detection**: automatically detects projects within projects (e.g., Node.js `ClientApp/` inside a .NET solution)\n- **Safety guarantee**: never overwrites an existing `.gitignore` — creates `.gitignore.generated_*` instead\n- **Merge mode**: `--merge` appends only missing patterns to an existing `.gitignore`\n- **Custom patterns**: `--add` lets you specify additional patterns\n- **Preview mode**: `--preview` shows the output without writing any file\n\n```\n  Scanning: C:\\source\\MyApp\n  Detected 3 ecosystem(s):\n    • DotNet: 2 location(s)\n        └─ . (via App.sln)\n        └─ src (via Api.csproj)\n    • NodeJs: 1 location(s)\n        └─ ClientApp (via package.json)\n    • Python: 1 location(s)\n        └─ scripts (via requirements.txt)\n  ⚠ 3 nested/hybrid project(s) detected — patterns applied globally.\n[OK] .gitignore saved to:\n     C:\\source\\MyApp\\.gitignore\n```\n\n### Self-Verification\n\n```bash\nmvc-inspect verify\n```\n\nRuns 32 automated checks across six categories — no access keys or credentials required:\n\n- **Assembly Integrity** — version metadata, SHA-256 hash, Roslyn dependency\n- **Security Guard** — protected extensions, output path guards, timestamped reports, gitignore validation\n- **Runtime Compatibility** — .NET version, UTF-8 encoding, SHA-256 crypto, file system access\n- **Dependency Integrity** — all referenced assemblies resolvable, Roslyn version compatible\n- **File System Safety** — system directory detection, temp access, path traversal guard\n- **OS Kernel Diagnostics** — 11 lambda-based probes (kernel version, process info, CPU count, architecture, uptime, GC memory, timezone, culture)\n\n### Version Information\n\n```bash\nmvc-inspect -v\nmvc-inspect --version\n```\n\nDisplays version, runtime, OS, and product links.\n\n---\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `-v`, `--version` | Show version and build information |\n| `--out \u003cfile\u003e` | Override the auto-generated output path |\n| `--open` | Open the report automatically after generation |\n| `--with-proj` | Include `.csproj` and `.sln` comparison (compare mode only) |\n| `--no-views` | Exclude `.cshtml` Razor view files |\n| `--cs-only` | Analyze C# source files only |\n| `--no-migrations` | Exclude the `Migrations` directory |\n\n### Gitignore Options\n\n| Option | Description |\n|--------|-------------|\n| `--preview` | Preview the generated `.gitignore` without writing to disk |\n| `--merge` | Merge with existing `.gitignore` (append only unique patterns) |\n| `--add \u003cpatterns\u003e` | Add custom ignore patterns (e.g., `--add \"*.log\" \"tmp/\" \"secrets/\"`) |\n\n---\n\n## Report Structure\n\n### Single Project Report (`mvc-structure_*.txt`)\n\n```\nMyMvcApp/\n├── Controllers/\n│   └── HomeController.cs\n│       namespace: MyMvcApp.Controllers\n│           + class HomeController : Controller\n│               - ApplicationDbContext _context\n│               + HomeController(ApplicationDbContext context)  [constructor]\n│               + IActionResult Index()\n│               + IActionResult About()\n├── Models/\n│   └── User.cs\n│       namespace: MyMvcApp.Models\n│           + class User\n│               + int Id { get; set; }\n│               + string Name { get; set; }\n└── Views/\n    └── Home/\n        └── Index.cshtml\n            Type: [View]\n            @model MyMvcApp.Models.HomeViewModel\n            Layout = \"_Layout\"\n            asp-for=\"Name\"\n```\n\n### Gap Analysis Report (`mvc-gap-report_*.txt`)\n\nThe report contains six sections:\n\n1. **Executive Summary** — quantified gap counts across all categories\n2. **C# File Gaps** — missing, extra, or structurally modified source files\n3. **Type \u0026 Member Differentials** — class, interface, method, and property-level changes\n4. **Static File Gaps** — wwwroot content comparison with file sizes and SHA-256 hashes\n5. **Project File Gaps** — `.csproj` property and package reference differentials, `.sln` project registry comparison\n6. **Developer Task Checklist** — actionable items to align project [B] with reference [A]\n\n---\n\n## Security\n\n- **Protected Extensions** — the tool refuses to overwrite sensitive file types (`.cs`, `.csproj`, `.sln`, `.json`, `.dll`, `.exe`, `.key`, `.pfx`, etc.)\n- **Timestamped Reports** — automatic filenames with `yyyyMMdd_HHmmss` pattern prevent accidental overwrites\n- **Gitignore Safety** — `.gitignore` generation never overwrites existing files; validates output paths stay within the project directory\n- **CodeQL Scanning** — every release undergoes automated static security analysis\n- **SBOM Generation** — CycloneDX Software Bill of Materials included with each release\n\n---\n\n## Build from Source\n\n```bash\ngit clone https://github.com/sbay-dev/mvc-inspect\ncd mvc-inspect\ndotnet build src/MvcStructureInspector.csproj -c Release\ndotnet test tests/MvcStructureInspector.Tests/ -c Release\ndotnet pack src/MvcStructureInspector.csproj -c Release -o nupkg/\n```\n\n---\n\n## Changelog\n\n### v3.0.0\n- **Upgraded to .NET 10 / C# 14 / Roslyn 5.0.0**\n- Delegate signature detection across all namespaces (`ParsedDelegate` record)\n- Lambda and closure analysis: expression bodies, captured variables, owner resolution (`ParsedLambdaProperty` record)\n- 11 OS kernel lambda probes: kernel version, process info, CPU count, 64-bit flags, machine name, user, uptime, working set, GC memory, timezone, culture\n- Self-verifier expanded to 32 checks across 6 categories (added OS Kernel Diagnostics)\n- `GetKernelVersion()` with OS-specific branches (Windows NT, Linux `/proc/version`, macOS Darwin)\n- 103 unit tests\n\n### v2.8.0\n- Version display via `-v` / `--version` with runtime, OS, and product metadata\n- Self-verification command (`verify`) with 21 automated checks across 5 categories\n- Assembly SHA-256 integrity hash for reproducibility verification\n- Roslyn dependency validation and runtime compatibility checks\n- SecurityGuard invariant verification (protected extensions, path guards, timestamps)\n- File system safety checks (system directory detection, path traversal)\n- No access keys or credentials required — fully local verification\n- 103 unit tests (10 new for self-verifier)\n\n### v2.7.0\n- Intelligent `.gitignore` generator with multi-ecosystem detection\n- 15+ project types: .NET, Node.js, Python, Rust, Go, Java, Ruby, PHP, Swift, Dart/Flutter, Unity, Terraform, Docker, Visual Studio, JetBrains\n- Nested/hybrid project awareness (e.g., Node.js inside .NET, Python scripts in a monorepo)\n- Safe merge mode with existing `.gitignore` (append unique patterns only)\n- Custom pattern support via `--add` flag\n- Preview mode via `--preview` flag\n- SecurityGuard: path-based gitignore write validation\n- 93 unit tests (22 new for gitignore generator)\n\n### v2.6.1\n- Professional NuGet metadata and product page integration\n- Comprehensive English documentation\n\n### v2.6.0\n- Snapshot-based drift detection via `--from-report` command\n- Automatic `.snapshot.json` serialization alongside text reports\n- SecurityGuard allowlist for tool-generated snapshot files\n\n### v2.5.0\n- wwwroot static file comparison with SHA-256 content hashing\n- Static file gap reporting (Section [4]) with file sizes and hash differentials\n- CI/CD pipeline: CodeQL, SBOM generation, automated NuGet publishing\n- Professional bilingual product page at sbay-dev.github.io/mvc-inspect\n\n### v2.4.0\n- `.csproj` and `.sln` comparison via `--with-proj` flag\n- Package reference, project reference, and SDK property differentials\n\n### v2.3.0\n- `--open` flag for automatic report viewing\n- `open \u003cfile\u003e` subcommand for existing reports\n\n### v2.2.1\n- Timestamped auto-save filenames to prevent report overwriting\n\n### v2.0.0\n- Razor view structural analysis (`.cshtml`)\n- `@model`, `@inject`, `@section`, `asp-for`, `\u003cpartial\u003e`, ViewBag/ViewData extraction\n\n### v1.0.0\n- Initial release — Roslyn-based C# structural inspection and gap analysis\n\n---\n\n## License\n\nMIT © 2025-2026 [SBAY-SDK](https://github.com/sbay-dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbay-dev%2Fmvc-inspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbay-dev%2Fmvc-inspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbay-dev%2Fmvc-inspect/lists"}