Showing 156 of 201 total issues
Function equal
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function equal ($array, $strict = false)
{
if (is_array($array))
{
if ($strict)
- 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 actionSendElk
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionSendElk ()
{
$logs = Log::find()->orderBy([ 'dt' => SORT_ASC ])->all();
if (Yii::$app->settings->get('log_ssl_use'))
{
Function printTable
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function printTable ($data, $headers = [])
{
// Count max length for every column.
$lengths = [];
- 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 safeUp
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeUp ()
{
$settingModel = 'setting';
if (Yii::$app->has('settings') and Yii::$app->settings->hasMethod('getTableName'))
$settingModel = Yii::$app->settings->getTableName();
Method search
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search ($params)
{
$this->load($params);
if (!empty($this->status))
Method init
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init ()
{
$access = ( !is_null(Yii::$app->getModule('users')) and Yii::$app->getModule('users')->useAccessControl );
$rules = [
[
Method rules
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rules ()
{
switch ($this->type)
{
case 'command':
Method getGridView
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getGridView ($searchModel, $dataProvider)
{
return GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
Function filterConfig
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function filterConfig ($config)
{
$setNullComponents = false;
// Remove unnecessary components for migrations.
- 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 actionIndex
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex ()
{
$get = Yii::$app->request->get();
$query = Log::find();
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
public function sendMessage ($data)
{
if ($this->use)
{
try
- 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 authOAuth2
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function authOAuth2 ($client, $authUrlParams = [])
{
$get = Yii::$app->request->get();
if (isset($get[ 'error' ]))
{
Function rules
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function rules ()
{
switch ($this->type)
{
case 'command':
- 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 authOAuth2
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function authOAuth2 ($client, $authUrlParams = [])
{
$get = Yii::$app->request->get();
if (isset($get[ 'error' ]))
{
- 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 behaviors
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function behaviors ()
{
return [
'access' => [
'class' => AccessControl::className(),
Method safeUp
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeUp ()
{
$settings = [
'footer_copyright_from' => [
'value' => 2018,
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 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 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"