[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-dotnet-crap-score":3,"mdc--rozikg-key":37,"related-repo-dotnet-crap-score":1341,"related-org-dotnet-crap-score":1446},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":25,"repoUrl":26,"updatedAt":27,"license":28,"forks":29,"topics":30,"repo":32,"sourceUrl":35,"mdContent":36},"crap-score","calculate CRAP scores for .NET code","Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET method, class, or single source file. Use when the user explicitly asks to compute CRAP scores or assess risky untested code for a specific target, combining Cobertura coverage data with cyclomatic complexity analysis. DO NOT USE FOR: project-wide coverage analysis, coverage plateau or \"stuck coverage\" diagnosis, what's blocking coverage, or where to add tests across a project (use coverage-analysis); writing tests; running tests without CRAP context.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"dotnet",".NET (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fdotnet.png",[12,16,19,22],{"name":13,"slug":14,"type":15},".NET","net","tag",{"name":17,"slug":18,"type":15},"Code Analysis","code-analysis",{"name":20,"slug":21,"type":15},"Testing","testing",{"name":23,"slug":24,"type":15},"Debugging","debugging",4576,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills","2026-08-01T05:42:13.41241","MIT",332,[31],"agent-skills",{"repoUrl":26,"stars":25,"forks":29,"topics":33,"description":34},[31],"Repository for skills to assist AI coding agents with .NET and C#","https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fdotnet-test\u002Fskills\u002Fcrap-score","---\nname: crap-score\ndescription: >\n  Calculates targeted CRAP (Change Risk Anti-Patterns) scores for a named .NET\n  method, class, or single source file. Use when the user explicitly asks to\n  compute CRAP scores or assess risky untested code for a specific target,\n  combining Cobertura coverage data with cyclomatic complexity analysis.\n  DO NOT USE FOR: project-wide coverage analysis, coverage plateau or \"stuck\n  coverage\" diagnosis, what's blocking coverage, or where to add tests across\n  a project (use coverage-analysis); writing tests; running tests without\n  CRAP context.\nlicense: MIT\n---\n\n# CRAP Score Analysis\n\nCalculate CRAP (Change Risk Anti-Patterns) scores for .NET methods to identify code that is both complex and undertested.\n\n## Background\n\nThe CRAP score combines **cyclomatic complexity** and **code coverage** into a single metric:\n\n$$\\text{CRAP}(m) = \\text{comp}(m)^2 \\times (1 - \\text{cov}(m))^3 + \\text{comp}(m)$$\n\nWhere:\n\n- $\\text{comp}(m)$ = cyclomatic complexity of method $m$\n- $\\text{cov}(m)$ = code coverage ratio (0.0 to 1.0) of method $m$\n\n| CRAP Score | Risk Level | Interpretation |\n|------------|------------|----------------|\n| \u003C 5        | Low        | Simple and well-tested |\n| 5-15       | Moderate   | Acceptable for most code |\n| 15-30      | High       | Needs more tests or simplification |\n| > 30       | Critical   | Refactor and add coverage urgently |\n\nA method with 100% coverage has CRAP = complexity (the minimum). A method with 0% coverage has CRAP = complexity^2 + complexity.\n\n## When to Use\n\n- User wants to assess which methods are risky due to low coverage and high complexity\n- User asks for CRAP score of specific methods, classes, or files\n- User wants to prioritize which code to test next\n- User wants to evaluate test quality beyond simple coverage percentages\n\n## When Not to Use\n\n- User just wants to run tests (use `run-tests` skill)\n- User wants to write new tests (use `writing-mstest-tests` skill or general coding assistance)\n- User only wants a coverage percentage without complexity analysis\n\n## Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| Target scope | Yes | Method name, class name, or file path to analyze |\n| Test project path | No | Path to the test project. Defaults to discovering test projects in the solution. |\n| Source project path | No | Path to the source project under analysis |\n\n## Workflow\n\n### Step 1: Collect code coverage data\n\nIf no coverage data exists yet (no Cobertura XML available), **always run `dotnet test` with coverage collection first** and mention the exact command in your response. Do not skip this step -- CRAP scores require coverage data.\n\nCheck the test project's `.csproj` for the coverage package, then run the appropriate command:\n\n| Coverage Package | Command | Output Location |\n|---|---|---|\n| `coverlet.collector` | `dotnet test --collect:\"XPlat Code Coverage\" --results-directory .\u002FTestResults` | Typically under `TestResults\u002F\u003Cguid>\u002Fcoverage.cobertura.xml`. Search recursively under the results directory (for example, `TestResults\u002F**\u002Fcoverage.cobertura.xml`) or use any explicit coverage path the user provides. |\n| `Microsoft.Testing.Extensions.CodeCoverage` (.NET 9) | `dotnet test -- --coverage --coverage-output-format cobertura --coverage-output .\u002FTestResults` | `--coverage-output` path |\n| `Microsoft.Testing.Extensions.CodeCoverage` (.NET 10+) | `dotnet test --coverage --coverage-output-format cobertura --coverage-output .\u002FTestResults` | `--coverage-output` path |\n\n#### Never estimate coverage\n\n**Guessed coverage produces wrong CRAP scores, which is worse than no answer.** If the first command yields no Cobertura XML, work down this list before giving up:\n\n1. Add a provider if none is referenced: `dotnet add \u003Ctest.csproj> package coverlet.collector`, then re-run.\n2. Use the standalone collector, which works even when the test host or a shared assembly blocks the in-proc collector:\n   `dotnet tool install --global dotnet-coverage` then\n   `dotnet-coverage collect -f cobertura -o coverage.cobertura.xml \"dotnet test \u003Ctest.csproj>\"`.\n3. Convert or summarize an existing report with ReportGenerator when only binary `.coverage` output exists:\n   `dotnet tool install --global dotnet-reportgenerator-globaltool` then\n   `reportgenerator -reports:\u003Cfile> -targetdir:cov -reporttypes:Cobertura`.\n4. Tests fail but still run? Coverage is collected from the tests that executed — continue with that data and note the failures.\n\nIf every path fails, **report that coverage could not be collected, show the commands you tried and their errors, and stop.** Report complexity on its own if useful, but never publish a CRAP number derived from an assumed coverage percentage.\n\n### Step 2: Compute cyclomatic complexity\n\nAnalyze the target source files to determine cyclomatic complexity per method. Count the following decision points (each adds 1 to the base complexity of 1):\n\n| Construct | Example |\n|-----------|---------|\n| `if` | `if (x > 0)` |\n| `else if` | `else if (y \u003C 0)` |\n| `case` (each) | `case 1:` |\n| `for` | `for (int i = 0; ...)` |\n| `foreach` | `foreach (var item in list)` |\n| `while` | `while (running)` |\n| `do...while` | `do { } while (cond)` |\n| `catch` (each) | `catch (Exception ex)` |\n| `&&` | `if (a && b)` |\n| `\\|\\|` (OR) | `if (a \\|\\| b)` |\n| `??` | `value ?? fallback` |\n| `?.` | `obj?.Method()` |\n| `? :` (ternary) | `x > 0 ? a : b` |\n| Pattern match arm | `x is > 0 and \u003C 10` |\n\nBase complexity is 1 for every method. Each decision point adds 1.\n\nWhen analyzing, read the source file and count these constructs per method. Report the breakdown.\n\n### Step 3: Extract per-method coverage from Cobertura XML\n\nParse the Cobertura XML to find each method's `line-rate` attribute under the target `\u003Cclass>` element. If `line-rate` is not available at method level, compute it from the `\u003Clines>` elements:\n\n$$\\text{cov}(m) = \\frac{\\text{lines with hits} > 0}{\\text{total lines}}$$\n\nMethod names in Cobertura may differ from source (async methods, lambdas). Match by line ranges when names don't align.\n\n### Step 4: Calculate CRAP scores\n\nFor each method in scope, apply the formula:\n\n$$\\text{CRAP}(m) = \\text{comp}(m)^2 \\times (1 - \\text{cov}(m))^3 + \\text{comp}(m)$$\n\n### Step 5: Present results\n\nPresent a sorted table (highest CRAP first):\n\n```text\n| Method                          | Complexity | Coverage | CRAP Score | Risk     |\n|---------------------------------|------------|----------|------------|----------|\n| OrderService.ProcessOrder       | 12         | 45%      | 28.4       | High     |\n| OrderService.ValidateItems      | 8          | 90%      | 8.1        | Moderate |\n| OrderService.CalculateTotal     | 3          | 100%     | 3.0        | Low      |\n```\n\nInclude:\n\n- **Summary**: total methods analyzed, how many in each risk category\n- **Top offenders**: methods with CRAP > 30, with specific recommendations\n- **Quick wins**: methods with high complexity but where small coverage improvements would drop the score significantly\n\n### Step 6: Provide actionable recommendations\n\nFor high-CRAP methods, suggest one or both:\n\n1. **Add tests** -- identify uncovered branches and suggest specific test cases\n2. **Reduce complexity** -- suggest extract-method refactoring for deeply nested logic\n\nCalculate the **coverage needed** to bring a method below a CRAP threshold of 15:\n\n$$\\text{cov}_{\\text{needed}} = 1 - \\left(\\frac{15 - \\text{comp}}{\\text{comp}^2}\\right)^{1\u002F3}$$\n\nThis formula only applies when comp \u003C 15. When comp >= 15, the minimum possible CRAP score (at 100% coverage) is comp itself, which already meets or exceeds the threshold. In that case, **coverage alone cannot bring the CRAP score below the threshold** -- the method must be refactored to reduce its cyclomatic complexity first.\n\nReport this as: \"To bring `ProcessOrder` (complexity 12) below CRAP 15, increase coverage from 45% to at least 72%.\" For methods where complexity alone exceeds the threshold, report: \"`ComplexMethod` (complexity 18) cannot reach CRAP \u003C 15 through testing alone -- reduce complexity by extracting sub-methods.\"\n\n## Validation\n\n- Verify that coverage data was collected successfully (Cobertura XML exists and contains data)\n- Confirm every coverage figure came from that XML — no estimated, assumed, or source-comment-derived values\n- Cross-check that method names in coverage data match the source code\n- Confirm CRAP scores by spot-checking the formula on one method manually\n- Ensure a 100%-covered method's CRAP equals its complexity exactly\n\n## Common Pitfalls\n\n- **Estimating coverage when collection fails**: never do it — the resulting CRAP scores are wrong in the direction that matters. Work through the fallbacks in Step 1, then report the blocker instead.\n- **Trusting a stale complexity comment in the source**: compute cyclomatic complexity from the current code; a `\u002F\u002F complexity: 7` comment left by a previous author is not evidence.\n- **Giving up on a shared-assembly or test-host collector error**: `dotnet-coverage collect` runs out of process and usually succeeds where the in-proc collector fails.\n- **Stale coverage data**: Always regenerate coverage before computing CRAP scores. Old coverage files will produce misleading results.\n- **Method name mismatches**: Cobertura XML may use mangled\u002Fcompiler-generated names for async methods, lambdas, or local functions. Match by line ranges when names don't align.\n- **Generated code**: Exclude auto-generated files (e.g., `*.Designer.cs`, `*.g.cs`) from analysis unless explicitly requested.\n",{"data":38,"body":39},{"name":4,"description":6,"license":28},{"type":40,"children":41},"root",[42,51,57,64,84,89,94,109,214,219,225,248,254,289,295,375,381,388,408,421,555,562,572,642,654,660,665,984,989,994,1000,1036,1041,1046,1052,1057,1061,1067,1072,1084,1089,1122,1128,1133,1156,1168,1173,1185,1206,1212,1240,1246],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"crap-score-analysis",[48],{"type":49,"value":50},"text","CRAP Score Analysis",{"type":43,"tag":52,"props":53,"children":54},"p",{},[55],{"type":49,"value":56},"Calculate CRAP (Change Risk Anti-Patterns) scores for .NET methods to identify code that is both complex and undertested.",{"type":43,"tag":58,"props":59,"children":61},"h2",{"id":60},"background",[62],{"type":49,"value":63},"Background",{"type":43,"tag":52,"props":65,"children":66},{},[67,69,75,77,82],{"type":49,"value":68},"The CRAP score combines ",{"type":43,"tag":70,"props":71,"children":72},"strong",{},[73],{"type":49,"value":74},"cyclomatic complexity",{"type":49,"value":76}," and ",{"type":43,"tag":70,"props":78,"children":79},{},[80],{"type":49,"value":81},"code coverage",{"type":49,"value":83}," into a single metric:",{"type":43,"tag":52,"props":85,"children":86},{},[87],{"type":49,"value":88},"$$\\text{CRAP}(m) = \\text{comp}(m)^2 \\times (1 - \\text{cov}(m))^3 + \\text{comp}(m)$$",{"type":43,"tag":52,"props":90,"children":91},{},[92],{"type":49,"value":93},"Where:",{"type":43,"tag":95,"props":96,"children":97},"ul",{},[98,104],{"type":43,"tag":99,"props":100,"children":101},"li",{},[102],{"type":49,"value":103},"$\\text{comp}(m)$ = cyclomatic complexity of method $m$",{"type":43,"tag":99,"props":105,"children":106},{},[107],{"type":49,"value":108},"$\\text{cov}(m)$ = code coverage ratio (0.0 to 1.0) of method $m$",{"type":43,"tag":110,"props":111,"children":112},"table",{},[113,137],{"type":43,"tag":114,"props":115,"children":116},"thead",{},[117],{"type":43,"tag":118,"props":119,"children":120},"tr",{},[121,127,132],{"type":43,"tag":122,"props":123,"children":124},"th",{},[125],{"type":49,"value":126},"CRAP Score",{"type":43,"tag":122,"props":128,"children":129},{},[130],{"type":49,"value":131},"Risk Level",{"type":43,"tag":122,"props":133,"children":134},{},[135],{"type":49,"value":136},"Interpretation",{"type":43,"tag":138,"props":139,"children":140},"tbody",{},[141,160,178,196],{"type":43,"tag":118,"props":142,"children":143},{},[144,150,155],{"type":43,"tag":145,"props":146,"children":147},"td",{},[148],{"type":49,"value":149},"\u003C 5",{"type":43,"tag":145,"props":151,"children":152},{},[153],{"type":49,"value":154},"Low",{"type":43,"tag":145,"props":156,"children":157},{},[158],{"type":49,"value":159},"Simple and well-tested",{"type":43,"tag":118,"props":161,"children":162},{},[163,168,173],{"type":43,"tag":145,"props":164,"children":165},{},[166],{"type":49,"value":167},"5-15",{"type":43,"tag":145,"props":169,"children":170},{},[171],{"type":49,"value":172},"Moderate",{"type":43,"tag":145,"props":174,"children":175},{},[176],{"type":49,"value":177},"Acceptable for most code",{"type":43,"tag":118,"props":179,"children":180},{},[181,186,191],{"type":43,"tag":145,"props":182,"children":183},{},[184],{"type":49,"value":185},"15-30",{"type":43,"tag":145,"props":187,"children":188},{},[189],{"type":49,"value":190},"High",{"type":43,"tag":145,"props":192,"children":193},{},[194],{"type":49,"value":195},"Needs more tests or simplification",{"type":43,"tag":118,"props":197,"children":198},{},[199,204,209],{"type":43,"tag":145,"props":200,"children":201},{},[202],{"type":49,"value":203},"> 30",{"type":43,"tag":145,"props":205,"children":206},{},[207],{"type":49,"value":208},"Critical",{"type":43,"tag":145,"props":210,"children":211},{},[212],{"type":49,"value":213},"Refactor and add coverage urgently",{"type":43,"tag":52,"props":215,"children":216},{},[217],{"type":49,"value":218},"A method with 100% coverage has CRAP = complexity (the minimum). A method with 0% coverage has CRAP = complexity^2 + complexity.",{"type":43,"tag":58,"props":220,"children":222},{"id":221},"when-to-use",[223],{"type":49,"value":224},"When to Use",{"type":43,"tag":95,"props":226,"children":227},{},[228,233,238,243],{"type":43,"tag":99,"props":229,"children":230},{},[231],{"type":49,"value":232},"User wants to assess which methods are risky due to low coverage and high complexity",{"type":43,"tag":99,"props":234,"children":235},{},[236],{"type":49,"value":237},"User asks for CRAP score of specific methods, classes, or files",{"type":43,"tag":99,"props":239,"children":240},{},[241],{"type":49,"value":242},"User wants to prioritize which code to test next",{"type":43,"tag":99,"props":244,"children":245},{},[246],{"type":49,"value":247},"User wants to evaluate test quality beyond simple coverage percentages",{"type":43,"tag":58,"props":249,"children":251},{"id":250},"when-not-to-use",[252],{"type":49,"value":253},"When Not to Use",{"type":43,"tag":95,"props":255,"children":256},{},[257,271,284],{"type":43,"tag":99,"props":258,"children":259},{},[260,262,269],{"type":49,"value":261},"User just wants to run tests (use ",{"type":43,"tag":263,"props":264,"children":266},"code",{"className":265},[],[267],{"type":49,"value":268},"run-tests",{"type":49,"value":270}," skill)",{"type":43,"tag":99,"props":272,"children":273},{},[274,276,282],{"type":49,"value":275},"User wants to write new tests (use ",{"type":43,"tag":263,"props":277,"children":279},{"className":278},[],[280],{"type":49,"value":281},"writing-mstest-tests",{"type":49,"value":283}," skill or general coding assistance)",{"type":43,"tag":99,"props":285,"children":286},{},[287],{"type":49,"value":288},"User only wants a coverage percentage without complexity analysis",{"type":43,"tag":58,"props":290,"children":292},{"id":291},"inputs",[293],{"type":49,"value":294},"Inputs",{"type":43,"tag":110,"props":296,"children":297},{},[298,319],{"type":43,"tag":114,"props":299,"children":300},{},[301],{"type":43,"tag":118,"props":302,"children":303},{},[304,309,314],{"type":43,"tag":122,"props":305,"children":306},{},[307],{"type":49,"value":308},"Input",{"type":43,"tag":122,"props":310,"children":311},{},[312],{"type":49,"value":313},"Required",{"type":43,"tag":122,"props":315,"children":316},{},[317],{"type":49,"value":318},"Description",{"type":43,"tag":138,"props":320,"children":321},{},[322,340,358],{"type":43,"tag":118,"props":323,"children":324},{},[325,330,335],{"type":43,"tag":145,"props":326,"children":327},{},[328],{"type":49,"value":329},"Target scope",{"type":43,"tag":145,"props":331,"children":332},{},[333],{"type":49,"value":334},"Yes",{"type":43,"tag":145,"props":336,"children":337},{},[338],{"type":49,"value":339},"Method name, class name, or file path to analyze",{"type":43,"tag":118,"props":341,"children":342},{},[343,348,353],{"type":43,"tag":145,"props":344,"children":345},{},[346],{"type":49,"value":347},"Test project path",{"type":43,"tag":145,"props":349,"children":350},{},[351],{"type":49,"value":352},"No",{"type":43,"tag":145,"props":354,"children":355},{},[356],{"type":49,"value":357},"Path to the test project. Defaults to discovering test projects in the solution.",{"type":43,"tag":118,"props":359,"children":360},{},[361,366,370],{"type":43,"tag":145,"props":362,"children":363},{},[364],{"type":49,"value":365},"Source project path",{"type":43,"tag":145,"props":367,"children":368},{},[369],{"type":49,"value":352},{"type":43,"tag":145,"props":371,"children":372},{},[373],{"type":49,"value":374},"Path to the source project under analysis",{"type":43,"tag":58,"props":376,"children":378},{"id":377},"workflow",[379],{"type":49,"value":380},"Workflow",{"type":43,"tag":382,"props":383,"children":385},"h3",{"id":384},"step-1-collect-code-coverage-data",[386],{"type":49,"value":387},"Step 1: Collect code coverage data",{"type":43,"tag":52,"props":389,"children":390},{},[391,393,406],{"type":49,"value":392},"If no coverage data exists yet (no Cobertura XML available), ",{"type":43,"tag":70,"props":394,"children":395},{},[396,398,404],{"type":49,"value":397},"always run ",{"type":43,"tag":263,"props":399,"children":401},{"className":400},[],[402],{"type":49,"value":403},"dotnet test",{"type":49,"value":405}," with coverage collection first",{"type":49,"value":407}," and mention the exact command in your response. Do not skip this step -- CRAP scores require coverage data.",{"type":43,"tag":52,"props":409,"children":410},{},[411,413,419],{"type":49,"value":412},"Check the test project's ",{"type":43,"tag":263,"props":414,"children":416},{"className":415},[],[417],{"type":49,"value":418},".csproj",{"type":49,"value":420}," for the coverage package, then run the appropriate command:",{"type":43,"tag":110,"props":422,"children":423},{},[424,445],{"type":43,"tag":114,"props":425,"children":426},{},[427],{"type":43,"tag":118,"props":428,"children":429},{},[430,435,440],{"type":43,"tag":122,"props":431,"children":432},{},[433],{"type":49,"value":434},"Coverage Package",{"type":43,"tag":122,"props":436,"children":437},{},[438],{"type":49,"value":439},"Command",{"type":43,"tag":122,"props":441,"children":442},{},[443],{"type":49,"value":444},"Output Location",{"type":43,"tag":138,"props":446,"children":447},{},[448,490,524],{"type":43,"tag":118,"props":449,"children":450},{},[451,460,469],{"type":43,"tag":145,"props":452,"children":453},{},[454],{"type":43,"tag":263,"props":455,"children":457},{"className":456},[],[458],{"type":49,"value":459},"coverlet.collector",{"type":43,"tag":145,"props":461,"children":462},{},[463],{"type":43,"tag":263,"props":464,"children":466},{"className":465},[],[467],{"type":49,"value":468},"dotnet test --collect:\"XPlat Code Coverage\" --results-directory .\u002FTestResults",{"type":43,"tag":145,"props":470,"children":471},{},[472,474,480,482,488],{"type":49,"value":473},"Typically under ",{"type":43,"tag":263,"props":475,"children":477},{"className":476},[],[478],{"type":49,"value":479},"TestResults\u002F\u003Cguid>\u002Fcoverage.cobertura.xml",{"type":49,"value":481},". Search recursively under the results directory (for example, ",{"type":43,"tag":263,"props":483,"children":485},{"className":484},[],[486],{"type":49,"value":487},"TestResults\u002F**\u002Fcoverage.cobertura.xml",{"type":49,"value":489},") or use any explicit coverage path the user provides.",{"type":43,"tag":118,"props":491,"children":492},{},[493,504,513],{"type":43,"tag":145,"props":494,"children":495},{},[496,502],{"type":43,"tag":263,"props":497,"children":499},{"className":498},[],[500],{"type":49,"value":501},"Microsoft.Testing.Extensions.CodeCoverage",{"type":49,"value":503}," (.NET 9)",{"type":43,"tag":145,"props":505,"children":506},{},[507],{"type":43,"tag":263,"props":508,"children":510},{"className":509},[],[511],{"type":49,"value":512},"dotnet test -- --coverage --coverage-output-format cobertura --coverage-output .\u002FTestResults",{"type":43,"tag":145,"props":514,"children":515},{},[516,522],{"type":43,"tag":263,"props":517,"children":519},{"className":518},[],[520],{"type":49,"value":521},"--coverage-output",{"type":49,"value":523}," path",{"type":43,"tag":118,"props":525,"children":526},{},[527,537,546],{"type":43,"tag":145,"props":528,"children":529},{},[530,535],{"type":43,"tag":263,"props":531,"children":533},{"className":532},[],[534],{"type":49,"value":501},{"type":49,"value":536}," (.NET 10+)",{"type":43,"tag":145,"props":538,"children":539},{},[540],{"type":43,"tag":263,"props":541,"children":543},{"className":542},[],[544],{"type":49,"value":545},"dotnet test --coverage --coverage-output-format cobertura --coverage-output .\u002FTestResults",{"type":43,"tag":145,"props":547,"children":548},{},[549,554],{"type":43,"tag":263,"props":550,"children":552},{"className":551},[],[553],{"type":49,"value":521},{"type":49,"value":523},{"type":43,"tag":556,"props":557,"children":559},"h4",{"id":558},"never-estimate-coverage",[560],{"type":49,"value":561},"Never estimate coverage",{"type":43,"tag":52,"props":563,"children":564},{},[565,570],{"type":43,"tag":70,"props":566,"children":567},{},[568],{"type":49,"value":569},"Guessed coverage produces wrong CRAP scores, which is worse than no answer.",{"type":49,"value":571}," If the first command yields no Cobertura XML, work down this list before giving up:",{"type":43,"tag":573,"props":574,"children":575},"ol",{},[576,589,610,637],{"type":43,"tag":99,"props":577,"children":578},{},[579,581,587],{"type":49,"value":580},"Add a provider if none is referenced: ",{"type":43,"tag":263,"props":582,"children":584},{"className":583},[],[585],{"type":49,"value":586},"dotnet add \u003Ctest.csproj> package coverlet.collector",{"type":49,"value":588},", then re-run.",{"type":43,"tag":99,"props":590,"children":591},{},[592,594,600,602,608],{"type":49,"value":593},"Use the standalone collector, which works even when the test host or a shared assembly blocks the in-proc collector:\n",{"type":43,"tag":263,"props":595,"children":597},{"className":596},[],[598],{"type":49,"value":599},"dotnet tool install --global dotnet-coverage",{"type":49,"value":601}," then\n",{"type":43,"tag":263,"props":603,"children":605},{"className":604},[],[606],{"type":49,"value":607},"dotnet-coverage collect -f cobertura -o coverage.cobertura.xml \"dotnet test \u003Ctest.csproj>\"",{"type":49,"value":609},".",{"type":43,"tag":99,"props":611,"children":612},{},[613,615,621,623,629,630,636],{"type":49,"value":614},"Convert or summarize an existing report with ReportGenerator when only binary ",{"type":43,"tag":263,"props":616,"children":618},{"className":617},[],[619],{"type":49,"value":620},".coverage",{"type":49,"value":622}," output exists:\n",{"type":43,"tag":263,"props":624,"children":626},{"className":625},[],[627],{"type":49,"value":628},"dotnet tool install --global dotnet-reportgenerator-globaltool",{"type":49,"value":601},{"type":43,"tag":263,"props":631,"children":633},{"className":632},[],[634],{"type":49,"value":635},"reportgenerator -reports:\u003Cfile> -targetdir:cov -reporttypes:Cobertura",{"type":49,"value":609},{"type":43,"tag":99,"props":638,"children":639},{},[640],{"type":49,"value":641},"Tests fail but still run? Coverage is collected from the tests that executed — continue with that data and note the failures.",{"type":43,"tag":52,"props":643,"children":644},{},[645,647,652],{"type":49,"value":646},"If every path fails, ",{"type":43,"tag":70,"props":648,"children":649},{},[650],{"type":49,"value":651},"report that coverage could not be collected, show the commands you tried and their errors, and stop.",{"type":49,"value":653}," Report complexity on its own if useful, but never publish a CRAP number derived from an assumed coverage percentage.",{"type":43,"tag":382,"props":655,"children":657},{"id":656},"step-2-compute-cyclomatic-complexity",[658],{"type":49,"value":659},"Step 2: Compute cyclomatic complexity",{"type":43,"tag":52,"props":661,"children":662},{},[663],{"type":49,"value":664},"Analyze the target source files to determine cyclomatic complexity per method. Count the following decision points (each adds 1 to the base complexity of 1):",{"type":43,"tag":110,"props":666,"children":667},{},[668,684],{"type":43,"tag":114,"props":669,"children":670},{},[671],{"type":43,"tag":118,"props":672,"children":673},{},[674,679],{"type":43,"tag":122,"props":675,"children":676},{},[677],{"type":49,"value":678},"Construct",{"type":43,"tag":122,"props":680,"children":681},{},[682],{"type":49,"value":683},"Example",{"type":43,"tag":138,"props":685,"children":686},{},[687,708,729,752,773,794,815,836,858,879,902,923,944,967],{"type":43,"tag":118,"props":688,"children":689},{},[690,699],{"type":43,"tag":145,"props":691,"children":692},{},[693],{"type":43,"tag":263,"props":694,"children":696},{"className":695},[],[697],{"type":49,"value":698},"if",{"type":43,"tag":145,"props":700,"children":701},{},[702],{"type":43,"tag":263,"props":703,"children":705},{"className":704},[],[706],{"type":49,"value":707},"if (x > 0)",{"type":43,"tag":118,"props":709,"children":710},{},[711,720],{"type":43,"tag":145,"props":712,"children":713},{},[714],{"type":43,"tag":263,"props":715,"children":717},{"className":716},[],[718],{"type":49,"value":719},"else if",{"type":43,"tag":145,"props":721,"children":722},{},[723],{"type":43,"tag":263,"props":724,"children":726},{"className":725},[],[727],{"type":49,"value":728},"else if (y \u003C 0)",{"type":43,"tag":118,"props":730,"children":731},{},[732,743],{"type":43,"tag":145,"props":733,"children":734},{},[735,741],{"type":43,"tag":263,"props":736,"children":738},{"className":737},[],[739],{"type":49,"value":740},"case",{"type":49,"value":742}," (each)",{"type":43,"tag":145,"props":744,"children":745},{},[746],{"type":43,"tag":263,"props":747,"children":749},{"className":748},[],[750],{"type":49,"value":751},"case 1:",{"type":43,"tag":118,"props":753,"children":754},{},[755,764],{"type":43,"tag":145,"props":756,"children":757},{},[758],{"type":43,"tag":263,"props":759,"children":761},{"className":760},[],[762],{"type":49,"value":763},"for",{"type":43,"tag":145,"props":765,"children":766},{},[767],{"type":43,"tag":263,"props":768,"children":770},{"className":769},[],[771],{"type":49,"value":772},"for (int i = 0; ...)",{"type":43,"tag":118,"props":774,"children":775},{},[776,785],{"type":43,"tag":145,"props":777,"children":778},{},[779],{"type":43,"tag":263,"props":780,"children":782},{"className":781},[],[783],{"type":49,"value":784},"foreach",{"type":43,"tag":145,"props":786,"children":787},{},[788],{"type":43,"tag":263,"props":789,"children":791},{"className":790},[],[792],{"type":49,"value":793},"foreach (var item in list)",{"type":43,"tag":118,"props":795,"children":796},{},[797,806],{"type":43,"tag":145,"props":798,"children":799},{},[800],{"type":43,"tag":263,"props":801,"children":803},{"className":802},[],[804],{"type":49,"value":805},"while",{"type":43,"tag":145,"props":807,"children":808},{},[809],{"type":43,"tag":263,"props":810,"children":812},{"className":811},[],[813],{"type":49,"value":814},"while (running)",{"type":43,"tag":118,"props":816,"children":817},{},[818,827],{"type":43,"tag":145,"props":819,"children":820},{},[821],{"type":43,"tag":263,"props":822,"children":824},{"className":823},[],[825],{"type":49,"value":826},"do...while",{"type":43,"tag":145,"props":828,"children":829},{},[830],{"type":43,"tag":263,"props":831,"children":833},{"className":832},[],[834],{"type":49,"value":835},"do { } while (cond)",{"type":43,"tag":118,"props":837,"children":838},{},[839,849],{"type":43,"tag":145,"props":840,"children":841},{},[842,848],{"type":43,"tag":263,"props":843,"children":845},{"className":844},[],[846],{"type":49,"value":847},"catch",{"type":49,"value":742},{"type":43,"tag":145,"props":850,"children":851},{},[852],{"type":43,"tag":263,"props":853,"children":855},{"className":854},[],[856],{"type":49,"value":857},"catch (Exception ex)",{"type":43,"tag":118,"props":859,"children":860},{},[861,870],{"type":43,"tag":145,"props":862,"children":863},{},[864],{"type":43,"tag":263,"props":865,"children":867},{"className":866},[],[868],{"type":49,"value":869},"&&",{"type":43,"tag":145,"props":871,"children":872},{},[873],{"type":43,"tag":263,"props":874,"children":876},{"className":875},[],[877],{"type":49,"value":878},"if (a && b)",{"type":43,"tag":118,"props":880,"children":881},{},[882,893],{"type":43,"tag":145,"props":883,"children":884},{},[885,891],{"type":43,"tag":263,"props":886,"children":888},{"className":887},[],[889],{"type":49,"value":890},"||",{"type":49,"value":892}," (OR)",{"type":43,"tag":145,"props":894,"children":895},{},[896],{"type":43,"tag":263,"props":897,"children":899},{"className":898},[],[900],{"type":49,"value":901},"if (a || b)",{"type":43,"tag":118,"props":903,"children":904},{},[905,914],{"type":43,"tag":145,"props":906,"children":907},{},[908],{"type":43,"tag":263,"props":909,"children":911},{"className":910},[],[912],{"type":49,"value":913},"??",{"type":43,"tag":145,"props":915,"children":916},{},[917],{"type":43,"tag":263,"props":918,"children":920},{"className":919},[],[921],{"type":49,"value":922},"value ?? fallback",{"type":43,"tag":118,"props":924,"children":925},{},[926,935],{"type":43,"tag":145,"props":927,"children":928},{},[929],{"type":43,"tag":263,"props":930,"children":932},{"className":931},[],[933],{"type":49,"value":934},"?.",{"type":43,"tag":145,"props":936,"children":937},{},[938],{"type":43,"tag":263,"props":939,"children":941},{"className":940},[],[942],{"type":49,"value":943},"obj?.Method()",{"type":43,"tag":118,"props":945,"children":946},{},[947,958],{"type":43,"tag":145,"props":948,"children":949},{},[950,956],{"type":43,"tag":263,"props":951,"children":953},{"className":952},[],[954],{"type":49,"value":955},"? :",{"type":49,"value":957}," (ternary)",{"type":43,"tag":145,"props":959,"children":960},{},[961],{"type":43,"tag":263,"props":962,"children":964},{"className":963},[],[965],{"type":49,"value":966},"x > 0 ? a : b",{"type":43,"tag":118,"props":968,"children":969},{},[970,975],{"type":43,"tag":145,"props":971,"children":972},{},[973],{"type":49,"value":974},"Pattern match arm",{"type":43,"tag":145,"props":976,"children":977},{},[978],{"type":43,"tag":263,"props":979,"children":981},{"className":980},[],[982],{"type":49,"value":983},"x is > 0 and \u003C 10",{"type":43,"tag":52,"props":985,"children":986},{},[987],{"type":49,"value":988},"Base complexity is 1 for every method. Each decision point adds 1.",{"type":43,"tag":52,"props":990,"children":991},{},[992],{"type":49,"value":993},"When analyzing, read the source file and count these constructs per method. Report the breakdown.",{"type":43,"tag":382,"props":995,"children":997},{"id":996},"step-3-extract-per-method-coverage-from-cobertura-xml",[998],{"type":49,"value":999},"Step 3: Extract per-method coverage from Cobertura XML",{"type":43,"tag":52,"props":1001,"children":1002},{},[1003,1005,1011,1013,1019,1021,1026,1028,1034],{"type":49,"value":1004},"Parse the Cobertura XML to find each method's ",{"type":43,"tag":263,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":49,"value":1010},"line-rate",{"type":49,"value":1012}," attribute under the target ",{"type":43,"tag":263,"props":1014,"children":1016},{"className":1015},[],[1017],{"type":49,"value":1018},"\u003Cclass>",{"type":49,"value":1020}," element. If ",{"type":43,"tag":263,"props":1022,"children":1024},{"className":1023},[],[1025],{"type":49,"value":1010},{"type":49,"value":1027}," is not available at method level, compute it from the ",{"type":43,"tag":263,"props":1029,"children":1031},{"className":1030},[],[1032],{"type":49,"value":1033},"\u003Clines>",{"type":49,"value":1035}," elements:",{"type":43,"tag":52,"props":1037,"children":1038},{},[1039],{"type":49,"value":1040},"$$\\text{cov}(m) = \\frac{\\text{lines with hits} > 0}{\\text{total lines}}$$",{"type":43,"tag":52,"props":1042,"children":1043},{},[1044],{"type":49,"value":1045},"Method names in Cobertura may differ from source (async methods, lambdas). Match by line ranges when names don't align.",{"type":43,"tag":382,"props":1047,"children":1049},{"id":1048},"step-4-calculate-crap-scores",[1050],{"type":49,"value":1051},"Step 4: Calculate CRAP scores",{"type":43,"tag":52,"props":1053,"children":1054},{},[1055],{"type":49,"value":1056},"For each method in scope, apply the formula:",{"type":43,"tag":52,"props":1058,"children":1059},{},[1060],{"type":49,"value":88},{"type":43,"tag":382,"props":1062,"children":1064},{"id":1063},"step-5-present-results",[1065],{"type":49,"value":1066},"Step 5: Present results",{"type":43,"tag":52,"props":1068,"children":1069},{},[1070],{"type":49,"value":1071},"Present a sorted table (highest CRAP first):",{"type":43,"tag":1073,"props":1074,"children":1079},"pre",{"className":1075,"code":1077,"language":49,"meta":1078},[1076],"language-text","| Method                          | Complexity | Coverage | CRAP Score | Risk     |\n|---------------------------------|------------|----------|------------|----------|\n| OrderService.ProcessOrder       | 12         | 45%      | 28.4       | High     |\n| OrderService.ValidateItems      | 8          | 90%      | 8.1        | Moderate |\n| OrderService.CalculateTotal     | 3          | 100%     | 3.0        | Low      |\n","",[1080],{"type":43,"tag":263,"props":1081,"children":1082},{"__ignoreMap":1078},[1083],{"type":49,"value":1077},{"type":43,"tag":52,"props":1085,"children":1086},{},[1087],{"type":49,"value":1088},"Include:",{"type":43,"tag":95,"props":1090,"children":1091},{},[1092,1102,1112],{"type":43,"tag":99,"props":1093,"children":1094},{},[1095,1100],{"type":43,"tag":70,"props":1096,"children":1097},{},[1098],{"type":49,"value":1099},"Summary",{"type":49,"value":1101},": total methods analyzed, how many in each risk category",{"type":43,"tag":99,"props":1103,"children":1104},{},[1105,1110],{"type":43,"tag":70,"props":1106,"children":1107},{},[1108],{"type":49,"value":1109},"Top offenders",{"type":49,"value":1111},": methods with CRAP > 30, with specific recommendations",{"type":43,"tag":99,"props":1113,"children":1114},{},[1115,1120],{"type":43,"tag":70,"props":1116,"children":1117},{},[1118],{"type":49,"value":1119},"Quick wins",{"type":49,"value":1121},": methods with high complexity but where small coverage improvements would drop the score significantly",{"type":43,"tag":382,"props":1123,"children":1125},{"id":1124},"step-6-provide-actionable-recommendations",[1126],{"type":49,"value":1127},"Step 6: Provide actionable recommendations",{"type":43,"tag":52,"props":1129,"children":1130},{},[1131],{"type":49,"value":1132},"For high-CRAP methods, suggest one or both:",{"type":43,"tag":573,"props":1134,"children":1135},{},[1136,1146],{"type":43,"tag":99,"props":1137,"children":1138},{},[1139,1144],{"type":43,"tag":70,"props":1140,"children":1141},{},[1142],{"type":49,"value":1143},"Add tests",{"type":49,"value":1145}," -- identify uncovered branches and suggest specific test cases",{"type":43,"tag":99,"props":1147,"children":1148},{},[1149,1154],{"type":43,"tag":70,"props":1150,"children":1151},{},[1152],{"type":49,"value":1153},"Reduce complexity",{"type":49,"value":1155}," -- suggest extract-method refactoring for deeply nested logic",{"type":43,"tag":52,"props":1157,"children":1158},{},[1159,1161,1166],{"type":49,"value":1160},"Calculate the ",{"type":43,"tag":70,"props":1162,"children":1163},{},[1164],{"type":49,"value":1165},"coverage needed",{"type":49,"value":1167}," to bring a method below a CRAP threshold of 15:",{"type":43,"tag":52,"props":1169,"children":1170},{},[1171],{"type":49,"value":1172},"$$\\text{cov}_{\\text{needed}} = 1 - \\left(\\frac{15 - \\text{comp}}{\\text{comp}^2}\\right)^{1\u002F3}$$",{"type":43,"tag":52,"props":1174,"children":1175},{},[1176,1178,1183],{"type":49,"value":1177},"This formula only applies when comp \u003C 15. When comp >= 15, the minimum possible CRAP score (at 100% coverage) is comp itself, which already meets or exceeds the threshold. In that case, ",{"type":43,"tag":70,"props":1179,"children":1180},{},[1181],{"type":49,"value":1182},"coverage alone cannot bring the CRAP score below the threshold",{"type":49,"value":1184}," -- the method must be refactored to reduce its cyclomatic complexity first.",{"type":43,"tag":52,"props":1186,"children":1187},{},[1188,1190,1196,1198,1204],{"type":49,"value":1189},"Report this as: \"To bring ",{"type":43,"tag":263,"props":1191,"children":1193},{"className":1192},[],[1194],{"type":49,"value":1195},"ProcessOrder",{"type":49,"value":1197}," (complexity 12) below CRAP 15, increase coverage from 45% to at least 72%.\" For methods where complexity alone exceeds the threshold, report: \"",{"type":43,"tag":263,"props":1199,"children":1201},{"className":1200},[],[1202],{"type":49,"value":1203},"ComplexMethod",{"type":49,"value":1205}," (complexity 18) cannot reach CRAP \u003C 15 through testing alone -- reduce complexity by extracting sub-methods.\"",{"type":43,"tag":58,"props":1207,"children":1209},{"id":1208},"validation",[1210],{"type":49,"value":1211},"Validation",{"type":43,"tag":95,"props":1213,"children":1214},{},[1215,1220,1225,1230,1235],{"type":43,"tag":99,"props":1216,"children":1217},{},[1218],{"type":49,"value":1219},"Verify that coverage data was collected successfully (Cobertura XML exists and contains data)",{"type":43,"tag":99,"props":1221,"children":1222},{},[1223],{"type":49,"value":1224},"Confirm every coverage figure came from that XML — no estimated, assumed, or source-comment-derived values",{"type":43,"tag":99,"props":1226,"children":1227},{},[1228],{"type":49,"value":1229},"Cross-check that method names in coverage data match the source code",{"type":43,"tag":99,"props":1231,"children":1232},{},[1233],{"type":49,"value":1234},"Confirm CRAP scores by spot-checking the formula on one method manually",{"type":43,"tag":99,"props":1236,"children":1237},{},[1238],{"type":49,"value":1239},"Ensure a 100%-covered method's CRAP equals its complexity exactly",{"type":43,"tag":58,"props":1241,"children":1243},{"id":1242},"common-pitfalls",[1244],{"type":49,"value":1245},"Common Pitfalls",{"type":43,"tag":95,"props":1247,"children":1248},{},[1249,1259,1277,1295,1305,1315],{"type":43,"tag":99,"props":1250,"children":1251},{},[1252,1257],{"type":43,"tag":70,"props":1253,"children":1254},{},[1255],{"type":49,"value":1256},"Estimating coverage when collection fails",{"type":49,"value":1258},": never do it — the resulting CRAP scores are wrong in the direction that matters. Work through the fallbacks in Step 1, then report the blocker instead.",{"type":43,"tag":99,"props":1260,"children":1261},{},[1262,1267,1269,1275],{"type":43,"tag":70,"props":1263,"children":1264},{},[1265],{"type":49,"value":1266},"Trusting a stale complexity comment in the source",{"type":49,"value":1268},": compute cyclomatic complexity from the current code; a ",{"type":43,"tag":263,"props":1270,"children":1272},{"className":1271},[],[1273],{"type":49,"value":1274},"\u002F\u002F complexity: 7",{"type":49,"value":1276}," comment left by a previous author is not evidence.",{"type":43,"tag":99,"props":1278,"children":1279},{},[1280,1285,1287,1293],{"type":43,"tag":70,"props":1281,"children":1282},{},[1283],{"type":49,"value":1284},"Giving up on a shared-assembly or test-host collector error",{"type":49,"value":1286},": ",{"type":43,"tag":263,"props":1288,"children":1290},{"className":1289},[],[1291],{"type":49,"value":1292},"dotnet-coverage collect",{"type":49,"value":1294}," runs out of process and usually succeeds where the in-proc collector fails.",{"type":43,"tag":99,"props":1296,"children":1297},{},[1298,1303],{"type":43,"tag":70,"props":1299,"children":1300},{},[1301],{"type":49,"value":1302},"Stale coverage data",{"type":49,"value":1304},": Always regenerate coverage before computing CRAP scores. Old coverage files will produce misleading results.",{"type":43,"tag":99,"props":1306,"children":1307},{},[1308,1313],{"type":43,"tag":70,"props":1309,"children":1310},{},[1311],{"type":49,"value":1312},"Method name mismatches",{"type":49,"value":1314},": Cobertura XML may use mangled\u002Fcompiler-generated names for async methods, lambdas, or local functions. Match by line ranges when names don't align.",{"type":43,"tag":99,"props":1316,"children":1317},{},[1318,1323,1325,1331,1333,1339],{"type":43,"tag":70,"props":1319,"children":1320},{},[1321],{"type":49,"value":1322},"Generated code",{"type":49,"value":1324},": Exclude auto-generated files (e.g., ",{"type":43,"tag":263,"props":1326,"children":1328},{"className":1327},[],[1329],{"type":49,"value":1330},"*.Designer.cs",{"type":49,"value":1332},", ",{"type":43,"tag":263,"props":1334,"children":1336},{"className":1335},[],[1337],{"type":49,"value":1338},"*.g.cs",{"type":49,"value":1340},") from analysis unless explicitly requested.",{"items":1342,"total":1445},[1343,1356,1371,1389,1401,1421,1431],{"slug":1344,"name":1344,"fn":1345,"description":1346,"org":1347,"tags":1348,"stars":25,"repoUrl":26,"updatedAt":1355},"analyzing-dotnet-performance","analyze .NET code for performance anti-patterns","Scans .NET code for ~50 performance anti-patterns across async, memory, strings, collections, LINQ, regex, serialization, and I\u002FO with tiered severity classification. Use when analyzing .NET code for optimization opportunities, reviewing hot paths, or auditing allocation-heavy patterns.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1349,1350,1351,1352],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":1353,"slug":1354,"type":15},"Performance","performance","2026-07-12T08:23:25.400375",{"slug":1357,"name":1357,"fn":1358,"description":1359,"org":1360,"tags":1361,"stars":25,"repoUrl":26,"updatedAt":1370},"android-tombstone-symbolication","symbolicate .NET runtime frames in Android tombstones","Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app crash from a tombstone, resolving native backtrace frames in libmonosgen-2.0.so or libcoreclr.so to .NET runtime source code, or investigating SIGABRT, SIGSEGV, or other native signals originating from the .NET runtime on Android. DO NOT USE FOR pure Java\u002FKotlin crashes, managed .NET exceptions that are already captured in logcat, or iOS crash logs. INVOKES Symbolicate-Tombstone.ps1 script, llvm-symbolizer, Microsoft symbol server.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1362,1363,1366,1367],{"name":13,"slug":14,"type":15},{"name":1364,"slug":1365,"type":15},"Android","android",{"name":23,"slug":24,"type":15},{"name":1368,"slug":1369,"type":15},"Microsoft","microsoft","2026-07-12T08:23:21.595572",{"slug":1372,"name":1372,"fn":1373,"description":1374,"org":1375,"tags":1376,"stars":25,"repoUrl":26,"updatedAt":1388},"apple-crash-symbolication","symbolicate .NET runtime frames in crash logs","Symbolicate .NET runtime frames in Apple platform .ips crash logs (iOS, tvOS, Mac Catalyst, macOS). Extracts UUIDs and addresses from the native backtrace, locates dSYM debug symbols, and runs atos to produce function names with source file and line numbers. Automatically downloads .dwarf symbols from the Microsoft symbol server using Mach-O UUIDs. USE FOR triaging a .NET MAUI or Mono app crash from an .ips file on any Apple platform, resolving native backtrace frames in libcoreclr or libmonosgen-2.0 to .NET runtime source code, retrieving .ips crash logs from a connected iOS device or iPhone, or investigating EXC_CRASH, EXC_BAD_ACCESS, SIGABRT, or SIGSEGV originating from the .NET runtime. DO NOT USE FOR pure Swift\u002FObjective-C crashes with no .NET components, or Android tombstone files. INVOKES Symbolicate-Crash.ps1 script, atos, dwarfdump, idevicecrashreport.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1377,1378,1379,1382,1385],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":1380,"slug":1381,"type":15},"iOS","ios",{"name":1383,"slug":1384,"type":15},"macOS","macos",{"name":1386,"slug":1387,"type":15},"Observability","observability","2026-07-12T08:23:20.369986",{"slug":1390,"name":1390,"fn":1391,"description":1392,"org":1393,"tags":1394,"stars":25,"repoUrl":26,"updatedAt":1400},"assertion-quality","evaluate assertion quality in test suites","Analyzes the variety and depth of assertions across test suites in any language. Use when the user asks to evaluate assertion quality, find shallow tests, identify assertion-free tests (no assertions or only trivial ones like Assert.IsNotNull \u002F toBeTruthy()), flag self-referential or tautological assertions, measure assertion diversity, or audit whether tests verify different facets of behavior. Polyglot: .NET, Python, TS\u002FJS, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, C++. DO NOT USE FOR: writing new tests (use code-testing-agent \u002F writing-mstest-tests), mutation reasoning about whether tests would catch a bug (use test-gap-analysis), or a general severity-ranked anti-pattern audit (use test-anti-patterns), fixing or rewriting assertions, or writing, fixing, or modernizing MSTest tests, assertions, or attributes (use writing-mstest-tests).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1395,1396,1399],{"name":17,"slug":18,"type":15},{"name":1397,"slug":1398,"type":15},"QA","qa",{"name":20,"slug":21,"type":15},"2026-07-12T08:23:51.277743",{"slug":1402,"name":1402,"fn":1403,"description":1404,"org":1405,"tags":1406,"stars":25,"repoUrl":26,"updatedAt":1420},"author-component","create and review Blazor components","Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering), HTTP data fetching patterns (use fetch-and-send-data), coordinating state between unrelated components (use coordinate-components).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1407,1408,1411,1414,1417],{"name":13,"slug":14,"type":15},{"name":1409,"slug":1410,"type":15},"Blazor","blazor",{"name":1412,"slug":1413,"type":15},"C#","csharp",{"name":1415,"slug":1416,"type":15},"UI Components","ui-components",{"name":1418,"slug":1419,"type":15},"Web Development","web-development","2026-07-15T06:03:29.216359",{"slug":1422,"name":1422,"fn":1423,"description":1424,"org":1425,"tags":1426,"stars":25,"repoUrl":26,"updatedAt":1430},"binlog-failure-analysis","analyze MSBuild binary logs","Analyze MSBuild binary logs to diagnose build failures. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, and generally any MSBuild build issues. Requires an existing .binlog file. DO NOT USE FOR: generating binlogs (use binlog-generation), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1427,1428,1429],{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":1368,"slug":1369,"type":15},"2026-07-12T08:21:34.637923",{"slug":1432,"name":1432,"fn":1433,"description":1434,"org":1435,"tags":1436,"stars":25,"repoUrl":26,"updatedAt":1444},"binlog-generation","generate MSBuild binary logs for diagnostics","Generate MSBuild binary logs (binlogs) for build diagnostics and analysis. USE FOR: adding \u002Fbl:{} to any dotnet build, test, pack, publish, or restore command to capture a full build execution trace, prerequisite for binlog-failure-analysis and build-perf-diagnostics skills, enabling post-build investigation of errors or performance. Requires MSBuild 17.8+ \u002F .NET 8 SDK+ for {} placeholder; PowerShell needs -bl:{{}}. DO NOT USE FOR: non-MSBuild build systems (npm, Maven, CMake), analyzing an existing binlog (use binlog-failure-analysis instead).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1437,1440,1441],{"name":1438,"slug":1439,"type":15},"Build","build",{"name":23,"slug":24,"type":15},{"name":1442,"slug":1443,"type":15},"Engineering","engineering","2026-07-19T05:38:19.340791",96,{"items":1447,"total":1552},[1448,1460,1467,1474,1482,1488,1496,1502,1508,1518,1531,1542],{"slug":1449,"name":1449,"fn":1450,"description":1451,"org":1452,"tags":1453,"stars":1457,"repoUrl":1458,"updatedAt":1459},"multithreaded-task-migration","migrate MSBuild tasks to multithreaded mode","Guide for migrating MSBuild tasks to multithreaded mode support, including compatibility red-team review. Use this when converting tasks to thread-safe versions, implementing IMultiThreadableTask, adding TaskEnvironment support, or auditing migrations for behavioral compatibility.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1454,1455,1456],{"name":13,"slug":14,"type":15},{"name":1442,"slug":1443,"type":15},{"name":1353,"slug":1354,"type":15},5535,"https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmsbuild","2026-07-22T05:37:33.965588",{"slug":1344,"name":1344,"fn":1345,"description":1346,"org":1461,"tags":1462,"stars":25,"repoUrl":26,"updatedAt":1355},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1463,1464,1465,1466],{"name":13,"slug":14,"type":15},{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":1353,"slug":1354,"type":15},{"slug":1357,"name":1357,"fn":1358,"description":1359,"org":1468,"tags":1469,"stars":25,"repoUrl":26,"updatedAt":1370},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1470,1471,1472,1473],{"name":13,"slug":14,"type":15},{"name":1364,"slug":1365,"type":15},{"name":23,"slug":24,"type":15},{"name":1368,"slug":1369,"type":15},{"slug":1372,"name":1372,"fn":1373,"description":1374,"org":1475,"tags":1476,"stars":25,"repoUrl":26,"updatedAt":1388},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1477,1478,1479,1480,1481],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":1380,"slug":1381,"type":15},{"name":1383,"slug":1384,"type":15},{"name":1386,"slug":1387,"type":15},{"slug":1390,"name":1390,"fn":1391,"description":1392,"org":1483,"tags":1484,"stars":25,"repoUrl":26,"updatedAt":1400},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1485,1486,1487],{"name":17,"slug":18,"type":15},{"name":1397,"slug":1398,"type":15},{"name":20,"slug":21,"type":15},{"slug":1402,"name":1402,"fn":1403,"description":1404,"org":1489,"tags":1490,"stars":25,"repoUrl":26,"updatedAt":1420},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1491,1492,1493,1494,1495],{"name":13,"slug":14,"type":15},{"name":1409,"slug":1410,"type":15},{"name":1412,"slug":1413,"type":15},{"name":1415,"slug":1416,"type":15},{"name":1418,"slug":1419,"type":15},{"slug":1422,"name":1422,"fn":1423,"description":1424,"org":1497,"tags":1498,"stars":25,"repoUrl":26,"updatedAt":1430},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1499,1500,1501],{"name":17,"slug":18,"type":15},{"name":23,"slug":24,"type":15},{"name":1368,"slug":1369,"type":15},{"slug":1432,"name":1432,"fn":1433,"description":1434,"org":1503,"tags":1504,"stars":25,"repoUrl":26,"updatedAt":1444},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1505,1506,1507],{"name":1438,"slug":1439,"type":15},{"name":23,"slug":24,"type":15},{"name":1442,"slug":1443,"type":15},{"slug":1509,"name":1509,"fn":1510,"description":1511,"org":1512,"tags":1513,"stars":25,"repoUrl":26,"updatedAt":1517},"build-parallelism","optimize MSBuild build parallelism","Diagnose and fix under-parallelized MSBuild builds. USE WHEN a multi-project solution build is slower than expected, doesn't speed up when you add cores, pegs a single core while others idle, or you want to know why `-m` isn't helping. Note: `\u002Fmaxcpucount` default is 1 (sequential) — always pass `-m` for parallel builds. Covers finding the critical path (longest serial ProjectReference chain), graph build (`\u002Fgraph`), BuildInParallel, and solution filters (`.slnf`). DO NOT USE FOR: single-project builds, incremental issues (use incremental-build), compilation slowness inside one project (use build-perf-diagnostics), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1514,1515,1516],{"name":13,"slug":14,"type":15},{"name":1442,"slug":1443,"type":15},{"name":1353,"slug":1354,"type":15},"2026-07-19T05:38:18.364937",{"slug":1519,"name":1519,"fn":1520,"description":1521,"org":1522,"tags":1523,"stars":25,"repoUrl":26,"updatedAt":1530},"build-perf-baseline","establish and optimize build performance baselines","Establish build performance baselines and apply systematic optimization techniques. USE FOR: diagnosing slow builds, establishing before\u002Fafter measurements (cold, warm, no-op scenarios), applying optimization strategies like MSBuild Server, static graph builds, artifacts output, and dependency graph trimming. Start here before diving into build-perf-diagnostics, incremental-build, or build-parallelism. DO NOT USE FOR: non-MSBuild build systems, detailed bottleneck analysis (use build-perf-diagnostics after baselining).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1524,1525,1528,1529],{"name":1442,"slug":1443,"type":15},{"name":1526,"slug":1527,"type":15},"Monitoring","monitoring",{"name":1353,"slug":1354,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T08:21:35.865649",{"slug":1532,"name":1532,"fn":1533,"description":1534,"org":1535,"tags":1536,"stars":25,"repoUrl":26,"updatedAt":1541},"build-perf-diagnostics","diagnose MSBuild build performance bottlenecks","Diagnose MSBuild build performance bottlenecks using binary log analysis. USE FOR: identifying why builds are slow by analyzing binlog performance summaries, detecting ResolveAssemblyReference (RAR) taking >5s, Roslyn analyzers consuming >30% of Csc time, single targets dominating >50% of build time, node utilization below 80%, excessive Copy tasks, NuGet restore running every build. Covers timeline analysis, Target\u002FTask Performance Summary interpretation, and 7 common bottleneck categories. Use after build-perf-baseline has established measurements. DO NOT USE FOR: establishing initial baselines (use build-perf-baseline first), fixing incremental build issues (use incremental-build), parallelism tuning (use build-parallelism), non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1537,1538,1539,1540],{"name":13,"slug":14,"type":15},{"name":23,"slug":24,"type":15},{"name":1442,"slug":1443,"type":15},{"name":1353,"slug":1354,"type":15},"2026-07-12T08:21:40.961722",{"slug":1543,"name":1543,"fn":1544,"description":1545,"org":1546,"tags":1547,"stars":25,"repoUrl":26,"updatedAt":1551},"check-bin-obj-clash","detect MSBuild output path conflicts","Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath. USE FOR: builds failing with 'Cannot create a file when that file already exists', 'The process cannot access the file because it is being used by another process', intermittent build failures that succeed on retry, or missing\u002Foverwritten outputs in multi-project or multi-targeting builds where bin\u002Fobj (or project.assets.json) collide. Common causes: shared OutputPath, missing AppendTargetFrameworkToOutputPath, extra global properties (e.g. PublishReadyToRun), or SetTargetFramework on a ProjectReference to a single-targeting project. DO NOT USE FOR: file access errors unrelated to MSBuild (OS-level locking), single-project single-TFM builds, non-MSBuild build systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[1548,1549,1550],{"name":23,"slug":24,"type":15},{"name":1442,"slug":1443,"type":15},{"name":1397,"slug":1398,"type":15},"2026-07-19T05:38:14.336279",144]