Showing 52 of 52 total issues
Function readBigInt
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
function readBigInt($isCollectionElement = false) {
if ($isCollectionElement) {
$length = $this->readShort();
} else {
$length = 8;
- 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 getErrorData
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getErrorData() {
$stream = $this->dataStream;
$error = $stream->readInt();
$errorMessages = [
DataStream
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DataStream {
/**
* @var string
*/
Method readBigInt
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readBigInt($isCollectionElement = false) {
if ($isCollectionElement) {
$length = $this->readShort();
} else {
$length = 8;
Method readByType
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function readByType(array $type, $isCollectionElement = false) {
if ( $this->data === null ) {
return null;
}
Method __toString
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __toString() {
switch($this->type) {
case DataTypeEnum::CUSTOM:
case DataTypeEnum::BLOB:
return $this->getBlob();
Function query
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function query($cql, array $values = [], $consistency = ConsistencyEnum::CONSISTENCY_QUORUM) {
if ($this->batchQuery && in_array(substr($cql, 0, 6), ['INSERT', 'UPDATE', 'DELETE'])) {
$this->appendQueryToStack($cql, $values);
return true;
}
- 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 getMetadata
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getMetadata() {
$flags = $this->dataStream->readInt();
$columnCount = $this->dataStream->readInt();
$globalTableSpec = $flags & 0x0001;
if ($globalTableSpec) {
Method query
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function query($cql, array $values = [], $consistency = ConsistencyEnum::CONSISTENCY_QUORUM) {
if ($this->batchQuery && in_array(substr($cql, 0, 6), ['INSERT', 'UPDATE', 'DELETE'])) {
$this->appendQueryToStack($cql, $values);
return true;
}
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($version, $opcode, $body, $stream = 0, $flags = 0) {
Avoid too many return
statements within this method. Open
Open
return $this->readBoolean();
Avoid too many return
statements within this method. Open
Open
return $this->getInet();
Avoid too many return
statements within this method. Open
Open
return '';
Avoid too many return
statements within this method. Open
Open
return $this->readTimestamp();
Avoid too many return
statements within this method. Open
Open
return $this->getDecimal();
Avoid too many return
statements within this method. Open
Open
return $this->readList($type['value']);
Avoid too many return
statements within this method. Open
Open
return "Overloaded: {$stream->readString()}";
Avoid too many return
statements within this method. Open
Open
return $this->getMap();
Avoid too many return
statements within this method. Open
Open
return $this->getDouble();
Avoid too many return
statements within this method. Open
Open
return $this->readBytes($isCollectionElement);