< Summary

Information
Class: Minesweeper.CellModule
Assembly: Minesweeper
File(s): /home/runner/work/kata-fsharp-tdd-minesweeper3/kata-fsharp-tdd-minesweeper3/src/Minesweeper/Cell.fs
Tag: 37_3611326257
Line coverage
93%
Covered lines: 28
Uncovered lines: 2
Coverable lines: 30
Total lines: 56
Line coverage: 93.3%
Branch coverage
95%
Covered branches: 38
Total branches: 40
Branch coverage: 95%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Coverage History

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
char(...)100%12100%
charUncovered(...)50%250%
add(...)100%12100%
click(...)50%266.66%
isBomb(...)100%12100%

File(s)

/home/runner/work/kata-fsharp-tdd-minesweeper3/kata-fsharp-tdd-minesweeper3/src/Minesweeper/Cell.fs

#LineLine coverage
 1namespace Minesweeper
 2
 3type Cell =
 4    | Covered of Cell
 5    | Bomb
 6    | One
 7    | Two
 8    | Three
 9    | Four
 10    | Five
 11    | Six
 12    | Seven
 13    | Eight
 14    | Zero
 15
 16module Cell =
 17    let init = Covered Zero
 18    let char = function
 1519        | Covered _ -> '.'
 820        | One -> '1'
 421        | Two -> '2'
 222        | Three -> '3'
 223        | Four -> '4'
 224        | Five -> '5'
 225        | Six -> '6'
 226        | Seven -> '7'
 327        | Eight -> '8'
 428        | Zero -> '0'
 429        | Bomb -> '*'
 30
 31    let charUncovered = function
 2432        | Covered x -> x |> char
 033        | v -> v |> char
 34
 35    let rec add v =
 5236        match v with
 6337        | Covered x -> x |> add |> Covered
 1838        | Zero -> One
 539        | One -> Two
 140        | Two -> Three
 141        | Three -> Four
 142        | Four -> Five
 143        | Five -> Six
 144        | Six -> Seven
 145        | Seven -> Eight
 246        | _ -> v
 47
 48    let click v =
 149        match v with
 150        | Covered x -> x
 051        | _ -> v
 52
 53    let rec isBomb = function
 254        | Bomb -> true
 2455        | Covered x -> x |> isBomb
 1056        | _ -> false