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

Passed
Pull Request — master (#893)
by Dan
04:05
created

buildRaceBox()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 11
rs 9.9666
cc 2
nc 2
nop 1
1
<?php declare(strict_types=1);
2
try {
3
	require_once('config.inc');
4
5
	$template = new Template();
6
7
	$weapons = [];
8
	foreach (SmrWeaponType::getAllWeaponTypes() as $weapon) {
0 ignored issues
show
Bug introduced by
The type SmrWeaponType was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
		switch ($weapon->getBuyerRestriction()) {
10
			case BUYER_RESTRICTION_GOOD:
11
				$restriction = '<span class="dgreen">Good</span>';
12
			break;
13
			case BUYER_RESTRICTION_EVIL:
14
				$restriction = '<span class="red">Evil</span>';
15
			break;
16
			case BUYER_RESTRICTION_NEWBIE:
17
				$restriction = '<span style="color: #06F;">Newbie</span>';
18
			break;
19
			case BUYER_RESTRICTION_PORT:
20
				$restriction = '<span class="yellow">Port</span>';
21
			break;
22
			case BUYER_RESTRICTION_PLANET:
23
				$restriction = '<span class="yellow">Planet</span>';
24
			break;
25
			default:
26
				$restriction = '';
27
		}
28
		$weapons[] = [
29
			'restriction' => $restriction,
30
			'weapon_name' => $weapon->getName(),
31
			'race_id' => $weapon->getRaceID(),
32
			'race_name' => Globals::getRaceName($weapon->getRaceID()),
33
			'cost' => number_format($weapon->getCost()),
34
			'shield_damage' => $weapon->getShieldDamage(),
35
			'armour_damage' => $weapon->getArmourDamage(),
36
			'accuracy' => $weapon->getAccuracy(),
37
			'power_level' => $weapon->getPowerLevel(),
38
		];
39
	}
40
	$template->assign('Weapons', $weapons);
41
42
	$powerLevels = array_unique(array_column($weapons, 'power_level'));
43
	rsort($powerLevels);
44
	$template->assign('PowerLevels', $powerLevels);
45
46
	$template->display('weapon_list.php');
47
} catch (Throwable $e) {
48
	handleException($e);
49
}
50