Showing 201 of 201 total issues
Method read
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read ()
{
try
{
$ch = curl_init();
Method sendMessage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendMessage ($data)
{
if ($this->use)
{
try
Function beforeSave
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function beforeSave ($insert)
{
if ($parent = parent::beforeSave($insert))
{
if ($this->isNewRecord)
- 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 actionLogout
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function actionLogout ()
{
if (Yii::$app->session->get('isTempUser'))
{
$originalUserId = Yii::$app->session->get('originalUserID');
- 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 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 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 initConsumer
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initConsumer ()
{
try
{
$records[ 'name' ] = $this->source;
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 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 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)
{
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 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';
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 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
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
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 export
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function export ()
{
$socket = stream_socket_client($this->_dsn, $errorNumber, $error, 30);