Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is
duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
29
$this->stdout(Yii::t('yii2mod.user', 'User is not found.') . "\n", Console::FG_RED);
30
} else {
31
if ($user->delete()) {
32
$this->stdout(Yii::t('yii2mod.user', 'User has been deleted.') . "\n", Console::FG_GREEN);
33
} else {
34
$this->stdout(Yii::t('yii2mod.user', 'Error occurred while deleting user.') . "\n", Console::FG_RED);
The constant yii\console\Controller::EXIT_CODE_NORMAL has been deprecated with message: since 2.0.13. Use [[ExitCode::OK]] instead.
This class constant has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the constant will be
removed from the class and what other constant to use instead.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.