rimiti/cosium-js-sdk

View on GitHub

Showing 16 of 16 total issues

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

    return this.validateCreateAppointment(params)
      .then(() => fetch(this.url + this.routes.createAppointment, options))
      .then(response => this.httpStatus(response))
      .then(response => this.errorCode(response))
Severity: Major
Found in src/class/index.js and 2 other locations - About 2 hrs to fix
src/class/index.js on lines 29..32
src/class/index.js on lines 82..85

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

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

    return this.validateGetAvailableTimeslots(params)
      .then(() => fetch(this.url + this.routes.availableTimeslots, options))
      .then(response => this.httpStatus(response))
      .then(response => this.errorCode(response))
Severity: Major
Found in src/class/index.js and 2 other locations - About 2 hrs to fix
src/class/index.js on lines 61..64
src/class/index.js on lines 82..85

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

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

    return this.validateCancelAppointment(params)
      .then(() => fetch(this.url + this.routes.cancelAppointment, options))
      .then(response => this.httpStatus(response))
      .then(response => this.errorCode(response))
Severity: Major
Found in src/class/index.js and 2 other locations - About 2 hrs to fix
src/class/index.js on lines 29..32
src/class/index.js on lines 61..64

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

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

export default class MissingParameter extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/configuration/missing_parameter.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class WrongDatetimeValues extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/wrong_datetime_values.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class UnavailableSlot extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/unavailable_slot.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class MissingMandatoryParameter extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/missing_mandatory_parameter.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class ConfigurationWrongCredentials extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/configuration/wrong_credentials.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class UnknownCategoryCode extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/unknown_category_code.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class InvalidDatetimeFormat extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/invalid_datetime_format.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class BookingNotFound extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/booking_not_found.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class UnknownError extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/unknow_error.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class NotAuthorized extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/authentication/not_authorized.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class ConfigurationWrongFormat extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/configuration/wrong_format.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10

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

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

export default class BadRequest extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/bad_request.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/api/wrong_datetimes.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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

export default class WrongDatetimes extends Exception {

  constructor(message) {
    super()
    this.name = this.constructor.name
Severity: Major
Found in src/class/exceptions/api/wrong_datetimes.js and 12 other locations - About 1 hr to fix
src/class/exceptions/api/bad_request.js on lines 3..10
src/class/exceptions/api/booking_not_found.js on lines 3..11
src/class/exceptions/api/invalid_datetime_format.js on lines 3..11
src/class/exceptions/api/missing_mandatory_parameter.js on lines 3..11
src/class/exceptions/api/unavailable_slot.js on lines 3..11
src/class/exceptions/api/unknow_error.js on lines 3..11
src/class/exceptions/api/unknown_category_code.js on lines 3..11
src/class/exceptions/api/wrong_datetime_values.js on lines 3..11
src/class/exceptions/authentication/not_authorized.js on lines 3..10
src/class/exceptions/configuration/missing_parameter.js on lines 3..10
src/class/exceptions/configuration/wrong_credentials.js on lines 3..10
src/class/exceptions/configuration/wrong_format.js on lines 3..11

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

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