Showing 223 of 419 total issues
Function send
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function send()
{
$transaction = static::getDb()->beginTransaction();
try {
$this->sender_id = 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
Function actionDeleteposts
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function actionDeleteposts($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 podiumDeletePosts
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function podiumDeletePosts($posts)
{
$transaction = static::getDb()->beginTransaction();
try {
foreach ($posts as $post) {
- 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 maintenanceCheck
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function maintenanceCheck($action, $warnings)
{
if ($this->module->podiumConfig->get('maintenance_mode') != '1') {
return 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 actionNewThread
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function actionNewThread($cid = null, $fid = null)
{
if (!User::can(Rbac::PERM_CREATE_THREAD)) {
$this->error(Yii::t('podium/flash', 'Sorry! You do not have the required permission to perform this action.'));
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 process
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process($email, $fromName, $fromEmail, $maxAttempts)
{
try {
if ($this->send($email, $fromName, $fromEmail)) {
$this
Method send
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send()
{
$transaction = static::getDb()->beginTransaction();
try {
$this->sender_id = User::loggedId();
Method actionSortCategory
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionSortCategory()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['admin/categories']);
}
Method actionMods
has 37 lines of code (exceeds 25 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) {
Method lastActive
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function lastActive()
{
$last = Podium::getInstance()->podiumCache->get('forum.lastactive');
if ($last === false) {
$time = time() - 15 * 60;
Method podiumEdit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function podiumEdit()
{
$transaction = static::getDb()->beginTransaction();
try {
if (!$this->save()) {
Method init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
parent::init();
try {
if (!empty($this->module->accessChecker)) {
Method addAdmin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addAdmin()
{
if ($this->module->userComponent !== true) {
return $this->addInheritedAdmin();
}
Method run
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$url = Yii::$app->request->getUrl();
$out = '';
Function podiumDelete
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function podiumDelete()
{
$transaction = static::getDb()->beginTransaction();
try {
if (!$this->delete()) {
- 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 set
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function set($name, $value)
{
try {
if (is_string($name) && (is_string($value) || $value === null)) {
if ($value === 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 actionEditpoll
has a Cognitive Complexity of 12 (exceeds 5 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,
- 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 tooMany
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function tooMany($userId)
{
$sessionKey = 'messages.' . $userId;
if (Yii::$app->session->has($sessionKey)) {
$sentAlready = explode('|', Yii::$app->session->get($sessionKey));
- 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 matchRole
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function matchRole($user)
{
if (empty($this->roles)) {
return true;
}
- 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 upgradeCheck
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function upgradeCheck($warnings)
{
if (!User::can(Rbac::ROLE_ADMIN)) {
return 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"