Skip to content
CAI
Software that uses CAICheck a score

ionide/FSharp.Analyzers.SDK

63.3

Adequate · 3 October 2026

3.1k

lines of production code

F#

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a framework for building and running static analyzers on F\# codebases, centered around a shared SDK that provides infrastructure for traversing syntax trees and handling analyzer metadata. It includes a command-line interface for executing these analyzers on projects and scripts, supporting features like severity mapping and SARIF output. The project also provides testing utilities to validate analyzer behavior and sample implementations, such as an Option.Value checker, to demonstrate usage patterns.

How it got here

2018–2019 — CLI release and infrastructure modernization

4 changes.

This period focused on releasing the initial F\# Analyzers CLI tool and modernizing the project's build infrastructure by migrating to .NET 10 and native central package management. It also introduced new SDK features, including AST/TAST walker interfaces and an ignore-comment system, to enhance analyzer extensibility and user control.

2020–2023 — SDK API overhaul and testing infrastructure

5 changes.

This period focused on a significant refactoring of the FSharp.Analyzers.SDK to introduce a more robust client API, support for ignore ranges, and richer analyzer metadata. Concurrently, a new testing library was developed to simplify analyzer testing through binary log parsing and strict error handling, accompanied by new sample analyzers and comprehensive unit tests.

2025–2026 — CLI enhancements and analyzer tooling

5 changes.

This period focused on improving the F\# analyzer CLI with support for glob patterns in severity mapping and robust argument parsing. It also introduced agent skills to simplify the complex process of upgrading F\# analyzer packages and SDK dependencies. Additionally, new samples and comprehensive tests were added to demonstrate analyzer warnings and validate the updated CLI behavior.

Features

Added F\# sample project demonstrating OptionAnalyzer warning

A new sample project (samples/MsBuildExample) has been added to demonstrate the behavior of the OptionAnalyzer. The included Program.fs file defines a simple F\# console application that intentionally triggers a warning from the analyzer by accessing the value of an Option type.

samples/MsBuildExample · high confidence

Initial release of the F\# Analyzers CLI tool

The \src/FSharp.Analyzers.Cli\ directory now contains the complete source code for the new command-line interface, enabling users to run F\# analyzers on projects and scripts. The tool supports analyzing \.fsproj\ files and \.fsx\ scripts, with options to pass MSBuild properties, filter files via globs, and remap analyzer severity levels. Output is available in a default console format or a GitHub Actions-compatible format, and results can be exported to a SARIF report file. The CLI includes robust error handling with specific exit codes for issues like missing analyzers, project load failures, or invalid arguments.

src/FSharp.Analyzers.Cli · high confidence

New 'upgrade-fsharp-analyzers' agent skill for F\# analyzer updates

A new agent skill has been added to help users upgrade the \fsharp-analyzers\ tool and associated analyzer packages (such as Ionide.Analyzers and G-Research.FSharp.Analyzers) to consistent versions. This skill addresses the specific challenge that analyzer packages do not declare their required \FSharp.Analyzers.SDK\ version as a NuGet dependency, which can cause tool failures if versions mismatch. The skill includes helper scripts (\sdk-from-source.sh\ and \sdk-version.fsx\) to resolve SDK dependencies from package source repositories or assembly metadata, allowing users to safely bump versions and review changes without modifying source code.

skills · high confidence

New AST and TAST walker infrastructure with ignore-range support

The SDK now provides \SyntaxCollectorBase\ and \TypedTreeCollectorBase\ interfaces, along with \walkAst\ and \walkTast\ traversal functions, allowing analyzer authors to easily inspect F\# syntax and typed trees. Additionally, the SDK introduces a new ignore-comment system (\fsharpanalyzer:ignore-line\, \ignore-file\, etc.) that lets users suppress specific analyzer messages via source code comments, and the client loader now exposes analyzer metadata (name, description, help URI) and supports filtering by analyzer name.

src/FSharp.Analyzers.SDK · high confidence

New F\# analyzer testing SDK with binary log parsing and strict error handling

A new testing library (FSharp.Analyzers.SDK.Testing) is introduced to facilitate testing F\# analyzers. It provides utilities to parse compiler arguments from MSBuild binary logs and convert them into F\# project options or snapshots, ensuring UTC timestamps for load times. The SDK enforces strict failure modes: it throws exceptions if the underlying build fails, if the binary log cannot be parsed, or if analyzer loading fails, and it raises a custom exception containing diagnostics when compiler errors are encountered.

src/FSharp.Analyzers.SDK.Testing · high confidence

New Option.Value analyzer sample for detecting unsafe Option.Value usage

A new sample analyzer has been added to the OptionAnalyzer project that detects the use of the \Option.Value\ property on F\# \Option\ types. The analyzer walks the typed abstract syntax tree (TAST) and reports a warning (code OV001) whenever \Microsoft.FSharp.Core.FSharpOption\1.Value\` is accessed, helping users identify potential runtime exceptions from accessing None values. The sample is exposed via both Editor and CLI contexts, allowing it to be used in development environments and command-line analysis tools.

samples/OptionAnalyzer · high confidence

New testing helpers and exception handling for F\# analyzer projects

