Showing 156 of 201 total issues
Function add
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private static function add ($message, $type, $isRaw, $category = 'admin')
{
if (Yii::$app->settings->get('log_use'))
{
if (Yii::$app->settings->get('log_clean_mb4_chars')) {
- 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 sendMessage
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function sendMessage ($data)
{
if (Yii::$app->settings->get('kafka_use'))
{
- 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 getInfo
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function getInfo ($name)
{
if (RemoteFileHelper::exists(BASE_PATH . '/../' . $name))
{
- 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 successAuth
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function successAuth ($client)
{
if (method_exists($client, 'successAuth'))
{
$user = $client->successAuth();
- 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 printActions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function printActions ($controllerlist)
{
asort($controllerlist);
foreach ($controllerlist as $controller)
{
- 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 actionIndex
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex ()
{
$get = Yii::$app->request->get();
$query = Log::find();
Function checkEngine
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function checkEngine (string $name = 'InnoDB', bool $default = true, bool $exception = true)
{
$engines = $this->db->createCommand("SHOW ENGINES")->queryAll();
foreach ($engines as $engine)
{
- 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 UserController.php
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace vps\tools\modules\user\controllers;
use app\base\Controller;
Function savePage
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private function savePage ($model)
{
$r = Yii::$app->request;
if ($r->isPost and $model->load($r->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
Method run
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run ()
{
$userClass = Yii::$app->getModule('users')->modelUser;
$query = $userClass::find()->select("user.*,(SELECT GROUP_CONCAT(item_name) from `auth_assignment` where `user`.`id`=`auth_assignment`.`user_id`) as rolesNames")->leftJoin('auth_assignment', '`auth_assignment`.`user_id` = `user`.`id`');
File FileHelper.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace vps\tools\helpers;
use yii\base\UnknownMethodException;
Method up
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up ()
{
$this->createTable('auth_rule', [
'name' => $this->string(64)->notNull(),
'data' => $this->text()->null(),
Method actionGenerateXls
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionGenerateXls ($id)
{
$export = Export::find()->where([ 'id' => $id ])->one();
if ($export === null)
{
Method actionView
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionView ($id)
{
$this->_tpl = '@userViews/index';
$userClass = $this->module->modelUser;
$user = $userClass::findOne($id);
Method sendMessage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendMessage ($data)
{
if (Yii::$app->settings->get('kafka_use'))
{
Method bootstrap
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bootstrap ($app)
{
$app->setAliases([ '@userViews' => __DIR__ . '/views/user' ]);
$app->setAliases([ '@rbacViews' => __DIR__ . '/views/rbac' ]);
$app->getUrlManager()->addRules([
Method successAuth
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function successAuth ($client)
{
if (method_exists($client, 'successAuth'))
{
$user = $client->successAuth();
Method add
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function add ($message, $type, $isRaw, $category = 'admin')
{
if (Yii::$app->settings->get('log_use'))
{
if (Yii::$app->settings->get('log_clean_mb4_chars')) {
Function hasPermission
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function hasPermission ($permission = null, $and = false)
{
if (Yii::$app->user->can(User::R_ADMIN))
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
File ExportController.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Evgenii Kuteiko <kuteiko@mail.ru>
* @author Anna Manaenkova <anna.manaenkova@phystech.edu>