Showing 6 of 6 total issues
Function send
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function send($recipients, $notifications)
{
if (!is_array($recipients)) {
/**
* @var $recipients NotifiableInterface[]
- 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 send
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send($recipients, $notifications)
{
if (!is_array($recipients)) {
/**
* @var $recipients NotifiableInterface[]
Method send
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send(NotifiableInterface $recipient, NotificationInterface $notification)
{
/** @var TelegramMessage $message */
$message = $notification->exportFor('telegram');
$text = $message->body;
Function detach
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function detach()
{
if ($this->owner) {
foreach ($this->notifications as $event => $notifications) {
if (!is_array($notifications)) {
- 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 shouldReceiveNotification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function shouldReceiveNotification(NotificationInterface $notification)
{
$alias = Inflector::camel2id(get_class($notification));
if (isset($this->notificationSettings)) {
$settings = $this->notificationSettings;
- 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 broadcastOn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function broadcastOn()
{
$channels = [];
$methods = get_class_methods($this);
foreach ($methods as $method) {
- 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"