siri/sxml/situation_exchange_reponse.go

Summary

Maintainability
D
2 days
Test Coverage

File situation_exchange_reponse.go has 749 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package sxml

import (
    "fmt"
    "strings"
Severity: Minor
Found in siri/sxml/situation_exchange_reponse.go - About 1 day to fix

    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 614..627

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

    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 565..578

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

    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(siri_attributes.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 50 mins to fix
    siri/sxml/estimated_timetable_request.go on lines 42..50
    siri/sxml/general_message_request.go on lines 50..58
    siri/sxml/general_message_request.go on lines 60..68
    siri/sxml/general_message_request.go on lines 70..78
    siri/sxml/general_message_request.go on lines 80..88
    siri/sxml/general_message_request.go on lines 90..98
    siri/sxml/general_message_response.go on lines 209..217
    siri/sxml/general_message_response.go on lines 219..227
    siri/sxml/general_message_response.go on lines 229..237
    siri/sxml/production_timetable_request.go on lines 19..27
    siri/sxml/situation_exchange_reponse.go on lines 539..547
    siri/sxml/situation_exchange_reponse.go on lines 636..644
    siri/sxml/situation_exchange_request.go on lines 46..54
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 45..53
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 55..63
    siri/sxml/stop_points_discovery_response.go on lines 87..95
    siri/sxml/vehicle_monitoring_request.go on lines 42..50

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

    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(siri_attributes.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 50 mins to fix
    siri/sxml/estimated_timetable_request.go on lines 42..50
    siri/sxml/general_message_request.go on lines 50..58
    siri/sxml/general_message_request.go on lines 60..68
    siri/sxml/general_message_request.go on lines 70..78
    siri/sxml/general_message_request.go on lines 80..88
    siri/sxml/general_message_request.go on lines 90..98
    siri/sxml/general_message_response.go on lines 209..217
    siri/sxml/general_message_response.go on lines 219..227
    siri/sxml/general_message_response.go on lines 229..237
    siri/sxml/production_timetable_request.go on lines 19..27
    siri/sxml/situation_exchange_reponse.go on lines 604..612
    siri/sxml/situation_exchange_reponse.go on lines 636..644
    siri/sxml/situation_exchange_request.go on lines 46..54
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 45..53
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 55..63
    siri/sxml/stop_points_discovery_response.go on lines 87..95
    siri/sxml/vehicle_monitoring_request.go on lines 42..50

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

    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(siri_attributes.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 50 mins to fix
    siri/sxml/estimated_timetable_request.go on lines 42..50
    siri/sxml/general_message_request.go on lines 50..58
    siri/sxml/general_message_request.go on lines 60..68
    siri/sxml/general_message_request.go on lines 70..78
    siri/sxml/general_message_request.go on lines 80..88
    siri/sxml/general_message_request.go on lines 90..98
    siri/sxml/general_message_response.go on lines 209..217
    siri/sxml/general_message_response.go on lines 219..227
    siri/sxml/general_message_response.go on lines 229..237
    siri/sxml/production_timetable_request.go on lines 19..27
    siri/sxml/situation_exchange_reponse.go on lines 539..547
    siri/sxml/situation_exchange_reponse.go on lines 604..612
    siri/sxml/situation_exchange_request.go on lines 46..54
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 45..53
    siri/sxml/situation_exchange_subscription_request_entry.go on lines 55..63
    siri/sxml/stop_points_discovery_response.go on lines 87..95
    siri/sxml/vehicle_monitoring_request.go on lines 42..50

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

    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 (wa *XMLPublishToWebAction) SocialNetworks() []string {
        if len(wa.socialNetworks) == 0 {
            socialNetworks := wa.findNodes("SocialNetwork")
            for _, network := range socialNetworks {
                wa.socialNetworks = append(wa.socialNetworks, strings.TrimSpace(network.NativeNode().Content()))
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 1 other location - About 45 mins to fix
    siri/sxml/general_message_response.go on lines 239..247

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

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

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 112.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    func (visit *XMLPtSituationElement) Affects() []*XMLAffect {
        if visit.affects == nil {
            affects := []*XMLAffect{}
            nodes := visit.findDirectChildrenNodes("Affects")
            for _, node := range nodes {
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 1 other location - About 40 mins to fix
    siri/sxml/situation_exchange_reponse.go on lines 828..838

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

    func (ad *XMLActionData) Affects() []*XMLAffect {
        if ad.affects == nil {
            affects := []*XMLAffect{}
            nodes := ad.findNodes("Affects")
            for _, node := range nodes {
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 1 other location - About 40 mins to fix
    siri/sxml/situation_exchange_reponse.go on lines 507..517

    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) AffectedSections() []*XMLAffectedSection {
        if len(an.affectedSections) == 0 {
            nodes := an.findNodes(siri_attributes.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 35 mins to fix
    siri/sxml/general_message_response.go on lines 249..257
    siri/sxml/situation_exchange_reponse.go on lines 519..527
    siri/sxml/situation_exchange_reponse.go on lines 549..557

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

    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(siri_attributes.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 35 mins to fix
    siri/sxml/general_message_response.go on lines 249..257
    siri/sxml/situation_exchange_reponse.go on lines 549..557
    siri/sxml/situation_exchange_reponse.go on lines 580..588

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

    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(siri_attributes.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 35 mins to fix
    siri/sxml/general_message_response.go on lines 249..257
    siri/sxml/situation_exchange_reponse.go on lines 519..527
    siri/sxml/situation_exchange_reponse.go on lines 580..588

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

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

    func (visit *XMLPtSituationElement) PublishToWebActions() []*XMLPublishToWebAction {
        if len(visit.publishToWebActions) == 0 {
            nodes := visit.findNodes("PublishToWebAction")
            for _, publishToWebAction := range nodes {
                visit.publishToWebActions = append(visit.publishToWebActions, NewXMLPublishToWebAction(publishToWebAction))
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 2 other locations - About 30 mins to fix
    siri/sxml/situation_exchange_reponse.go on lines 740..748
    siri/sxml/situation_exchange_reponse.go on lines 780..788

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

    func (visit *XMLPtSituationElement) PublishToDisplayActions() []*XMLPublishToDisplayAction {
            if len(visit.publishToDisplayActions) == 0 {
            nodes := visit.findNodes("PublishToDisplayAction")
            for _, publishToDisplay := range nodes {
                visit.publishToDisplayActions = append(visit.publishToDisplayActions, NewXMLPublishToDisplayAction(publishToDisplay))
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 2 other locations - About 30 mins to fix
    siri/sxml/situation_exchange_reponse.go on lines 646..654
    siri/sxml/situation_exchange_reponse.go on lines 740..748

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

    func (visit *XMLPtSituationElement) PublishToMobileActions() []*XMLPublishToMobileAction {
        if len(visit.publishToMobileActions) == 0 {
            nodes := visit.findNodes("PublishToMobileAction")
            for _, publishToMobileAction := range nodes {
                visit.publishToMobileActions = append(visit.publishToMobileActions, NewXMLPublishToMobileAction(publishToMobileAction))
    Severity: Minor
    Found in siri/sxml/situation_exchange_reponse.go and 2 other locations - About 30 mins to fix
    siri/sxml/situation_exchange_reponse.go on lines 646..654
    siri/sxml/situation_exchange_reponse.go on lines 780..788

    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