Showing 525 of 525 total issues

Function NewAutodetectSIRIEnvelope has 7 return statements (exceeds 4 allowed).
Open

func NewAutodetectSIRIEnvelope(body io.Reader) (*SIRIEnvelope, error) {
    // Attempt to read the body
    content, err := io.ReadAll(body)
    if err != nil {
        return nil, err
Severity: Major
Found in remote/siri_envelope.go - About 45 mins to fix

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

    func (client *SIRILiteClient) getURL(requestType requestType) string {
        switch requestType {
        case SUBSCRIPTION:
            if client.httpClient.SubscriptionsUrl != "" {
                return client.httpClient.SubscriptionsUrl
    Severity: Minor
    Found in remote/siri_lite_client.go and 1 other location - About 45 mins to fix
    remote/siri_client.go on lines 148..160

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

    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 (client *SIRIClient) getURL(requestType requestType) string {
        switch requestType {
        case SUBSCRIPTION:
            if client.httpClient.SubscriptionsUrl != "" {
                return client.httpClient.SubscriptionsUrl
    Severity: Minor
    Found in remote/siri_client.go and 1 other location - About 45 mins to fix
    remote/siri_lite_client.go on lines 135..147

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

    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 (request *XMLProductionTimetableRequest) Lines() []string {
        if len(request.lines) == 0 {
            nodes := request.findNodes("LineRef")
            for _, node := range nodes {
                request.lines = append(request.lines, strings.TrimSpace(node.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/production_timetable_request.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/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 (request *XMLGeneralMessageRequest) InfoChannelRef() []string {
        if len(request.infoChannelRef) == 0 {
            nodes := request.findNodes("InfoChannelRef")
            for _, infoChannelRef := range nodes {
                request.infoChannelRef = append(request.infoChannelRef, strings.TrimSpace(infoChannelRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/general_message_request.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 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_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 (request *XMLGeneralMessageRequest) StopPointRef() []string {
        if len(request.stopPointRef) == 0 {
            nodes := request.findNodes("StopPointRef")
            for _, stopPointRef := range nodes {
                request.stopPointRef = append(request.stopPointRef, strings.TrimSpace(stopPointRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/general_message_request.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 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_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 (request *XMLSituationExchangeSubscriptionRequestEntry) StopPointRefs() []string {
        if len(request.stopPointRefs) == 0 {
            nodes := request.findNodes("StopPointRef")
            for _, lineRef := range nodes {
                request.stopPointRefs = append(request.stopPointRefs, strings.TrimSpace(lineRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/situation_exchange_subscription_request_entry.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_reponse.go on lines 534..542
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 43..51
    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) 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 (annotatedStopPoint *XMLAnnotatedStopPointRef) LineRefs() []string {
        if len(annotatedStopPoint.lineRefs) == 0 {
            nodes := annotatedStopPoint.findNodes("LineRef")
            for _, node := range nodes {
                annotatedStopPoint.lineRefs = append(annotatedStopPoint.lineRefs, strings.TrimSpace(node.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/stop_points_discovery_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/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/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 18 locations. Consider refactoring.
    Open

    func (request *XMLEstimatedTimetableRequest) Lines() []string {
        if len(request.lines) == 0 {
            nodes := request.findNodes("LineRef")
            for _, node := range nodes {
                request.lines = append(request.lines, strings.TrimSpace(node.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/estimated_timetable_request.go and 17 other locations - About 45 mins to fix
    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_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 (request *XMLGeneralMessageRequest) DestinationRef() []string {
        if len(request.destinationRef) == 0 {
            nodes := request.findNodes("DestinationRef")
            for _, destinationRef := range nodes {
                request.destinationRef = append(request.destinationRef, strings.TrimSpace(destinationRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/general_message_request.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 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_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 (request *XMLGeneralMessageRequest) LineRef() []string {
        if len(request.lineRef) == 0 {
            nodes := request.findNodes("LineRef")
            for _, lineRef := range nodes {
                request.lineRef = append(request.lineRef, strings.TrimSpace(lineRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/general_message_request.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_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_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 (request *XMLSituationExchangeSubscriptionRequestEntry) LineRefs() []string {
        if len(request.lineRefs) == 0 {
            nodes := request.findNodes("LineRef")
            for _, lineRef := range nodes {
                request.lineRefs = append(request.lineRefs, strings.TrimSpace(lineRef.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/situation_exchange_subscription_request_entry.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_reponse.go on lines 534..542
    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 (request *XMLVehicleMonitoringRequest) Lines() []string {
        if len(request.lines) == 0 {
            nodes := request.findNodes("LineRef")
            for _, node := range nodes {
                request.lines = append(request.lines, strings.TrimSpace(node.NativeNode().Content()))
    Severity: Major
    Found in siri/sxml/vehicle_monitoring_request.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_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

    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

    Severity
    Category
    Status
    Source
    Language