Showing 223 of 419 total issues
Function actionPost
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function actionPost($cid = null, $fid = null, $tid = null, $pid = null)
{
$thread = Thread::find()->where([
'id' => $tid,
'category_id' => $cid,
- 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 podiumMovePostsTo
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function podiumMovePostsTo($target = null, $posts = [], $name = null, $forum = null)
{
$transaction = static::getDb()->beginTransaction();
try {
if ($target == 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
File Installation.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\maintenance;
use bizley\podium\models\Content;
Function init
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
parent::init();
try {
if (!empty($this->module->accessChecker)) {
- 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 actionThumb
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionThumb()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}
Method markSeen
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function markSeen($updateCounters = true)
{
if (!Podium::getInstance()->user->isGuest) {
$transaction = static::getDb()->beginTransaction();
try {
Method podiumMovePostsTo
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumMovePostsTo($target = null, $posts = [], $name = null, $forum = null)
{
$transaction = static::getDb()->beginTransaction();
try {
if ($target == 0) {
Function export
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function export()
{
$tableName = Podium::getInstance()->db->quoteTableName($this->logTable);
$sql = "INSERT INTO $tableName ([[level]], [[category]], [[log_time]], [[ip]], [[message]], [[model]], [[user]])
VALUES (:level, :category, :log_time, :ip, :message, :model, :user)";
- 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 prepareQuery
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareQuery($query, $topics = false)
{
$field = $topics
? Thread::tableName() . '.created_at'
: Post::tableName() . '.updated_at';
- 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 actionDetails
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function actionDetails()
{
$model = User::findMe();
if (empty($model)) {
return $this->redirect(['account/login']);
- 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 podiumEdit
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function podiumEdit()
{
$transaction = static::getDb()->beginTransaction();
try {
if (!$this->save()) {
- 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 actionMove
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function actionMove($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
Method search
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($params)
{
$subquery = (new Query())
->select(['m2.replyto'])
->from(['m1' => Message::tableName()])
File SchemaOperation.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\maintenance;
use bizley\podium\Podium;
Function getDescription
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getDescription()
{
$description = Yii::t('podium/view', 'No New Posts');
$append = 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 notify
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function notify($thread)
{
if (is_numeric($thread) && $thread > 0) {
$forum = Podium::getInstance()->podiumConfig->get('name');
$email = Content::fill(Content::EMAIL_SUBSCRIPTION);
- 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 actionLoad
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function actionLoad()
{
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
Function actionPoll
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function actionPoll()
{
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
Method behaviors
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
Method actionNew
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionNew($user = null)
{
$podiumUser = User::findMe();
if (Message::tooMany($podiumUser->id)) {