MinimaxWinning   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A looking() 0 4 1
1
<?php
2
/*
3
    Part of MINIMAX method Module - From the original Condorcet PHP
4
5
    Condorcet PHP - Election manager and results calculator.
6
    Designed for the Condorcet method. Integrating a large number of algorithms extending Condorcet. Expandable for all types of voting systems.
7
8
    By Julien Boudry and contributors - MIT LICENSE (Please read LICENSE.txt)
9
    https://github.com/julien-boudry/Condorcet
10
*/
11
declare(strict_types=1);
12
13
namespace CondorcetPHP\Condorcet\Algo\Methods\Minimax;
14
15
use CondorcetPHP\Condorcet\Algo\Methods\PairwiseStatsBased_Core;
16
17
// Minimax is a Condorcet Algorithm | http://en.wikipedia.org/wiki/Schulze_method
18
class MinimaxWinning extends PairwiseStatsBased_Core
19
{
20
    // Method Name
21
    public const METHOD_NAME = ['Minimax Winning','MinimaxWinning','Minimax','Minimax_Winning','Simpson','Simpson-Kramer','Simpson-Kramer Method','Simpson Method'];
22
23
    protected $_countType = 'worst_pairwise_defeat_winning';
24
25
26
/////////// COMPUTE ///////////
27
28
    //:: SIMPSON ALGORITHM. :://
29
30 6
    protected function looking (array $challenge) : int
31
    {
32 6
        return min($challenge);
33
    }
34
}
35