Showing 223 of 419 total issues
Method search
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($params)
{
$subquery = (new Query())
->select(['m2.replyto'])
->from(['m1' => Message::tableName()])
Method podiumNew
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumNew()
{
$transaction = static::getDb()->beginTransaction();
try {
if (!$this->save()) {
Method actionPost
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionPost($cid = null, $fid = null, $tid = null, $pid = null)
{
$thread = Thread::find()->where([
'id' => $tid,
'category_id' => $cid,
Function podiumNew
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function podiumNew($previous = null)
{
$transaction = static::getDb()->beginTransaction();
try {
$id = 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
SchemaOperation
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SchemaOperation extends Component
{
const TYPE_SUCCESS = 0;
const TYPE_WARNING = 1;
const TYPE_ERROR = 2;
Method podiumNew
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumNew($previous = null)
{
$transaction = static::getDb()->beginTransaction();
try {
$id = null;
Function actionMods
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function actionMods($id = null)
{
$mod = null;
$moderators = User::find()->where(['role' => User::ROLE_MODERATOR])->indexBy('id')->all();
if (is_numeric($id) && $id > 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
Method actionEditpoll
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionEditpoll($cid = null, $fid = null, $tid = null, $pid = null)
{
$poll = Poll::find()->joinWith('thread')->where([
Poll::tableName() . '.id' => $pid,
Poll::tableName() . '.thread_id' => $tid,
Method actionMove
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionMove($cid = null, $fid = null, $id = null, $slug = null)
{
$thread = (new ThreadVerifier([
'categoryId' => $cid,
'forumId' => $fid,
Method behaviors
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
Method remove
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function remove()
{
$transaction = static::getDb()->beginTransaction();
try {
$clearCache = false;
Function actionEdit
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function actionEdit($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 actionDeletepost
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function actionDeletepost($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 getIcon
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getIcon()
{
$icon = self::ICON_NO_NEW;
$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
File ProfileController.php
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace bizley\podium\controllers;
use bizley\podium\filters\AccessControl;
Method podiumThumb
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumThumb($up = true, $count = 0)
{
$transaction = static::getDb()->beginTransaction();
try {
$loggedId = User::loggedId();
Method actionAdvancedSearch
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionAdvancedSearch()
{
$dataProvider = null;
$list = [];
Method actionForum
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionForum()
{
$user = User::findMe();
$model = Meta::find()->where(['user_id' => $user->id])->limit(1)->one();
if (empty($model)) {
Method podiumReport
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumReport($post = null)
{
try {
if (empty($post)) {
throw new Exception('Reported post missing');
Method actionEdit
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionEdit($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.'));