siri/sxml/situation_exchange_reponse.go

Summary

Maintainability
C
1 day
Test Coverage

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

func (ar *XMLAffectedRoute) AffectedStopPoints() []*XMLAffectedStopPoint {
    if len(ar.affectedStopPoints) == 0 {
        stopPointsNodes := ar.findDirectChildrenNodes("StopPoints")
        if stopPointsNodes != nil {
            xmlStopPoints := NewXMLAffectedStopPoint(stopPointsNodes[0])
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 1 other location - About 1 hr to fix
siri/sxml/situation_exchange_reponse.go on lines 512..525

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

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

func (a *XMLAffect) AffectedStopPoints() []*XMLAffectedStopPoint {
    if len(a.affectedStopPoints) == 0 {
        stopPointsNodes := a.findDirectChildrenNodes("StopPoints")
        if stopPointsNodes != nil {
            xmlStopPoints := NewXMLAffectedStopPoint(stopPointsNodes[0])
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 1 other location - About 1 hr to fix
siri/sxml/situation_exchange_reponse.go on lines 463..476

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

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

func (an *XMLAffectedNetwork) LineRefs() []string {
    if len(an.lineRefs) == 0 {
        nodes := an.findNodes("LineRef")
        for _, lineRef := range nodes {
            an.lineRefs = append(an.lineRefs, strings.TrimSpace(lineRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 17 other locations - About 45 mins to fix
siri/sxml/estimated_timetable_request.go on lines 41..49
siri/sxml/general_message_request.go on lines 49..57
siri/sxml/general_message_request.go on lines 59..67
siri/sxml/general_message_request.go on lines 69..77
siri/sxml/general_message_request.go on lines 79..87
siri/sxml/general_message_request.go on lines 89..97
siri/sxml/general_message_response.go on lines 202..210
siri/sxml/general_message_response.go on lines 212..220
siri/sxml/general_message_response.go on lines 222..230
siri/sxml/general_message_response.go on lines 232..240
siri/sxml/production_timetable_request.go on lines 17..25
siri/sxml/situation_exchange_reponse.go on lines 502..510
siri/sxml/situation_exchange_reponse.go on lines 534..542
siri/sxml/situation_exchange_subscription_request_entry.go on lines 43..51
siri/sxml/situation_exchange_subscription_request_entry.go on lines 53..61
siri/sxml/stop_points_discovery_response.go on lines 86..94
siri/sxml/vehicle_monitoring_request.go on lines 41..49

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

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

func (an *XMLAffectedNetwork) AffectedDestinations() []string {
    if len(an.affectedDestinations) == 0 {
        nodes := an.findNodes("StopPlaceRef")
        for _, routeRef := range nodes {
            an.affectedDestinations = append(an.affectedDestinations, strings.TrimSpace(routeRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 17 other locations - About 45 mins to fix
siri/sxml/estimated_timetable_request.go on lines 41..49
siri/sxml/general_message_request.go on lines 49..57
siri/sxml/general_message_request.go on lines 59..67
siri/sxml/general_message_request.go on lines 69..77
siri/sxml/general_message_request.go on lines 79..87
siri/sxml/general_message_request.go on lines 89..97
siri/sxml/general_message_response.go on lines 202..210
siri/sxml/general_message_response.go on lines 212..220
siri/sxml/general_message_response.go on lines 222..230
siri/sxml/general_message_response.go on lines 232..240
siri/sxml/production_timetable_request.go on lines 17..25
siri/sxml/situation_exchange_reponse.go on lines 437..445
siri/sxml/situation_exchange_reponse.go on lines 534..542
siri/sxml/situation_exchange_subscription_request_entry.go on lines 43..51
siri/sxml/situation_exchange_subscription_request_entry.go on lines 53..61
siri/sxml/stop_points_discovery_response.go on lines 86..94
siri/sxml/vehicle_monitoring_request.go on lines 41..49

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

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

func (asp *XMLAffectedStopPoint) LineRefs() []string {
    if len(asp.lineRefs) == 0 {
        nodes := asp.findNodes("LineRef")
        for _, lineRef := range nodes {
            asp.lineRefs = append(asp.lineRefs, strings.TrimSpace(lineRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 17 other locations - About 45 mins to fix
siri/sxml/estimated_timetable_request.go on lines 41..49
siri/sxml/general_message_request.go on lines 49..57
siri/sxml/general_message_request.go on lines 59..67
siri/sxml/general_message_request.go on lines 69..77
siri/sxml/general_message_request.go on lines 79..87
siri/sxml/general_message_request.go on lines 89..97
siri/sxml/general_message_response.go on lines 202..210
siri/sxml/general_message_response.go on lines 212..220
siri/sxml/general_message_response.go on lines 222..230
siri/sxml/general_message_response.go on lines 232..240
siri/sxml/production_timetable_request.go on lines 17..25
siri/sxml/situation_exchange_reponse.go on lines 437..445
siri/sxml/situation_exchange_reponse.go on lines 502..510
siri/sxml/situation_exchange_subscription_request_entry.go on lines 43..51
siri/sxml/situation_exchange_subscription_request_entry.go on lines 53..61
siri/sxml/stop_points_discovery_response.go on lines 86..94
siri/sxml/vehicle_monitoring_request.go on lines 41..49

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

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

func (an *XMLAffectedNetwork) AffectedRoutes() []*XMLAffectedRoute {
    if len(an.affectedRoutes) == 0 {
        nodes := an.findNodes("AffectedRoute")
        for _, affectedRoute := range nodes {
            an.affectedRoutes = append(an.affectedRoutes, NewXMLAffectedRoute(affectedRoute))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 427..435
siri/sxml/situation_exchange_reponse.go on lines 478..486

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

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

func (a *XMLAffect) AffectedNetworks() []*XMLAffectedNetwork {
    if len(a.affectedNetworks) == 0 {
        nodes := a.findNodes("AffectedNetwork")
        for _, affectedNetwork := range nodes {
            a.affectedNetworks = append(a.affectedNetworks, NewXMLAffectedNetwork(affectedNetwork))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 447..455
siri/sxml/situation_exchange_reponse.go on lines 478..486

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

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

func (an *XMLAffectedNetwork) AffectedSections() []*XMLAffectedSection {
    if len(an.affectedSections) == 0 {
        nodes := an.findNodes("AffectedSection")
        for _, section := range nodes {
            an.affectedSections = append(an.affectedSections, NewXMLAffectedSection(section))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 427..435
siri/sxml/situation_exchange_reponse.go on lines 447..455

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

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