Showing 156 of 201 total issues
Function select
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function select ($models, $listOptions, $options = [])
{
$value = isset($listOptions[ 'value' ]) ? $listOptions[ 'value' ] : 'id';
$label = isset($listOptions[ 'label' ]) ? $listOptions[ 'label' ] : false;
$content = isset($listOptions[ 'data-content' ]) ? $listOptions[ 'data-content' ] : 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 size
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function size ($size, $unit = '')
{
if (is_numeric($size) and $size >= 0)
{
if (( !$unit && $size >= 1 << 30 ) || $unit == 'GB')
- 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 getStatus
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getStatus ()
{
if (!$this->_status)
{
$this->_status = self::S_UNKNOWN;
- 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 up
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up ()
{
$banner_use = '1';
$banner_api_url = 'http://revive/api/v2/xmlrpc/';
Method initConsumer
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initConsumer ()
{
try
{
$records[ 'name' ] = $this->source;
Method run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run ()
{
$fields = [ 'id', 'pid', 'channel', 'ttr', 'delay', 'priority', 'pushed_at', 'reserved_at', 'done_at', 'canceled_at' ];
$sort = Yii::$app->request->get('sort');
Method bootstrap
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function bootstrap ($app)
{
$app->setAliases([ '@pageViews' => __DIR__ . '/views' ]);
$app->setAliases([ '@vpsViews' => __DIR__ . '/../../views' ]);
$app->getUrlManager()->addRules([
Method actionLogout
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionLogout ()
{
if (Yii::$app->session->get('isTempUser'))
{
$originalUserId = Yii::$app->session->get('originalUserID');
Method actionAdd
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionAdd ()
{
$menu = new Menu();
$this->_tpl = '@menuViews/add';
Method actionView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionView ($id)
{
$export = Export::find()->where([ 'id' => $id ])->one();
if ($export === null)
{
Method checkEngine
has 36 lines of code (exceeds 25 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)
{
Function up
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function up ()
{
$this->createTable('auth_rule', [
'name' => $this->string(64)->notNull(),
'data' => $this->text()->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 export
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function export ()
{
if ($this->_use)
foreach ($this->messages as $message)
{
- 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 validatePath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validatePath ($attribute)
{
if (!$this->hasErrors())
{
if (!file_exists($this->$attribute))
- 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 export
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function export ()
{
$socket = stream_socket_client($this->_dsn, $errorNumber, $error, 30);
Method image
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function image ($path = null, $options = [])
{
/** @var boolean $fileLoaded - файл уже загружен */
$fileLoaded = ArrayHelper::remove($options, 'fileLoaded', false);
/** @var text $removeText - текст для кнопки "Remove" */
Method actionIndex
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex ()
{
$query = Export::find();
$provider = new ActiveDataProvider([
Method beforeAction
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function beforeAction ($action)
{
$user = $this->user;
$request = Yii::$app->getRequest();
Method execute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute ($queue)
{
if (Yii::$app->settings->get('log_ssl_use'))
{
$context = stream_context_create(
Method actionImage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionImage ()
{
$datapath = Yii::$app->settings->get('datapath');
$name = StringHelper::random();