Showing 59 of 59 total issues
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($player)
{
$this->steamId = $player->steamid;
$this->steamIds = (new Id((int)$this->steamId));
$this->communityVisibilityState = $player->communityvisibilitystate;
Function getLocation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function getLocation(): \stdClass
{
$countriesFile = json_decode(\file_get_contents(__DIR__ . '/../Resources/countries.json'), null, 512, JSON_THROW_ON_ERROR);
$result = new \stdClass;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($app)
{
$this->id = $app->steam_appid;
$this->type = $app->type;
Method GetPlayerAchievements
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function GetPlayerAchievements($appId): ?array
{
// Set up the api details
$this->interface = null;
$this->method = 'achievements';
Function GetPlayerAchievements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function GetPlayerAchievements($appId): ?array
{
// Set up the api details
$this->interface = null;
$this->method = 'achievements';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Scope keyword "static" must be followed by a single space Open
Open
public function get(): static
- Exclude checks
Method name "App::GetAppList" is not in camel caps format Open
Open
public function GetAppList()
- Exclude checks
Method name "Stats::GetPlayerAchievementsAPI" is not in camel caps format Open
Open
public function GetPlayerAchievementsAPI($appId): ?array
- Exclude checks
Visibility must be declared on method "__construct" Open
Open
function __construct(SimpleXMLElement $group)
- Exclude checks
Method name "User::GetFriendList" is not in camel caps format Open
Open
public function GetFriendList($relationship = 'all', $summaries = true): array
- Exclude checks
Method name "Stats::GetSchemaForGame" is not in camel caps format Open
Open
public function GetSchemaForGame($appId): mixed
- Exclude checks
Method name "User::ResolveVanityURL" is not in camel caps format Open
Open
public function ResolveVanityURL($displayName = null): mixed
- Exclude checks
Method name "News::GetNewsForApp" is not in camel caps format Open
Open
public function GetNewsForApp($appId, $count = 5, $maxLength = null)
- Exclude checks
Method name "Player::GetBadges" is not in camel caps format Open
Open
public function GetBadges()
- Exclude checks
Method name "Stats::GetGlobalAchievementPercentagesForApp" is not in camel caps format Open
Open
public function GetGlobalAchievementPercentagesForApp($gameId)
- Exclude checks
Method name "Stats::GetUserStatsForGame" is not in camel caps format Open
Open
public function GetUserStatsForGame(int $appId, bool $all = false): mixed
- Exclude checks
Method name "User::GetPlayerBans" is not in camel caps format Open
Open
public function GetPlayerBans($steamId = null)
- Exclude checks
Method name "Player::GetRecentlyPlayedGames" is not in camel caps format Open
Open
public function GetRecentlyPlayedGames($count = null): ?Collection
- Exclude checks
Visibility must be declared on method "__construct" Open
Open
function __construct($details)
- Exclude checks
Method name "Item::GetPlayerItems" is not in camel caps format Open
Open
public function GetPlayerItems($appId, $steamId): Inventory
- Exclude checks