The FSharp.Analyzers.SDK.Testing library now includes new helper functions (mkOptionsFromProject, mkSnapshotFromProject, getContext, getContextForSignature) to simplify creating project snapshots and CLI contexts for testing F\# analyzers, along with assertion utilities in the Assert module. It also introduces a new CompilerDiagnosticErrors exception to handle cases where analyzer diagnostics contain errors, improving error reporting during test execution.

FSharp.Analyzers.SDK.Testing · high confidence

Behavioural changes

Added sample demonstrating OptionAnalyzer warning

A new sample file, BadOptionUsage.fsx, has been added to the samples directory. It demonstrates a scenario where accessing the value of an Option type directly (using .Value) triggers a warning from the OptionAnalyzer, serving as an example of bad option usage patterns.

samples · high confidence

Modernized build infrastructure and developer tooling

The project has replaced the legacy FAKE-based build system with a new Fun.Build script and migrated from the classic .sln format to the new .slnx solution format. To ensure consistent code quality, Fantomas formatting is now enforced automatically during the build process via Directory.Build.targets, supported by a comprehensive .editorconfig and .fantomasignore. The repository also updated its .gitignore, added .gitattributes for proper line-ending handling, and switched the default branch reference from 'master' to 'main' in documentation and contributing guidelines.

(repo-wide) · high confidence

SDK API overhaul: new client interface, ignore ranges, and structured analyzer metadata

The FSharp.Analyzers.SDK has been significantly refactored to provide a more robust and flexible client API. The new \Client\ module introduces \LoadAnalyzers\ for discovering analyzers with optional inclusion/exclusion filters, and \RunAnalyzers\/\RunAnalyzersSafely\ methods that support filtering by predicate and return async results. The SDK now supports \AnalyzerIgnoreRange\ types (File, Range, NextLine, CurrentLine) and provides a helper \getAnalyzerIgnoreRanges\ to parse ignore comments. Analyzer metadata is now richer, exposing \ShortDescription\ and \HelpUri\ via \AnalyzerAttribute\ and \CliAnalyzerAttribute\. The \Severity\ type is now \RequireQualifiedAccess\ and includes a \Hint\ level. Context types (\CliContext\, \EditorContext\) have been updated, with \TypedTree\ made optional in \CliContext\ and \CheckFileResults\/\CheckProjectResults\ made optional in \EditorContext\. The \AnalyzerMessage\ now includes the analyzer \Name\ and \Assembly\ information.

FSharp.Analyzers.SDK · high confidence

Support for glob patterns in --treat-as-\* CLI switches

The CLI now allows users to specify analyzer codes using wildcard patterns (e.g., \GRA-\\) in the \--treat-as-\\ arguments, in addition to exact codes. This enables bulk severity mapping for analyzer families without listing every individual code. The implementation ensures that exact matches take precedence over prefix patterns and validates that patterns do not overlap across different severity levels to prevent ambiguous mappings.

FSharp.Analyzers.Cli · high confidence

Test coverage

Added tests for CLI argument parsing, MSBuild property expansion, script loading, and severity mapping; Added unit tests for OptionAnalyzer ignore ranges and client loading.

Dependencies

Migrate to .NET 10 and centralize dependency management

The project has been retargeted from .NET Standard 2.0 to .NET 10.0 for the SDK, CLI, and test projects, dropping support for older runtimes. To support this upgrade, the build system has migrated from Paket to native .NET Central Package Management (via Directory.Packages.props), removing the legacy paket.dependencies and paket.lock files. Key dependencies have been updated to their latest versions, including FSharp.Core to 10.1.400, FSharp.Compiler.Service to 43.12.400, and Microsoft.Extensions.Logging.Abstractions to 10.0.11.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 63 → 63 (+0.4)
  • Rubric changed (rubric-2026.09.13 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 99 → 90 (-9.4)
  • Architecture 61 → 67 (+5.9)
  • Maturity 59 → 59 (-0.2)
  • Readiness 62 → 61 (-0.0)
  • Security 74 → 74 (+0.0)

Resolved (3)

  • Documentation: no architecture or design documentation (docs/index.md)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)

New (5)

  • Hotspot: src/FSharp.Analyzers.Cli/Program.fs (src/FSharp.Analyzers.Cli/Program.fs)
  • Outdated: Ionide.KeepAChangelog.Tasks
  • Program.main (cognitive 54) (src/FSharp.Analyzers.Cli/Program.fs)
  • Program.main (cyclomatic 49) (src/FSharp.Analyzers.Cli/Program.fs)
  • SeverityMappings.Validate (cognitive 22) (src/FSharp.Analyzers.Cli/SeverityMapping.fs)

Changes since last survey

  • 4 commits — 4 feature/other, 0 fixes

By area

  • (repo) — 2 commits
  • .config/dotnet-tools.json — 2 commits

Notable commits

  • change: Bump fantomas from 8.0.0-beta-003 to 8.0.1
  • change: Bump fantomas from 8.0.1 to 8.0.5
  • change: Merge pull request #342 from ionide/dependabot/nuget/dot-config/fantomas-8.0.1
  • change: Merge pull request #343 from ionide/dependabot/nuget/dot-config/fantomas-8.0.5

Architecture

  • Unchanged — 0 containers · 3 contexts · 2 edges

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ionide/FSharp.Analyzers.SDK was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit ae2ee72d6bde9ad62f9a47ea3f070c9a5117e347 — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-4f4226d619ea.