bizley/yii2-podium

View on GitHub

Showing 419 of 419 total issues

The method podiumThumb() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
Open

public function podiumThumb($up = true, $count = 0)
{
$transaction = static::getDb()->beginTransaction();
try {
$loggedId = User::loggedId();
Severity: Minor
Found in src/models/Post.php by phpmd

The method export() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
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)";
Severity: Minor
Found in src/log/DbTarget.php by phpmd

The method getDescription() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

public function getDescription()
{
$description = Yii::t('podium/view', 'No New Posts');
$append = false;
 
Severity: Minor
Found in src/models/Thread.php by phpmd

The method actionAdvancedSearch() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

public function actionAdvancedSearch()
{
$dataProvider = null;
$list = [];
 
Severity: Minor
Found in src/controllers/ForumController.php by phpmd

The method updateModeratorForMany() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Open

public function updateModeratorForMany($newForums = [], $oldForums = [])
{
$transaction = static::getDb()->beginTransaction();
try {
$add = [];
Severity: Minor
Found in src/models/User.php by phpmd

Avoid using bizley\podium\helpers\count() function in while loops.
Open

while (count($b) < $versionPos) {
$b[] = 0;
}
Severity: Minor
Found in src/helpers/Helper.php by phpmd

Avoid using bizley\podium\helpers\count() function in for loops.
Open

for ($v = 0; $v < count($a); $v++) {
if ((int)$a[$v] < (int)$b[$v]) {
return '<';
}
if ((int)$a[$v] > (int)$b[$v]) {
Severity: Minor
Found in src/helpers/Helper.php by phpmd

The method init() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
Open

public function init()
{
parent::init();
try {
if (!empty($this->module->accessChecker)) {
Severity: Minor
Found in src/controllers/BaseController.php by phpmd

The method actionThumb() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Open

public function actionThumb()
{
if (!Yii::$app->request->isAjax) {
return $this->redirect(['forum/index']);
}

The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.
Open

for (var i in buttons) {

The variable $user_id is not named in camelCase.
Open

public function isIgnoring($user_id)
{
if ((new Query)->select('id')->from('{{%podium_user_ignore}}')->where([
'user_id' => $this->id,
'ignored_id' => $user_id
Severity: Minor
Found in src/models/User.php by phpmd

The variable $mod_id is not named in camelCase.
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) {
Severity: Minor
Found in src/controllers/AdminController.php by phpmd

The variable $timezone_identifiers is not named in camelCase.
Open

public static function timeZones()
{
$timeZones = [];
 
$timezone_identifiers = DateTimeZone::listIdentifiers();
Severity: Minor
Found in src/helpers/Helper.php by phpmd

The variable $password_hash is not named in camelCase.
Open

public function validatePassword($password)
{
$podium = Podium::getInstance();
if ($podium->userComponent !== true) {
$password_hash = empty($podium->userPasswordField) ? 'password_hash' : $podium->userPasswordField;
Severity: Minor
Found in src/models/db/UserActiveRecord.php by phpmd

The variable $previous_new_email is not named in camelCase.
Open

public function actionDetails()
{
$model = User::findMe();
if (empty($model)) {
return $this->redirect(['account/login']);
Severity: Minor
Found in src/controllers/ProfileController.php by phpmd

The variable $mod_id is not named in camelCase.
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) {
Severity: Minor
Found in src/controllers/AdminController.php by phpmd

The variable $timezone_identifiers is not named in camelCase.
Open

public static function timeZones()
{
$timeZones = [];
 
$timezone_identifiers = DateTimeZone::listIdentifiers();
Severity: Minor
Found in src/helpers/Helper.php by phpmd

The variable $previous_new_email is not named in camelCase.
Open

public function actionDetails()
{
$model = User::findMe();
if (empty($model)) {
return $this->redirect(['account/login']);
Severity: Minor
Found in src/controllers/ProfileController.php by phpmd

The variable $timezone_identifiers is not named in camelCase.
Open

public static function timeZones()
{
$timeZones = [];
 
$timezone_identifiers = DateTimeZone::listIdentifiers();
Severity: Minor
Found in src/helpers/Helper.php by phpmd
Severity
Category
Status
Source
Language