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 509 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 (response *XMLStopMonitoringResponse) StopMonitoringDeliveries() []*XMLStopMonitoringDelivery {
          if response.deliveries == nil {
              deliveries := []*XMLStopMonitoringDelivery{}
              nodes := response.findNodes(siri_attributes.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 50..60
      siri/sxml/estimated_timetable_response.go on lines 62..72
      siri/sxml/estimated_timetable_response.go on lines 74..84
      siri/sxml/lines_discovery_response.go on lines 58..68
      siri/sxml/notify_estimated_timetable.go on lines 27..37
      siri/sxml/notify_estimated_timetable.go on lines 54..64
      siri/sxml/notify_general_message.go on lines 43..53
      siri/sxml/notify_general_message.go on lines 65..75
      siri/sxml/notify_situation_exchange.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 49..59
      siri/sxml/notify_stop_monitoring.go on lines 61..71
      siri/sxml/notify_vehicle_monitoring.go on lines 42..52
      siri/sxml/notify_vehicle_monitoring.go on lines 54..64
      siri/sxml/situation_exchange_reponse.go on lines 245..255
      siri/sxml/situation_exchange_reponse.go on lines 257..267
      siri/sxml/situation_exchange_reponse.go on lines 362..372
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 428..438
      siri/sxml/situation_exchange_reponse.go on lines 440..450
      siri/sxml/situation_exchange_reponse.go on lines 466..476
      siri/sxml/situation_exchange_reponse.go on lines 858..868
      siri/sxml/stop_monitoring_response.go on lines 142..152
      siri/sxml/stop_monitoring_response.go on lines 154..164
      siri/sxml/stop_points_discovery_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 73..83

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

      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(siri_attributes.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 50..60
      siri/sxml/estimated_timetable_response.go on lines 62..72
      siri/sxml/estimated_timetable_response.go on lines 74..84
      siri/sxml/lines_discovery_response.go on lines 58..68
      siri/sxml/notify_estimated_timetable.go on lines 27..37
      siri/sxml/notify_estimated_timetable.go on lines 54..64
      siri/sxml/notify_general_message.go on lines 43..53
      siri/sxml/notify_general_message.go on lines 65..75
      siri/sxml/notify_situation_exchange.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 49..59
      siri/sxml/notify_stop_monitoring.go on lines 61..71
      siri/sxml/notify_vehicle_monitoring.go on lines 42..52
      siri/sxml/notify_vehicle_monitoring.go on lines 54..64
      siri/sxml/situation_exchange_reponse.go on lines 245..255
      siri/sxml/situation_exchange_reponse.go on lines 257..267
      siri/sxml/situation_exchange_reponse.go on lines 362..372
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 428..438
      siri/sxml/situation_exchange_reponse.go on lines 440..450
      siri/sxml/situation_exchange_reponse.go on lines 466..476
      siri/sxml/situation_exchange_reponse.go on lines 858..868
      siri/sxml/stop_monitoring_response.go on lines 123..133
      siri/sxml/stop_monitoring_response.go on lines 142..152
      siri/sxml/stop_points_discovery_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 73..83

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

      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) XMLMonitoredStopVisits() []*XMLMonitoredStopVisit {
          if delivery.monitoredStopVisits == nil {
              stopVisits := []*XMLMonitoredStopVisit{}
              nodes := delivery.findNodes(siri_attributes.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 50..60
      siri/sxml/estimated_timetable_response.go on lines 62..72
      siri/sxml/estimated_timetable_response.go on lines 74..84
      siri/sxml/lines_discovery_response.go on lines 58..68
      siri/sxml/notify_estimated_timetable.go on lines 27..37
      siri/sxml/notify_estimated_timetable.go on lines 54..64
      siri/sxml/notify_general_message.go on lines 43..53
      siri/sxml/notify_general_message.go on lines 65..75
      siri/sxml/notify_situation_exchange.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 30..40
      siri/sxml/notify_stop_monitoring.go on lines 49..59
      siri/sxml/notify_stop_monitoring.go on lines 61..71
      siri/sxml/notify_vehicle_monitoring.go on lines 42..52
      siri/sxml/notify_vehicle_monitoring.go on lines 54..64
      siri/sxml/situation_exchange_reponse.go on lines 245..255
      siri/sxml/situation_exchange_reponse.go on lines 257..267
      siri/sxml/situation_exchange_reponse.go on lines 362..372
      siri/sxml/situation_exchange_reponse.go on lines 374..384
      siri/sxml/situation_exchange_reponse.go on lines 428..438
      siri/sxml/situation_exchange_reponse.go on lines 440..450
      siri/sxml/situation_exchange_reponse.go on lines 466..476
      siri/sxml/situation_exchange_reponse.go on lines 858..868
      siri/sxml/stop_monitoring_response.go on lines 123..133
      siri/sxml/stop_monitoring_response.go on lines 154..164
      siri/sxml/stop_points_discovery_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 61..71
      siri/sxml/vehicle_monitoring_response.go on lines 73..83

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

      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