Showing 38 of 40 total issues
SteamId
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class SteamId extends XMLData {
use Cacheable;
/**
Function getServers
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getServers($regionCode = MasterServer::REGION_ALL , $filter = '', $force = false) {
$failCount = 0;
$finished = false;
$portNumber = 0;
$hostName = '0.0.0.0';
- 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
Function getReply
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getReply() {
$this->receivePacket(1400);
$isCompressed = false;
if($this->buffer->getLong() == -2) {
- 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
Function __toString
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function __toString() {
$returnString = '';
$returnString .= "Ping: {$this->ping}\n";
$returnString .= "Challenge number: {$this->challengeNumber}\n";
- 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
Function internalFetch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function internalFetch() {
$params = ['language' => $this->language];
$data = WebApi::getJSONData("IEconItems_{$this->appId}", 'GetSchema', 1, $params);
$this->attributes = [];
- 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 internalFetch
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function internalFetch() {
$params = ['language' => $this->language];
$data = WebApi::getJSONData("IEconItems_{$this->appId}", 'GetSchema', 1, $params);
$this->attributes = [];
Method __construct
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(GameInventory $inventory, $itemData) {
$this->inventory = $inventory;
$this->defindex = $itemData->defindex;
$this->backpackPosition = $itemData->inventory & 0xffff;
Method getServers
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getServers($regionCode = MasterServer::REGION_ALL , $filter = '', $force = false) {
$failCount = 0;
$finished = false;
$portNumber = 0;
$hostName = '0.0.0.0';
Method getReply
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getReply() {
$this->receivePacket(1400);
$isCompressed = false;
if($this->buffer->getLong() == -2) {
Function handleResponseForRequest
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function handleResponseForRequest($requestType, $repeatOnFailure = true) {
switch($requestType) {
case self::REQUEST_CHALLENGE:
$expectedResponse = '\SteamCondenser\Servers\Packets\S2CCHALLENGEPacket';
$requestPacket = new A2SPLAYERPacket();
- 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 handleResponseForRequest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleResponseForRequest($requestType, $repeatOnFailure = true) {
switch($requestType) {
case self::REQUEST_CHALLENGE:
$expectedResponse = '\SteamCondenser\Servers\Packets\S2CCHALLENGEPacket';
$requestPacket = new A2SPLAYERPacket();
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($data) {
parent::__construct(SteamPacket::S2A_INFO2_HEADER, $data);
$this->info['networkVersion'] = $this->contentData->getByte();
$this->info['serverName'] = $this->contentData->getString();
Function __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($data) {
parent::__construct(SteamPacket::S2A_INFO2_HEADER, $data);
$this->info['networkVersion'] = $this->contentData->getByte();
$this->info['serverName'] = $this->contentData->getString();
- 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
Function connect
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function connect($ipAddress, $portNumber, $timeout) {
$this->ipAddress = $ipAddress;
$this->portNumber = $portNumber;
if($this->socketsEnabled) {
- 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 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($data) {
parent::__construct(SteamPacket::S2A_INFO_DETAILED_HEADER, $data);
$this->info['serverIp'] = $this->contentData->getString();
$this->info['serverName'] = $this->contentData->getString();
Method __toString
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __toString() {
$returnString = '';
$returnString .= "Ping: {$this->ping}\n";
$returnString .= "Challenge number: {$this->challengeNumber}\n";
Method splitPlayerStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function splitPlayerStatus($attributes, $playerStatus) {
if($attributes[0] != 'userid') {
$playerStatus = preg_replace('/^\d+ +/', '', $playerStatus);
}
Function recv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function recv($length = 128) {
if($this->socketsEnabled) {
$data = socket_read($this->socket, $length);
if ($data === false) {
- 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
Function updatePlayers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updatePlayers($rconPassword = null) {
$this->handleResponseForRequest(self::REQUEST_PLAYER);
if(!$this->rconAuthenticated) {
if($rconPassword == null) {
- 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
Function getLeaderboard
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getLeaderboard($gameName, $id) {
$leaderboards = self::getLeaderboards($gameName);
if (is_int($id)) {
if (array_key_exists($id, $leaderboards)) {
- 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"