Showing 8 of 18 total issues
Method getMenuItems
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getMenuItems()
{
$menuItems = NULL;
$menuItemPresets = [
'user' => [
Function actionDatabase
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function actionDatabase()
{
$config = Configuration::get();
$param = Configuration::getParam();
- 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 SettingController.php
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Created by PhpStorm.
* User: Abhimanyu
* Date: 18-02-2015
Method actionDatabase
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionDatabase()
{
$config = Configuration::get();
$param = Configuration::getParam();
Method actionMail
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionMail()
{
$model = new MailFormSetting();
$model->mailUseTransport = Yii::$app->config->get(Enum::MAILER_USE_TRANSPORT) === 'true' ? '1' : '0';
Function actionMail
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionMail()
{
$model = new MailFormSetting();
$model->mailUseTransport = Yii::$app->config->get(Enum::MAILER_USE_TRANSPORT) === 'true' ? '1' : '0';
- 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 actionContact
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function actionContact()
{
$model = new ContactForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
- 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 init
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
parent::init();
$session = \Yii::$app->getSession();
- 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"