rimiti/keldoc-js-sdk

View on GitHub

Showing 20 of 35 total issues

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

  postRequest(url: string, body: any): Promise<any> {
    return new Promise((resolve, reject) => {
      this.generateHeader();
      axios.post(this.configuration.host + url, body)
        .then((response: {}) => resolve(response))
Severity: Major
Found in src/classes/common.js and 1 other location - About 4 hrs to fix
src/classes/common.js on lines 95..102

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

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

  putRequest(url: string, body: any): Promise<any> {
    return new Promise((resolve, reject) => {
      this.generateHeader();
      axios.put(this.configuration.host + url, body)
        .then((response: {}) => resolve(response))
Severity: Major
Found in src/classes/common.js and 1 other location - About 4 hrs to fix
src/classes/common.js on lines 80..87

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

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

export default class AvailableSlots extends Common {
  /**
   * @description Get availabilities.
   * @param params
   * @return {Promise.<any>}
Severity: Major
Found in src/classes/resources/available_slots/index.js and 1 other location - About 3 hrs to fix
src/classes/resources/availabilities/index.js on lines 6..17

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

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

export default class Availabilities extends Common {
  /**
   * @description Get availabilities.
   * @param params
   * @return {Promise.<any>}
Severity: Major
Found in src/classes/resources/availabilities/index.js and 1 other location - About 3 hrs to fix
src/classes/resources/available_slots/index.js on lines 6..17

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

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

  create(body: { url: string }): Promise<any> {
    const url = `${this.configuration.routes.configWebhooks}`;
    return Validation.validateCreateWebhook(body)
      .then(() => super.postRequest(url, body));
  }
Severity: Major
Found in src/classes/resources/config/webhooks/index.js and 1 other location - About 3 hrs to fix
src/classes/resources/appointments/index.js on lines 11..15

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

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

  create(body: { start_at: string }): Promise<any> {
    const url = `${this.configuration.routes.appointments}`;
    return Validation.validateCreateAppointment(body)
      .then(() => super.postRequest(url, body));
  }
Severity: Major
Found in src/classes/resources/appointments/index.js and 1 other location - About 3 hrs to fix
src/classes/resources/config/webhooks/index.js on lines 20..24

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

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

  create(body: {}): Promise<any> {
    const url = `${this.configuration.routes.patients}`;
    return super.postRequest(url, body);
  }
Severity: Major
Found in src/classes/resources/patients/index.js and 1 other location - About 1 hr to fix
src/classes/resources/config/webhooks/index.js on lines 31..34

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

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

  update(body: {}): Promise<any> {
    const url = `${this.configuration.routes.configWebhooks}`;
    return super.putRequest(url, body);
  }
Severity: Major
Found in src/classes/resources/config/webhooks/index.js and 1 other location - About 1 hr to fix
src/classes/resources/patients/index.js on lines 10..13

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

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

export default class Agendas extends Common {
  /**
   * @description Get agendas.
   * @return {Promise.<any>}
   */
Severity: Major
Found in src/classes/resources/agendas/index.js and 2 other locations - About 1 hr to fix
src/classes/resources/config/index.js on lines 4..13
src/classes/resources/specialties/index.js on lines 4..13

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

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

export default class Config extends Common {
  /**
   * @description Get configuration.
   * @return {Promise.<any>}
   */
Severity: Major
Found in src/classes/resources/config/index.js and 2 other locations - About 1 hr to fix
src/classes/resources/agendas/index.js on lines 4..13
src/classes/resources/specialties/index.js on lines 4..13

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

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

export default class Specialities extends Common {
  /**
   * @description Get specialities.
   * @return {Promise.<any>}
   */
Severity: Major
Found in src/classes/resources/specialties/index.js and 2 other locations - About 1 hr to fix
src/classes/resources/agendas/index.js on lines 4..13
src/classes/resources/config/index.js on lines 4..13

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

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

export default class InternalError extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'An error occurred with our API.';
  }
Severity: Major
Found in src/classes/exceptions/internal_error.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class UnknownError extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'An unknown error occurred with API.';
  }
Severity: Major
Found in src/classes/exceptions/unknown_error.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class ValidationError extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'A validation error occurred.';
  }
Severity: Major
Found in src/classes/exceptions/validation_error.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9

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

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

export default class OverQuota extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'Over plan quota on this endpoint.';
  }
Severity: Major
Found in src/classes/exceptions/over_quota.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class InvalidDatetimeFormat extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'Invalid datetime format (ISO_8601 format required)';
  }
Severity: Major
Found in src/classes/exceptions/invalid_datetime_format.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class BadRequest extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'Bad request.';
  }
Severity: Major
Found in src/classes/exceptions/bad_request.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class Unauthorized extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'Your API key is invalid.';
  }
Severity: Major
Found in src/classes/exceptions/unauthorized.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class MissingMandatoryParameter extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'Missing required params';
  }
Severity: Major
Found in src/classes/exceptions/missing_mandatory_parameter.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/not_found.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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

export default class NotFound extends Exception {
  constructor(message: ?string) {
    super();
    this.message = message || 'The resource does not exist.';
  }
Severity: Major
Found in src/classes/exceptions/not_found.js and 8 other locations - About 35 mins to fix
src/classes/exceptions/bad_request.js on lines 4..9
src/classes/exceptions/internal_error.js on lines 4..9
src/classes/exceptions/invalid_datetime_format.js on lines 4..9
src/classes/exceptions/missing_mandatory_parameter.js on lines 4..9
src/classes/exceptions/over_quota.js on lines 4..9
src/classes/exceptions/unauthorized.js on lines 4..9
src/classes/exceptions/unknown_error.js on lines 4..9
src/classes/exceptions/validation_error.js on lines 4..9

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

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