siri/sxml/stop_monitoring_response.go

Summary

Maintainability
C
1 day
Test Coverage

XMLMonitoredVehicleJourney has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

type XMLMonitoredVehicleJourney struct {
    XMLCall

    datedVehicleJourneyRef string
    lineRef                string
Severity: Major
Found in siri/sxml/stop_monitoring_response.go - About 7 hrs to fix

    File stop_monitoring_response.go has 508 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package sxml
    
    import (
        "time"
    
    
    Severity: Minor
    Found in siri/sxml/stop_monitoring_response.go - About 2 hrs to fix

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

      func (delivery *XMLStopMonitoringDelivery) XMLMonitoredStopVisits() []*XMLMonitoredStopVisit {
          if delivery.monitoredStopVisits == nil {
              stopVisits := []*XMLMonitoredStopVisit{}
              nodes := delivery.findNodes("MonitoredStopVisit")
              for _, node := range nodes {
      Severity: Major
      Found in siri/sxml/stop_monitoring_response.go and 27 other locations - About 40 mins to fix
      siri/sxml/estimated_timetable_response.go on lines 48..58
      siri/sxml/estimated_timetable_response.go on lines 60..70
      siri/sxml/estimated_timetable_response.go on lines 72..82
      siri/sxml/lines_discovery_response.go on lines 57..67
      siri/sxml/notify_estimated_timetable.go on lines 26..36
      siri/sxml/notify_estimated_timetable.go on lines 53..63
      siri/sxml/notify_general_message.go on lines 42..52
      siri/sxml/notify_general_message.go on lines 64..74
      siri/sxml/notify_situation_exchange.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 48..58
      siri/sxml/notify_stop_monitoring.go on lines 60..70
      siri/sxml/notify_vehicle_monitoring.go on lines 41..51
      siri/sxml/notify_vehicle_monitoring.go on lines 53..63
      siri/sxml/situation_exchange_reponse.go on lines 174..184
      siri/sxml/situation_exchange_reponse.go on lines 186..196
      siri/sxml/situation_exchange_reponse.go on lines 277..287
      siri/sxml/situation_exchange_reponse.go on lines 289..299
      siri/sxml/situation_exchange_reponse.go on lines 343..353
      siri/sxml/situation_exchange_reponse.go on lines 355..365
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 415..425
      siri/sxml/stop_monitoring_response.go on lines 122..132
      siri/sxml/stop_monitoring_response.go on lines 153..163
      siri/sxml/stop_points_discovery_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 72..82

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

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

      func (delivery *XMLStopMonitoringDelivery) XMLMonitoredStopVisitCancellations() []*XMLMonitoredStopVisitCancellation {
          if delivery.monitoredStopVisitCancellations == nil {
              cancellations := []*XMLMonitoredStopVisitCancellation{}
              nodes := delivery.findNodes("MonitoredStopVisitCancellation")
              for _, node := range nodes {
      Severity: Major
      Found in siri/sxml/stop_monitoring_response.go and 27 other locations - About 40 mins to fix
      siri/sxml/estimated_timetable_response.go on lines 48..58
      siri/sxml/estimated_timetable_response.go on lines 60..70
      siri/sxml/estimated_timetable_response.go on lines 72..82
      siri/sxml/lines_discovery_response.go on lines 57..67
      siri/sxml/notify_estimated_timetable.go on lines 26..36
      siri/sxml/notify_estimated_timetable.go on lines 53..63
      siri/sxml/notify_general_message.go on lines 42..52
      siri/sxml/notify_general_message.go on lines 64..74
      siri/sxml/notify_situation_exchange.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 48..58
      siri/sxml/notify_stop_monitoring.go on lines 60..70
      siri/sxml/notify_vehicle_monitoring.go on lines 41..51
      siri/sxml/notify_vehicle_monitoring.go on lines 53..63
      siri/sxml/situation_exchange_reponse.go on lines 174..184
      siri/sxml/situation_exchange_reponse.go on lines 186..196
      siri/sxml/situation_exchange_reponse.go on lines 277..287
      siri/sxml/situation_exchange_reponse.go on lines 289..299
      siri/sxml/situation_exchange_reponse.go on lines 343..353
      siri/sxml/situation_exchange_reponse.go on lines 355..365
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 415..425
      siri/sxml/stop_monitoring_response.go on lines 122..132
      siri/sxml/stop_monitoring_response.go on lines 141..151
      siri/sxml/stop_points_discovery_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 72..82

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

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

      func (response *XMLStopMonitoringResponse) StopMonitoringDeliveries() []*XMLStopMonitoringDelivery {
          if response.deliveries == nil {
              deliveries := []*XMLStopMonitoringDelivery{}
              nodes := response.findNodes("StopMonitoringDelivery")
              for _, node := range nodes {
      Severity: Major
      Found in siri/sxml/stop_monitoring_response.go and 27 other locations - About 40 mins to fix
      siri/sxml/estimated_timetable_response.go on lines 48..58
      siri/sxml/estimated_timetable_response.go on lines 60..70
      siri/sxml/estimated_timetable_response.go on lines 72..82
      siri/sxml/lines_discovery_response.go on lines 57..67
      siri/sxml/notify_estimated_timetable.go on lines 26..36
      siri/sxml/notify_estimated_timetable.go on lines 53..63
      siri/sxml/notify_general_message.go on lines 42..52
      siri/sxml/notify_general_message.go on lines 64..74
      siri/sxml/notify_situation_exchange.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 29..39
      siri/sxml/notify_stop_monitoring.go on lines 48..58
      siri/sxml/notify_stop_monitoring.go on lines 60..70
      siri/sxml/notify_vehicle_monitoring.go on lines 41..51
      siri/sxml/notify_vehicle_monitoring.go on lines 53..63
      siri/sxml/situation_exchange_reponse.go on lines 174..184
      siri/sxml/situation_exchange_reponse.go on lines 186..196
      siri/sxml/situation_exchange_reponse.go on lines 277..287
      siri/sxml/situation_exchange_reponse.go on lines 289..299
      siri/sxml/situation_exchange_reponse.go on lines 343..353
      siri/sxml/situation_exchange_reponse.go on lines 355..365
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 415..425
      siri/sxml/stop_monitoring_response.go on lines 141..151
      siri/sxml/stop_monitoring_response.go on lines 153..163
      siri/sxml/stop_points_discovery_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 60..70
      siri/sxml/vehicle_monitoring_response.go on lines 72..82

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

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status