abhi1693/yii2-user

View on GitHub

Showing 8 of 14 total issues

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->linkedInClientId) && !empty($model->linkedInClientSecret)) {
                Yii::$app->config->set(Enum::LINKED_IN_AUTH, LinkedIn::className());
                Yii::$app->config->set(Enum::LINKED_IN_CLIENT_ID, $model->linkedInClientId);
                Yii::$app->config->set(Enum::LINKED_IN_CLIENT_SECRET, $model->linkedInClientSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 111..122
controllers/SettingsController.php on lines 124..135
controllers/SettingsController.php on lines 150..161
controllers/SettingsController.php on lines 164..175
controllers/SettingsController.php on lines 177..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->githubClientId) && !empty($model->githubClientSecret)) {
                Yii::$app->config->set(Enum::GITHUB_AUTH, GitHub::className());
                Yii::$app->config->set(Enum::GITHUB_CLIENT_ID, $model->githubClientId);
                Yii::$app->config->set(Enum::GITHUB_CLIENT_SECRET, $model->githubClientSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 111..122
controllers/SettingsController.php on lines 124..135
controllers/SettingsController.php on lines 137..148
controllers/SettingsController.php on lines 164..175
controllers/SettingsController.php on lines 177..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->facebookClientId) && !empty($model->facebookClientSecret)) {
                Yii::$app->config->set(Enum::FACEBOOK_AUTH, Facebook::className());
                Yii::$app->config->set(Enum::FACEBOOK_CLIENT_ID, $model->facebookClientId);
                Yii::$app->config->set(Enum::FACEBOOK_CLIENT_SECRET, $model->facebookClientSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 111..122
controllers/SettingsController.php on lines 137..148
controllers/SettingsController.php on lines 150..161
controllers/SettingsController.php on lines 164..175
controllers/SettingsController.php on lines 177..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->googleClientId) && !empty($model->googleClientSecret)) {
                Yii::$app->config->set(Enum::GOOGLE_AUTH, GoogleOAuth::className());
                Yii::$app->config->set(Enum::GOOGLE_CLIENT_ID, $model->googleClientId);
                Yii::$app->config->set(Enum::GOOGLE_CLIENT_SECRET, $model->googleClientSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 124..135
controllers/SettingsController.php on lines 137..148
controllers/SettingsController.php on lines 150..161
controllers/SettingsController.php on lines 164..175
controllers/SettingsController.php on lines 177..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->twitterConsumerKey) && !empty($model->twitterConsumerSecret)) {
                Yii::$app->config->set(Enum::TWITTER_AUTH, Twitter::className());
                Yii::$app->config->set(Enum::TWITTER_CONSUMER_KEY, $model->twitterConsumerKey);
                Yii::$app->config->set(Enum::TWITTER_CONSUMER_SECRET, $model->twitterConsumerSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 111..122
controllers/SettingsController.php on lines 124..135
controllers/SettingsController.php on lines 137..148
controllers/SettingsController.php on lines 150..161
controllers/SettingsController.php on lines 164..175

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 6 locations. Consider refactoring.
Open

            if (!empty($model->liveClientId) && !empty($model->liveClientSecret)) {
                Yii::$app->config->set(Enum::LIVE_AUTH, Live::className());
                Yii::$app->config->set(Enum::LIVE_CLIENT_ID, $model->liveClientId);
                Yii::$app->config->set(Enum::LIVE_CLIENT_SECRET, $model->liveClientSecret);

Severity: Major
Found in controllers/SettingsController.php and 5 other locations - About 6 hrs to fix
controllers/SettingsController.php on lines 111..122
controllers/SettingsController.php on lines 124..135
controllers/SettingsController.php on lines 137..148
controllers/SettingsController.php on lines 150..161
controllers/SettingsController.php on lines 177..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 223.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
Severity: Minor
Found in controllers/RecoveryController.php and 1 other location - About 55 mins to fix
controllers/RegistrationController.php on lines 28..48

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 99.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
Severity: Minor
Found in controllers/RegistrationController.php and 1 other location - About 55 mins to fix
controllers/RecoveryController.php on lines 21..41

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 99.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language