Showing 419 of 419 total issues
Avoid too many return
statements within this method. Open
Open
return $this->render('deletepoll', ['model' => $poll]);
Avoid too many return
statements within this method. Open
Open
return Json::encode($data);
Avoid too many return
statements within this method. Open
Open
return [
false,
Yii::t('podium/flash', 'The account activation link has been sent to your e-mail address.'),
true
];
Avoid too many return
statements within this method. Open
Open
return Json::encode($data);
Avoid too many return
statements within this method. Open
Open
return $this->render('register', [
'model' => $model,
'terms' => Content::fill(Content::TERMS_AND_CONDS)]
);
Avoid too many return
statements within this method. Open
Open
return $this->render('editpoll', ['model' => $poll]);
Avoid too many return
statements within this method. Open
Open
return $this->redirect(['members/view', 'id' => $model->id, 'slug' => $model->podiumSlug]);
Avoid too many return
statements within this method. Open
Open
return $this->render('deletepost', ['model' => $post]);
Avoid too many return
statements within this method. Open
Open
return $this->render('post', [
'replyFor' => $replyFor,
'preview' => $preview,
'model' => $model,
'thread' => $thread,
The method search has a boolean flag argument $onlyVisible, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function search($categoryId = null, $onlyVisible = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid too many return
statements within this method. Open
Open
return $this->redirect([
'forum/thread',
'cid' => $post->forum->category->id,
'fid' => $post->forum->id,
'id' => $post->thread->id,
Avoid too many return
statements within this method. Open
Open
return $this->render('edit', [
'preview' => $preview,
'model' => $post,
'isFirstPost' => $isFirstPost
]);
Avoid too many return
statements within this method. Open
Open
return $this->redirect(['admin/members']);
Avoid too many return
statements within this method. Open
Open
return $this->render('moveposts', [
'model' => $thread,
'list' => $list,
'options' => $options,
'listforum' => $listforum,
Avoid too many return
statements within this method. Open
Open
return Json::encode($data);
Avoid too many return
statements within this method. Open
Open
return Html::tag('span',
Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
. ' ' . Yii::t('podium/view', "Sorry! We can not save new categories' order."),
['class' => 'text-danger']
);
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return $this->render('report', ['model' => $model, 'post' => $post]);
Avoid too many return
statements within this method. Open
Open
return Html::tag('span',
Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok-circle'])
. ' ' . Yii::t('podium/view', "New forums' order has been saved."),
['class' => 'text-success']
);
Avoid too many return
statements within this method. Open
Open
return $this->render('deleteposts', [
'model' => $thread,
'dataProvider' => (new Post())->search($thread->forum->id, $thread->id)
]);