Code Duplication    Length = 5-5 lines in 2 locations

models/DuelBadgeActivator.php 2 locations

@@ 46-50 (lines=5) @@
43
            ['limit'=>300, 'percent'=>25],
44
            ['limit'=>600, 'percent'=>10],
45
            ];
46
        foreach ($mapMax as $params) {
47
            if ($this->getSuccessRate($params['limit'], $cntSuccess, $cntFail) <= $params['percent']) {
48
                $this->activate('duel_rate_' . $params['percent']);
49
            }
50
        }
51
52
        $mapMin = [
53
            ['limit'=>100, 'percent'=>60],
@@ 57-61 (lines=5) @@
54
            ['limit'=>300, 'percent'=>75],
55
            ['limit'=>900, 'percent'=>90],
56
            ];
57
        foreach ($mapMin as $params) {
58
            if ($this->getSuccessRate($params['limit'], $cntSuccess, $cntFail) >= $params['percent']) {
59
                $this->activate('duel_rate_' . $params['percent']);
60
            }
61
        }
62
    }
63
64
    /**