amadeus4dev/amadeus-node

View on GitHub

Showing 50 of 53 total issues

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

class RecommendedLocations {
  constructor(client) {
    this.client = client;
  }

src/amadeus/namespaces/airline/destinations.js on lines 14..36
src/amadeus/namespaces/airport/direct-destinations.js on lines 14..36
src/amadeus/namespaces/airport/predictions/on_time.js on lines 14..40
src/amadeus/namespaces/analytics/itinerary_price_metrics.js on lines 14..39
src/amadeus/namespaces/booking/flight_orders.js on lines 14..38
src/amadeus/namespaces/booking/hotel_bookings.js on lines 14..42
src/amadeus/namespaces/booking/hotel_orders.js on lines 14..44
src/amadeus/namespaces/e_reputation/hotel_sentiments.js on lines 14..38
src/amadeus/namespaces/location/analytics/category_rated_areas.js on lines 14..42
src/amadeus/namespaces/reference_data/airlines.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/airports.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/cities.js on lines 14..38
src/amadeus/namespaces/reference_data/locations/hotel.js on lines 14..36
src/amadeus/namespaces/reference_data/locations/hotels/by-city.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/hotels/by-geocode.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/hotels/by-hotels.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/points_of_interest/by-square.js on lines 14..43
src/amadeus/namespaces/reference_data/urls/checkin_links.js on lines 14..39
src/amadeus/namespaces/schedule/flights.js on lines 14..40
src/amadeus/namespaces/shopping/activities/by_square.js on lines 14..43
src/amadeus/namespaces/shopping/availability/flight_availabilities.js on lines 14..32
src/amadeus/namespaces/shopping/flight_dates.js on lines 14..41
src/amadeus/namespaces/shopping/flight_destinations.js on lines 14..38
src/amadeus/namespaces/shopping/flight_offers/flight_choice_prediction.js on lines 14..45
src/amadeus/namespaces/shopping/flight_offers/upselling.js on lines 14..32
src/amadeus/namespaces/shopping/hotel_offers_search.js on lines 14..40
src/amadeus/namespaces/shopping/transfer_offers.js on lines 15..36
src/amadeus/namespaces/travel/analytics/air_traffic/booked.js on lines 14..41
src/amadeus/namespaces/travel/analytics/air_traffic/busiest_period.js on lines 14..44
src/amadeus/namespaces/travel/analytics/air_traffic/traveled.js on lines 14..41
src/amadeus/namespaces/travel/predictions/flight_delay.js on lines 14..57
src/amadeus/namespaces/travel/predictions/trip_purpose.js on lines 14..43

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

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

class CheckinLinks {
  constructor(client) {
    this.client = client;
  }

src/amadeus/namespaces/airline/destinations.js on lines 14..36
src/amadeus/namespaces/airport/direct-destinations.js on lines 14..36
src/amadeus/namespaces/airport/predictions/on_time.js on lines 14..40
src/amadeus/namespaces/analytics/itinerary_price_metrics.js on lines 14..39
src/amadeus/namespaces/booking/flight_orders.js on lines 14..38
src/amadeus/namespaces/booking/hotel_bookings.js on lines 14..42
src/amadeus/namespaces/booking/hotel_orders.js on lines 14..44
src/amadeus/namespaces/e_reputation/hotel_sentiments.js on lines 14..38
src/amadeus/namespaces/location/analytics/category_rated_areas.js on lines 14..42
src/amadeus/namespaces/reference_data/airlines.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/airports.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/cities.js on lines 14..38
src/amadeus/namespaces/reference_data/locations/hotel.js on lines 14..36
src/amadeus/namespaces/reference_data/locations/hotels/by-city.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/hotels/by-geocode.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/hotels/by-hotels.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/points_of_interest/by-square.js on lines 14..43
src/amadeus/namespaces/reference_data/recommended_locations.js on lines 14..40
src/amadeus/namespaces/schedule/flights.js on lines 14..40
src/amadeus/namespaces/shopping/activities/by_square.js on lines 14..43
src/amadeus/namespaces/shopping/availability/flight_availabilities.js on lines 14..32
src/amadeus/namespaces/shopping/flight_dates.js on lines 14..41
src/amadeus/namespaces/shopping/flight_destinations.js on lines 14..38
src/amadeus/namespaces/shopping/flight_offers/flight_choice_prediction.js on lines 14..45
src/amadeus/namespaces/shopping/flight_offers/upselling.js on lines 14..32
src/amadeus/namespaces/shopping/hotel_offers_search.js on lines 14..40
src/amadeus/namespaces/shopping/transfer_offers.js on lines 15..36
src/amadeus/namespaces/travel/analytics/air_traffic/booked.js on lines 14..41
src/amadeus/namespaces/travel/analytics/air_traffic/busiest_period.js on lines 14..44
src/amadeus/namespaces/travel/analytics/air_traffic/traveled.js on lines 14..41
src/amadeus/namespaces/travel/predictions/flight_delay.js on lines 14..57
src/amadeus/namespaces/travel/predictions/trip_purpose.js on lines 14..43

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

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

class HotelBookings {
  constructor(client) {
    this.client = client;
  }

Severity: Major
Found in src/amadeus/namespaces/booking/hotel_bookings.js and 32 other locations - About 1 hr to fix
src/amadeus/namespaces/airline/destinations.js on lines 14..36
src/amadeus/namespaces/airport/direct-destinations.js on lines 14..36
src/amadeus/namespaces/airport/predictions/on_time.js on lines 14..40
src/amadeus/namespaces/analytics/itinerary_price_metrics.js on lines 14..39
src/amadeus/namespaces/booking/flight_orders.js on lines 14..38
src/amadeus/namespaces/booking/hotel_orders.js on lines 14..44
src/amadeus/namespaces/e_reputation/hotel_sentiments.js on lines 14..38
src/amadeus/namespaces/location/analytics/category_rated_areas.js on lines 14..42
src/amadeus/namespaces/reference_data/airlines.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/airports.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/cities.js on lines 14..38
src/amadeus/namespaces/reference_data/locations/hotel.js on lines 14..36
src/amadeus/namespaces/reference_data/locations/hotels/by-city.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/hotels/by-geocode.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/hotels/by-hotels.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/points_of_interest/by-square.js on lines 14..43
src/amadeus/namespaces/reference_data/recommended_locations.js on lines 14..40
src/amadeus/namespaces/reference_data/urls/checkin_links.js on lines 14..39
src/amadeus/namespaces/schedule/flights.js on lines 14..40
src/amadeus/namespaces/shopping/activities/by_square.js on lines 14..43
src/amadeus/namespaces/shopping/availability/flight_availabilities.js on lines 14..32
src/amadeus/namespaces/shopping/flight_dates.js on lines 14..41
src/amadeus/namespaces/shopping/flight_destinations.js on lines 14..38
src/amadeus/namespaces/shopping/flight_offers/flight_choice_prediction.js on lines 14..45
src/amadeus/namespaces/shopping/flight_offers/upselling.js on lines 14..32
src/amadeus/namespaces/shopping/hotel_offers_search.js on lines 14..40
src/amadeus/namespaces/shopping/transfer_offers.js on lines 15..36
src/amadeus/namespaces/travel/analytics/air_traffic/booked.js on lines 14..41
src/amadeus/namespaces/travel/analytics/air_traffic/busiest_period.js on lines 14..44
src/amadeus/namespaces/travel/analytics/air_traffic/traveled.js on lines 14..41
src/amadeus/namespaces/travel/predictions/flight_delay.js on lines 14..57
src/amadeus/namespaces/travel/predictions/trip_purpose.js on lines 14..43

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

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

class TransferOffers {
  constructor(client) {
    this.client = client;
  }

Severity: Major
Found in src/amadeus/namespaces/shopping/transfer_offers.js and 32 other locations - About 1 hr to fix
src/amadeus/namespaces/airline/destinations.js on lines 14..36
src/amadeus/namespaces/airport/direct-destinations.js on lines 14..36
src/amadeus/namespaces/airport/predictions/on_time.js on lines 14..40
src/amadeus/namespaces/analytics/itinerary_price_metrics.js on lines 14..39
src/amadeus/namespaces/booking/flight_orders.js on lines 14..38
src/amadeus/namespaces/booking/hotel_bookings.js on lines 14..42
src/amadeus/namespaces/booking/hotel_orders.js on lines 14..44
src/amadeus/namespaces/e_reputation/hotel_sentiments.js on lines 14..38
src/amadeus/namespaces/location/analytics/category_rated_areas.js on lines 14..42
src/amadeus/namespaces/reference_data/airlines.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/airports.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/cities.js on lines 14..38
src/amadeus/namespaces/reference_data/locations/hotel.js on lines 14..36
src/amadeus/namespaces/reference_data/locations/hotels/by-city.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/hotels/by-geocode.js on lines 14..41
src/amadeus/namespaces/reference_data/locations/hotels/by-hotels.js on lines 14..37
src/amadeus/namespaces/reference_data/locations/points_of_interest/by-square.js on lines 14..43
src/amadeus/namespaces/reference_data/recommended_locations.js on lines 14..40
src/amadeus/namespaces/reference_data/urls/checkin_links.js on lines 14..39
src/amadeus/namespaces/schedule/flights.js on lines 14..40
src/amadeus/namespaces/shopping/activities/by_square.js on lines 14..43
src/amadeus/namespaces/shopping/availability/flight_availabilities.js on lines 14..32
src/amadeus/namespaces/shopping/flight_dates.js on lines 14..41
src/amadeus/namespaces/shopping/flight_destinations.js on lines 14..38
src/amadeus/namespaces/shopping/flight_offers/flight_choice_prediction.js on lines 14..45
src/amadeus/namespaces/shopping/flight_offers/upselling.js on lines 14..32
src/amadeus/namespaces/shopping/hotel_offers_search.js on lines 14..40
src/amadeus/namespaces/travel/analytics/air_traffic/booked.js on lines 14..41
src/amadeus/namespaces/travel/analytics/air_traffic/busiest_period.js on lines 14..44
src/amadeus/namespaces/travel/analytics/air_traffic/traveled.js on lines 14..41
src/amadeus/namespaces/travel/predictions/flight_delay.js on lines 14..57
src/amadeus/namespaces/travel/predictions/trip_purpose.js on lines 14..43

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

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

class Travel {
  constructor(client) {
    this.client    = client;
    this.analytics = new Analytics(client);
    this.predictions = new Predictions(client);
Severity: Major
Found in src/amadeus/namespaces/travel.js and 2 other locations - About 1 hr to fix
src/amadeus/namespaces/airport.js on lines 18..24
src/amadeus/namespaces/travel/predictions.js on lines 19..25

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

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

class Airport {
  constructor(client) {
    this.client             = client;
    this.directDestinations = new DirectDestinations(client);
    this.predictions = new Predictions(client);
Severity: Major
Found in src/amadeus/namespaces/airport.js and 2 other locations - About 1 hr to fix
src/amadeus/namespaces/travel.js on lines 20..26
src/amadeus/namespaces/travel/predictions.js on lines 19..25

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

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

class Predictions {
  constructor(client) {
    this.client = client;
    this.tripPurpose = new TripPurpose(client);
    this.flightDelay = new FlightDelay(client);
Severity: Major
Found in src/amadeus/namespaces/travel/predictions.js and 2 other locations - About 1 hr to fix
src/amadeus/namespaces/airport.js on lines 18..24
src/amadeus/namespaces/travel.js on lines 20..26

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

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

Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(options) {
    this.host            = options.host;
    this.port            = options.port;
    this.ssl             = options.ssl;
    this.scheme          = this.ssl ? 'https' : 'http';
Severity: Minor
Found in src/amadeus/client/request.js - About 1 hr to fix

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

    class TransferOrder {
      constructor(client, orderId) {
        this.client = client;
        this.orderId = orderId;
        this.transfers = new Transfers(client, orderId);
    Severity: Major
    Found in src/amadeus/namespaces/ordering/transfer_order.js and 1 other location - About 1 hr to fix
    src/amadeus/namespaces/ordering/transfer_orders/transfers.js on lines 16..22

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

    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

    class Transfers {
      constructor(client, orderId) {
        this.client = client;
        this.orderId = orderId;
        this.cancellation = new Cancellation(client, orderId);
    src/amadeus/namespaces/ordering/transfer_order.js on lines 17..23

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

    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