< Summary

Information
Class: AspxLint.Core.Rules.Ws005Bom
Assembly: AspxLint.Core
File(s): D:\a\claude-aspx-lint\claude-aspx-lint\src\AspxLint.Core\Rules\Ws005Bom.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 22
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Name()100%11100%
get_Severity()100%11100%
get_Description()100%11100%
get_HasFix()100%11100%
Fix(...)100%44100%

File(s)

D:\a\claude-aspx-lint\claude-aspx-lint\src\AspxLint.Core\Rules\Ws005Bom.cs

#LineLine coverage
 1namespace AspxLint.Core.Rules;
 2
 3public sealed class Ws005Bom : IRule
 4{
 2135    public string Id => "WS-005";
 386    public string Name => "BOM en debut de fichier";
 357    public Severity Severity => Severity.Warning;
 8    public string Description =>
 259        "Un BOM UTF-8 (\\uFEFF) en debut de fichier ASPX peut perturber le moteur ASP.NET (espaces parasites avant <!DOC
 4610    public bool HasFix => true;
 11
 12    public IEnumerable<Issue> Detect(string content, string[] lines, RuleContext ctx)
 13    {
 14        if (content.Length > 0 && content[0] == '')
 15            yield return new Issue(Id, Name, Severity,
 16                1, 1, "\\uFEFF (BOM)",
 17                "Enregistrer le fichier en UTF-8 sans BOM.");
 18    }
 19
 20    public string? Fix(string content, RuleContext ctx) =>
 2521        content.Length > 0 && content[0] == '' ? content[1..] : content;
 22}