Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Failed Conditions
Pull Request — main (#1494)
by Dan
10:59 queued 05:29
created

CombatSimulator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 40
rs 10
c 1
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A build() 0 25 3
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Admin;
4
5
use DummyShip;
6
use Smr\Page\AccountPage;
7
use Smr\Template;
8
use SmrAccount;
9
10
class CombatSimulator extends AccountPage {
11
12
	public string $file = 'admin/combat_simulator.php';
13
14
	/**
15
	 * @param ?array<mixed> $results
16
	 * @param array<\AbstractSmrPlayer> $attackers
17
	 * @param array<\AbstractSmrPlayer> $defenders
18
	 */
19
	public function __construct(
20
		private readonly ?array $results = null,
21
		private readonly array $attackers = [],
22
		private readonly array $defenders = []
23
	) {}
24
25
	public function build(SmrAccount $account, Template $template): void {
26
		$template->assign('PageTopic', 'Combat Simulator');
27
28
		$template->assign('EditDummysLink', (new EditDummies())->href());
29
		$template->assign('DummyNames', DummyShip::getDummyNames());
30
31
		$duplicates = false;
32
33
		$attackers = $this->attackers;
34
		for ($i = count($attackers) + 1; $i <= MAXIMUM_PVP_FLEET_SIZE; ++$i) {
35
			$attackers[$i] = null;
36
		}
37
		$template->assign('Attackers', $attackers);
38
39
		$defenders = $this->defenders;
40
		for ($i = count($defenders) + 1; $i <= MAXIMUM_PVP_FLEET_SIZE; ++$i) {
41
			$defenders[$i] = null;
42
		}
43
		$template->assign('Defenders', $defenders);
44
45
		$template->assign('Duplicates', $duplicates);
46
47
		$template->assign('CombatSimHREF', (new CombatSimulatorProcessor())->href());
48
49
		$template->assign('TraderCombatResults', $this->results);
50
	}
51
52
}
53