hyper-tuner/hyper-tuner-cloud

View on GitHub
src/pages/auth/notifications.ts

Summary

Maintainability
B
5 hrs
Test Coverage

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

const resetFailed = (err: Error) => {
  notification.error({
    message: 'Password reset failed',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const logInFailed = (err: Error) => {
  notification.error({
    message: 'Failed to log in',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const databaseGenericError = (err: Error) => {
  notification.error({
    message: 'Database Error',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const iniLoadingError = (err: Error) => {
  notification.error({
    message: 'INI not found',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158

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 48.

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 9 locations. Consider refactoring.
Open

const passwordUpdateFailed = (err: Error) => {
  notification.error({
    message: 'Unable to change your password',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const signUpFailed = (err: Error) => {
  notification.error({
    message: 'Failed to create an account',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const sendingEmailVerificationFailed = (err: Error) => {
  notification.success({
    message: 'Sending verification email failed',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const emailVerificationFailed = (err: Error) => {
  notification.error({
    message: 'Email verification failed',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 128..134
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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 9 locations. Consider refactoring.
Open

const profileUpdateFailed = (err: Error) => {
  notification.error({
    message: 'Unable to update your profile',
    description: err.message,
    ...baseOptions,
Severity: Major
Found in src/pages/auth/notifications.ts and 8 other locations - About 40 mins to fix
src/pages/auth/notifications.ts on lines 34..40
src/pages/auth/notifications.ts on lines 49..55
src/pages/auth/notifications.ts on lines 80..86
src/pages/auth/notifications.ts on lines 88..94
src/pages/auth/notifications.ts on lines 104..110
src/pages/auth/notifications.ts on lines 144..150
src/pages/auth/notifications.ts on lines 152..158
src/pages/auth/notifications.ts on lines 160..166

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 48.

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

There are no issues that match your filters.

Category
Status