Showing 419 of 419 total issues
Function searchPosts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function searchPosts()
{
$query = Vocabulary::find()->select('post_id, thread_id')->joinWith(['posts.author', 'posts.thread'])->andWhere(['is not', 'post_id', null]);
if (Podium::getInstance()->user->isGuest) {
$query->joinWith(['posts.forum' => function ($q) {
- 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 activate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function activate()
{
if ($this->status == self::STATUS_REGISTERED) {
$transaction = static::getDb()->beginTransaction();
try {
- 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 updateIgnore
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function updateIgnore($member)
{
try {
if ($this->isIgnoredBy($member)) {
if (!Podium::getInstance()->db->createCommand()->delete('{{%podium_user_ignore}}', [
- 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 updateFriend
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function updateFriend($friend)
{
try {
if ($this->isBefriendedBy($friend)) {
if (!Podium::getInstance()->db->createCommand()->delete('{{%podium_user_friend}}', [
- 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 createInheritedAccount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function createInheritedAccount()
{
if (!Podium::getInstance()->user->isGuest) {
$transaction = static::getDb()->beginTransaction();
try {
- 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 compareVersions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function compareVersions($a, $b)
{
$versionPos = max(count($a), count($b));
while (count($a) < $versionPos) {
$a[] = 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 actionReport
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionReport($cid = null, $fid = null, $tid = null, $pid = null)
{
$post = Post::verify($cid, $fid, $tid, $pid);
if (empty($post)) {
$this->error(Yii::t('podium/flash', 'Sorry! We can not find the post you are looking for.'));
- 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 friendsList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function friendsList()
{
if (Podium::getInstance()->user->isGuest) {
return 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 getMembersList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getMembersList($query = null)
{
if (null === $query || !is_string($query)) {
return Json::encode(['results' => []]);
}
- 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 actionSettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionSettings()
{
$model = new ConfigForm();
$data = Yii::$app->request->post('ConfigForm');
if ($data) {
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$url = Yii::$app->request->getUrl();
$out = '';
- 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 run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$avatar = Html::img(Helper::defaultAvatar(), [
'class' => 'podium-avatar img-circle img-responsive center-block',
'alt' => Yii::t('podium/view', 'user deleted')
- 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 [
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
return $this->render('register', [
'model' => $model,
'terms' => Content::fill(Content::TERMS_AND_CONDS)]
);
Avoid too many return
statements within this method. Open
return $this->redirect(['forum/thread',
'cid' => $poll->thread->forum->category->id,
'fid' => $poll->thread->forum->id,
'id' => $poll->thread->id,
'slug' => $poll->thread->slug
Avoid too many return
statements within this method. Open
return Json::encode($data);
Avoid too many return
statements within this method. Open
return $this->render('editpoll', ['model' => $poll]);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return Json::encode($data);
Avoid too many return
statements within this method. Open
return Json::encode($data);