siri/sxml/general_message_response.go

Summary

Maintainability
B
4 hrs
Test Coverage

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

func (response *XMLGeneralMessageResponse) XMLGeneralMessages() []*XMLGeneralMessage {
    if len(response.xmlGeneralMessages) == 0 {
        nodes := response.findNodes("GeneralMessage")
        if nodes == nil {
            return response.xmlGeneralMessages
Severity: Minor
Found in siri/sxml/general_message_response.go and 1 other location - About 45 mins to fix
siri/sxml/delete_subscription_response.go on lines 67..78

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

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 (visit *IDFGeneralMessageStructure) StopPointRef() []string {
    if len(visit.stopPointRef) == 0 {
        nodes := visit.findNodes("StopPointRef")
        for _, stopPointRef := range nodes {
            visit.stopPointRef = append(visit.stopPointRef, strings.TrimSpace(stopPointRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/general_message_response.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 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_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 (visit *IDFGeneralMessageStructure) LineRefs() []string {
    if len(visit.lineRef) == 0 {
        nodes := visit.findDirectChildrenNodes("LineRef")
        for _, lineRef := range nodes {
            visit.lineRef = append(visit.lineRef, strings.TrimSpace(lineRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/general_message_response.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/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_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 (visit *IDFGeneralMessageStructure) RouteRef() []string {
    if len(visit.routeRef) == 0 {
        nodes := visit.findNodes("RouteRef")
        for _, routeRef := range nodes {
            visit.routeRef = append(visit.routeRef, strings.TrimSpace(routeRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/general_message_response.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 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_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 (visit *IDFGeneralMessageStructure) DestinationRef() []string {
    if len(visit.destinationRef) == 0 {
        nodes := visit.findNodes("DestinationRef")
        for _, destinationRef := range nodes {
            visit.destinationRef = append(visit.destinationRef, strings.TrimSpace(destinationRef.NativeNode().Content()))
Severity: Major
Found in siri/sxml/general_message_response.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 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_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 4 locations. Consider refactoring.
Open

func (visit *IDFGeneralMessageStructure) LineSections() []*IDFLineSectionStructure {
    if len(visit.lineSections) == 0 {
        nodes := visit.findNodes("LineSection")
        for _, lineNode := range nodes {
            visit.lineSections = append(visit.lineSections, NewXMLLineSection(lineNode))
Severity: Major
Found in siri/sxml/general_message_response.go and 3 other locations - About 30 mins to fix
siri/sxml/situation_exchange_reponse.go on lines 427..435
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

There are no issues that match your filters.

Category
Status