Showing 68 of 77 total issues
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($message, $code, string $propertyPath = null, $value = null, array $constraints = [])
Function isValid
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isValid(string $hashtag): bool
{
$hashtag = ltrim($hashtag, '#');
if (empty($hashtag)) {
return 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 doMarshal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function doMarshal(Message $message): array
{
$schema = $message::schema();
$message->validate();
$payload = [];
- 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 getSupportedMessages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getSupportedMessages(Field $field): array
{
if (!$field->hasAnyOfCuries()) {
return MessageResolver::all();
}
- 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 applyNumericOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function applyNumericOptions(?int $min = null, ?int $max = null, int $precision = 10, int $scale = 2): void
{
if (null !== $max) {
$this->max = $max;
}
- 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 doSerialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function doSerialize(Message $message): array
{
$schema = $message::schema();
$message->validate();
$payload = [];
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $properties;
Avoid too many return
statements within this method. Open
return [self::TYPE_BINARY => $value];
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->default;
Avoid too many return
statements within this method. Open
return 'true';
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->withAnalyzer(self::TYPES['text'], $field);
Avoid too many return
statements within this method. Open
return (string)$var;
Avoid too many return
statements within this method. Open
return $default;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return ['NULL' => true];
Avoid too many return
statements within this method. Open
return false;