syntaxerrors/Steam

View on GitHub

Showing 59 of 59 total issues

Method __construct has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct($player)
    {
        $this->steamId                  = $player->steamid;
        $this->steamIds                 = (new Id((int)$this->steamId));
        $this->communityVisibilityState = $player->communityvisibilitystate;
Severity: Minor
Found in src/Syntax/SteamApi/Containers/Player.php - About 1 hr to fix

    Function getLocation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getLocation(): \stdClass
        {
            $countriesFile = json_decode(\file_get_contents(__DIR__ . '/../Resources/countries.json'), null, 512, JSON_THROW_ON_ERROR);
            $result        = new \stdClass;
    
    
    Severity: Minor
    Found in src/Syntax/SteamApi/Containers/Player.php - About 1 hr to fix

    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

        public function __construct($app)
        {
    
            $this->id                 = $app->steam_appid;
            $this->type               = $app->type;
    Severity: Minor
    Found in src/Syntax/SteamApi/Containers/App.php - About 1 hr to fix

      Method GetPlayerAchievements has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function GetPlayerAchievements($appId): ?array
          {
              // Set up the api details
              $this->interface = null;
              $this->method    = 'achievements';
      Severity: Minor
      Found in src/Syntax/SteamApi/Steam/User/Stats.php - About 1 hr to fix

        Function GetPlayerAchievements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function GetPlayerAchievements($appId): ?array
            {
                // Set up the api details
                $this->interface = null;
                $this->method    = 'achievements';
        Severity: Minor
        Found in src/Syntax/SteamApi/Steam/User/Stats.php - About 45 mins to fix

        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

            public function get(): static

        Method name "App::GetAppList" is not in camel caps format
        Open

            public function GetAppList()

        Method name "Stats::GetPlayerAchievementsAPI" is not in camel caps format
        Open

            public function GetPlayerAchievementsAPI($appId): ?array

        Visibility must be declared on method "__construct"
        Open

            function __construct(SimpleXMLElement $group)

        Method name "User::GetFriendList" is not in camel caps format
        Open

            public function GetFriendList($relationship = 'all', $summaries = true): array

        Method name "Stats::GetSchemaForGame" is not in camel caps format
        Open

            public function GetSchemaForGame($appId): mixed

        Method name "User::ResolveVanityURL" is not in camel caps format
        Open

            public function ResolveVanityURL($displayName = null): mixed

        Method name "News::GetNewsForApp" is not in camel caps format
        Open

            public function GetNewsForApp($appId, $count = 5, $maxLength = null)

        Method name "Player::GetBadges" is not in camel caps format
        Open

            public function GetBadges()

        Method name "Stats::GetGlobalAchievementPercentagesForApp" is not in camel caps format
        Open

            public function GetGlobalAchievementPercentagesForApp($gameId)

        Method name "Stats::GetUserStatsForGame" is not in camel caps format
        Open

            public function GetUserStatsForGame(int $appId, bool $all = false): mixed

        Method name "User::GetPlayerBans" is not in camel caps format
        Open

            public function GetPlayerBans($steamId = null)

        Method name "Player::GetRecentlyPlayedGames" is not in camel caps format
        Open

            public function GetRecentlyPlayedGames($count = null): ?Collection

        Visibility must be declared on method "__construct"
        Open

            function __construct($details)

        Method name "Item::GetPlayerItems" is not in camel caps format
        Open

            public function GetPlayerItems($appId, $steamId): Inventory
        Severity
        Category
        Status
        Source
        Language