Showing 223 of 419 total issues
Function markSeen
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
public function markSeen($updateCounters = true)
{
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
File User.php
has 625 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\models;
use bizley\podium\db\Query;
Function actionMoveposts
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
public function actionMoveposts($cid = null, $fid = null, $id = null, $slug = null)
{
$thread = (new ThreadVerifier([
'categoryId' => $cid,
'forumId' => $fid,
- 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 actionForum
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
public function actionForum()
{
$user = User::findMe();
$model = Meta::find()->where(['user_id' => $user->id])->limit(1)->one();
if (empty($model)) {
- 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
File ForumController.php
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\controllers;
use bizley\podium\db\Query;
Method add
has 207 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function add(DbManager $authManager)
{
$viewThread = $authManager->getPermission(self::PERM_VIEW_THREAD);
if (!($viewThread instanceof Permission)) {
$viewThread = $authManager->createPermission(self::PERM_VIEW_THREAD);
File Thread.php
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\models;
use bizley\podium\log\Log;
Function actionNew
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function actionNew($user = null)
{
$podiumUser = User::findMe();
if (Message::tooMany($podiumUser->id)) {
- 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
File ForumPostController.php
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\controllers;
use bizley\podium\filters\AccessControl;
File Post.php
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\models;
use bizley\podium\db\Query;
Function actionAdvancedSearch
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function actionAdvancedSearch()
{
$dataProvider = null;
$list = [];
- 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
User
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends UserActiveRecord
{
/**
* Roles.
*/
Function podiumThumb
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function podiumThumb($up = true, $count = 0)
{
$transaction = static::getDb()->beginTransaction();
try {
$loggedId = User::loggedId();
- 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
UserActiveRecord
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class UserActiveRecord extends ActiveRecord implements IdentityInterface
{
/**
* Statuses.
*/
Function add
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function add(DbManager $authManager)
{
$viewThread = $authManager->getPermission(self::PERM_VIEW_THREAD);
if (!($viewThread instanceof Permission)) {
$viewThread = $authManager->createPermission(self::PERM_VIEW_THREAD);
- 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 actionMoveposts
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionMoveposts($cid = null, $fid = null, $id = null, $slug = null)
{
$thread = (new ThreadVerifier([
'categoryId' => $cid,
'forumId' => $fid,
Method actionPoll
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionPoll()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}
Function actionThumb
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function actionThumb()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}
- 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
File AdminForumController.php
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\controllers;
use bizley\podium\filters\AccessControl;
Function remove
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function remove()
{
$transaction = static::getDb()->beginTransaction();
try {
$clearCache = 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"