Showing 525 of 525 total issues

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

func (s *PartnerSettings) VehicleRemoteCodeSpaceWithFallback(connectorName string) []string {
    value, ok := s.vehicleRemoteCodeSpacesByConnector.Load(connectorName)
    if ok {
        return value.([]string)
    }
Severity: Minor
Found in core/settings/partner_settings.go and 1 other location - About 40 mins to fix
core/settings/partner_settings.go on lines 315..326

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

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 *XMLNotifyStopMonitoringDelivery) XMLMonitoredStopVisitCancellations() []*XMLMonitoredStopVisitCancellation {
    if delivery.monitoredStopVisitCancellations == nil {
        cancellations := []*XMLMonitoredStopVisitCancellation{}
        nodes := delivery.findNodes("MonitoredStopVisitCancellation")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_stop_monitoring.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_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_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 (c *XMLConsequence) Affects() []*XMLAffect {
    if c.affects == nil {
        affects := []*XMLAffect{}
        nodes := c.findNodes("Affects")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 (response *XMLStopPointsDiscoveryResponse) AnnotatedStopPointRefs() []*XMLAnnotatedStopPointRef {
    if response.annotatedStopPointRefs == nil {
        annotatedStopPointRefs := []*XMLAnnotatedStopPointRef{}
        nodes := response.findNodes("AnnotatedStopPointRef")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/stop_points_discovery_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_monitoring_response.go on lines 153..163
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 *XMLNotifyStopMonitoringDelivery) XMLMonitoredStopVisits() []*XMLMonitoredStopVisit {
    if delivery.monitoredStopVisits == nil {
        stopVisits := []*XMLMonitoredStopVisit{}
        nodes := delivery.findNodes("MonitoredStopVisit")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_stop_monitoring.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 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_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 (visit *XMLPtSituationElement) PublicationWindows() []*XMLPeriod {
    if visit.publicationWindows == nil {
        publicationWindows := []*XMLPeriod{}
        nodes := visit.findNodes("PublicationWindow")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 (response *XMLSituationExchangeResponse) SituationExchangeDeliveries() []*XMLSituationExchangeDelivery {
    if response.deliveries == nil {
        deliveries := []*XMLSituationExchangeDelivery{}
        nodes := response.findNodes("SituationExchangeDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 (visit *XMLPtSituationElement) ValidityPeriods() []*XMLPeriod {
    if visit.validityPeriods == nil {
        validityPeriods := []*XMLPeriod{}
        nodes := visit.findNodes("ValidityPeriod")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 (notify *XMLNotifyEstimatedTimetable) EstimatedTimetableDeliveries() []*XMLNotifyEstimatedTimetableDelivery {
    if notify.deliveries == nil {
        deliveries := []*XMLNotifyEstimatedTimetableDelivery{}
        nodes := notify.findNodes("EstimatedTimetableDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_estimated_timetable.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 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_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 (visit *XMLPtSituationElement) Consequences() []*XMLConsequence {
    if visit.consequences == nil {
        consequences := []*XMLConsequence{}
        nodes := visit.findNodes("Consequences")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 *XMLGeneralMessageDelivery) XMLGeneralMessagesCancellations() []*XMLGeneralMessageCancellation {
    if delivery.xmlGeneralMessagesCancellations == nil {
        cancellations := []*XMLGeneralMessageCancellation{}
        nodes := delivery.findNodes("GeneralMessageCancellation")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_general_message.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_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_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 (consequence *XMLConsequence) Periods() []*XMLPeriod {
    if consequence.periods == nil {
        periods := []*XMLPeriod{}
        nodes := consequence.findNodes("Period")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 (notify *XMLNotifyGeneralMessage) GeneralMessagesDeliveries() []*XMLGeneralMessageDelivery {
    if notify.deliveries == nil {
        deliveries := []*XMLGeneralMessageDelivery{}
        nodes := notify.findNodes("GeneralMessageDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_general_message.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 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_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 (visit *XMLPtSituationElement) Affects() []*XMLAffect {
    if visit.affects == nil {
        affects := []*XMLAffect{}
        nodes := visit.findDirectChildrenNodes("Affects")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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/stop_monitoring_response.go on lines 122..132
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

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

func (notify *XMLNotifyStopMonitoring) StopMonitoringDeliveries() []*XMLNotifyStopMonitoringDelivery {
    if notify.deliveries == nil {
        deliveries := []*XMLNotifyStopMonitoringDelivery{}
        nodes := notify.findNodes("StopMonitoringDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_stop_monitoring.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 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_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 (response *XMLLinesDiscoveryResponse) AnnotatedLineRefs() []*XMLAnnotatedLineRef {
    if response.annotatedLineRefs == nil {
        annotatedLineRefs := []*XMLAnnotatedLineRef{}
        nodes := response.findNodes("AnnotatedLineRef")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/lines_discovery_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/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_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 *XMLSituationExchangeDelivery) Situations() []*XMLPtSituationElement {
    if delivery.situations == nil {
        situations := []*XMLPtSituationElement{}
        nodes := delivery.findNodes("PtSituationElement")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/situation_exchange_reponse.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 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_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 *XMLNotifyVehicleMonitoringDelivery) VehicleActivities() []*XMLVehicleActivity {
    if delivery.vehicleActivities == nil {
        vas := []*XMLVehicleActivity{}
        nodes := delivery.findNodes("VehicleActivity")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_vehicle_monitoring.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/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_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 14 locations. Consider refactoring.
Open

func (delivery *SIRIEstimatedTimetableDelivery) BuildEstimatedTimetableDeliveryXMLRaw() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "estimated_timetable_delivery_raw.template", delivery); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/estimated_timetable_response.go and 13 other locations - About 40 mins to fix
siri/siri/estimated_timetable_request.go on lines 58..66
siri/siri/estimated_timetable_request.go on lines 68..76
siri/siri/estimated_timetable_response.go on lines 146..153
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 119..126
siri/siri/situation_exchange_response.go on lines 128..135
siri/siri/situation_exchange_response.go on lines 137..144
siri/siri/vehicle_monitoring_request.go on lines 47..54
siri/siri/vehicle_monitoring_request.go on lines 56..63
siri/siri/vehicle_monitoring_response.go on lines 129..137
siri/siri/vehicle_monitoring_response.go on lines 139..147
siri/siri/vehicle_monitoring_response.go on lines 149..157

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

func (request *SIRIEstimatedTimetableRequest) BuildEstimatedTimetableRequestXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "estimated_timetable_request.template", request); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/estimated_timetable_request.go and 13 other locations - About 40 mins to fix
siri/siri/estimated_timetable_request.go on lines 68..76
siri/siri/estimated_timetable_response.go on lines 146..153
siri/siri/estimated_timetable_response.go on lines 170..177
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 119..126
siri/siri/situation_exchange_response.go on lines 128..135
siri/siri/situation_exchange_response.go on lines 137..144
siri/siri/vehicle_monitoring_request.go on lines 47..54
siri/siri/vehicle_monitoring_request.go on lines 56..63
siri/siri/vehicle_monitoring_response.go on lines 129..137
siri/siri/vehicle_monitoring_response.go on lines 139..147
siri/siri/vehicle_monitoring_response.go on lines 149..157

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

Severity
Category
Status
Source
Language