# Summary

Class: | WireMock.Matchers.MatchScores
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\MatchScores.cs
Covered lines: | 9
Uncovered lines: | 0
Coverable lines: | 9
Total lines: | 61
Line coverage: | 100%
Branch coverage: | 66.6%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
ToScore(...) | 0 | 0 | 1 | 1
ToScore(...) | 0 | 0 | 1 | 0.5
ToScore(...) | 0 | 0 | 1 | 0.5

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\MatchScores.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Linq;`
|  | `3` |  | ``
|  | `4` |  | `namespace WireMock.Matchers`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// MatchScores`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `public static class MatchScores`
|  | `10` |  | `{`
|  | `11` |  | `/// <summary>`
|  | `12` |  | `/// The tolerance`
|  | `13` |  | `/// </summary>`
|  | `14` |  | `public const double Tolerance = 0.0001;`
|  | `15` |  | ``
|  | `16` |  | `/// <summary>`
|  | `17` |  | `/// The default mismatch score`
|  | `18` |  | `/// </summary>`
|  | `19` |  | `public const double Mismatch = 0.0;`
|  | `20` |  | ``
|  | `21` |  | `/// <summary>`
|  | `22` |  | `/// The default perfect match score`
|  | `23` |  | `/// </summary>`
|  | `24` |  | `public const double Perfect = 1.0;`
|  | `25` |  | ``
|  | `26` |  | `/// <summary>`
|  | `27` |  | `/// The almost perfect match score`
|  | `28` |  | `/// </summary>`
|  | `29` |  | `public const double AlmostPerfect = 0.99;`
|  | `30` |  | ``
|  | `31` |  | `/// <summary>`
|  | `32` |  | `/// Convert a bool to the score.`
|  | `33` |  | `/// </summary>`
|  | `34` |  | `/// <param name="value">if set to <c>true</c> [value].</param>`
|  | `35` |  | `/// <returns>score</returns>`
|  | `36` |  | `public static double ToScore(bool value)`
| 748 | `37` |  | `{`
| 748 | `38` |  | `return value ? Perfect : Mismatch;`
| 748 | `39` |  | `}`
|  | `40` |  | ``
|  | `41` |  | `/// <summary>`
|  | `42` |  | `/// Calculates the score from multiple funcs.`
|  | `43` |  | `/// </summary>`
|  | `44` |  | `/// <param name="values">The values.</param>`
|  | `45` |  | `/// <returns>average score</returns>`
|  | `46` |  | `public static double ToScore(IEnumerable<bool> values)`
| 432 | `47` |  | `{`
| 432 | `48` |  | `return values.Any() ? values.Select(ToScore).Average() : Mismatch;`
| 432 | `49` |  | `}`
|  | `50` |  | ``
|  | `51` |  | `/// <summary>`
|  | `52` |  | `/// Calculates the score from multiple funcs.`
|  | `53` |  | `/// </summary>`
|  | `54` |  | `/// <param name="values">The values.</param>`
|  | `55` |  | `/// <returns>average score</returns>`
|  | `56` |  | `public static double ToScore(IEnumerable<double> values)`
| 4 | `57` |  | `{`
| 4 | `58` |  | `return values.Any() ? values.Average() : Mismatch;`
| 4 | `59` |  | `}`
|  | `60` |  | `}`
|  | `61` |  | `}`

# Methods/Properties

ToScore(System.Boolean)
ToScore(System.Collections.Generic.IEnumerable`1<System.Boolean>)
ToScore(System.Collections.Generic.IEnumerable`1<System.Double>)