Showing 6 of 14 total issues
Method actionAuthClient
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionAuthClient()
{
$model = new SettingsForm();
$model->googleClientId = Yii::$app->config->get(Enum::GOOGLE_CLIENT_ID);
$model->googleClientSecret = Yii::$app->config->get(Enum::GOOGLE_CLIENT_SECRET);
- Create a ticketCreate a ticket
Function actionAuthClient
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function actionAuthClient()
{
$model = new SettingsForm();
$model->googleClientId = Yii::$app->config->get(Enum::GOOGLE_CLIENT_ID);
$model->googleClientSecret = Yii::$app->config->get(Enum::GOOGLE_CLIENT_SECRET);
- Read upRead up
- Create a ticketCreate a ticket
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
User
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends ActiveRecord
{
/** User Status - Blocked/Inactive */
const STATUS_BLOCKED = 0;
/** User Status - Active */
- Create a ticketCreate a ticket
Function actionBlock
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function actionBlock($id)
{
if ($id == Yii::$app->user->getId()) {
Yii::$app->getSession()->setFlash('error', Yii::t('user', 'You can not block your own account'));
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 actionUploadAvatar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionUploadAvatar()
{
if (isset($_FILES['avatar'])) {
$avatar = $_FILES['avatar'];
$path = '../vendor/abhi1693/yii2-user/uploads/profile_image/';
- Read upRead up
- Create a ticketCreate a ticket
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 actionReset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function actionReset($id, $code)
{
$model = User::findOne([
'id' => $id,
'password_reset_token' => $code,
- Read upRead up
- Create a ticketCreate a ticket
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"