How microsoft/applicationinspector works
Project type and purpose
• This is a .NET-based open-source command-line tool (“Application Inspector”) whose purpose is to scan source code (many languages) for feature-detection by applying a large set of JSON-defined rules and emitting reports (HTML, JSON, text, SARIF).
• Key indicators:
• Multi-project .NET solution: CLI, Common, Logging, RulesEngine, AppInspector (core commands), Benchmarks, Tests
• README describes a CLI with commands: analyze, tagdiff, exporttags, verifyrules, packrules
• Rules are stored as JSON under AppInspector/rules and AppInspector.RulesEngine/Resources
File structure
• Top-level projects/modules:
• AppInspector.CLI – the command-line front end (argument parsing, command dispatch, Writers)
• AppInspector (or AppInspector.Commands) – core command implementations (AnalyzeCommand, ExportTagsCommand, etc.)
• AppInspector.RulesEngine – the rule-processing engine (RuleProcessor, SearchPattern, TypedRuleSet)
• AppInspector.Common – common utilities (file I/O, metadata helpers, exceptions, messaging)
• AppInspector.Logging – logging configuration and options
• AppInspector.Benchmarks – performance benchmarks against analyzers
• AppInspector.Tests – unit/integration tests
• Configuration and resources:
• JSON rule files under AppInspector/rules/default/...
• HTML templates under AppInspector.CLI/html
• .NET Build & deployment files (Directory.Build.props, publish profiles, pipelines YAML)
README for additional insights
• Describes architecture in prose: CLI tool with over 400 rules, outputs in multiple formats
• Usage flow: appinspector analyze -s <path> calls AnalyzeCommand → scans files → applies RulesEngine → writes report
• Dependencies: .NET 6 SDK, NuGet package distribution, platform-specific binaries