Showing 525 of 525 total issues

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

func (response *XMLStopMonitoringResponse) StopMonitoringDeliveries() []*XMLStopMonitoringDelivery {
    if response.deliveries == nil {
        deliveries := []*XMLStopMonitoringDelivery{}
        nodes := response.findNodes("StopMonitoringDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/stop_monitoring_response.go and 27 other locations - About 40 mins to fix
siri/sxml/estimated_timetable_response.go on lines 48..58
siri/sxml/estimated_timetable_response.go on lines 60..70
siri/sxml/estimated_timetable_response.go on lines 72..82
siri/sxml/lines_discovery_response.go on lines 57..67
siri/sxml/notify_estimated_timetable.go on lines 26..36
siri/sxml/notify_estimated_timetable.go on lines 53..63
siri/sxml/notify_general_message.go on lines 42..52
siri/sxml/notify_general_message.go on lines 64..74
siri/sxml/notify_situation_exchange.go on lines 29..39
siri/sxml/notify_stop_monitoring.go on lines 29..39
siri/sxml/notify_stop_monitoring.go on lines 48..58
siri/sxml/notify_stop_monitoring.go on lines 60..70
siri/sxml/notify_vehicle_monitoring.go on lines 41..51
siri/sxml/notify_vehicle_monitoring.go on lines 53..63
siri/sxml/situation_exchange_reponse.go on lines 174..184
siri/sxml/situation_exchange_reponse.go on lines 186..196
siri/sxml/situation_exchange_reponse.go on lines 277..287
siri/sxml/situation_exchange_reponse.go on lines 289..299
siri/sxml/situation_exchange_reponse.go on lines 343..353
siri/sxml/situation_exchange_reponse.go on lines 355..365
siri/sxml/situation_exchange_reponse.go on lines 374..384
siri/sxml/situation_exchange_reponse.go on lines 415..425
siri/sxml/stop_monitoring_response.go on lines 141..151
siri/sxml/stop_monitoring_response.go on lines 153..163
siri/sxml/stop_points_discovery_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 72..82

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

        switch requestedResource.kind {
        case "Line":
            entry.LineRef = []string{requestedResource.code.Value()}
            lineRefList = append(lineRefList, requestedResource.code.Value())
        case "StopArea":
Severity: Minor
Found in core/siri_situation_exchange_subscriber.go and 1 other location - About 40 mins to fix
core/siri_general_message_subscriber.go on lines 139..146

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

func (notify *XMLNotifyVehicleMonitoring) VehicleMonitoringDeliveries() []*XMLNotifyVehicleMonitoringDelivery {
    if notify.deliveries == nil {
        deliveries := []*XMLNotifyVehicleMonitoringDelivery{}
        nodes := notify.findNodes("VehicleMonitoringDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_vehicle_monitoring.go and 27 other locations - About 40 mins to fix
siri/sxml/estimated_timetable_response.go on lines 48..58
siri/sxml/estimated_timetable_response.go on lines 60..70
siri/sxml/estimated_timetable_response.go on lines 72..82
siri/sxml/lines_discovery_response.go on lines 57..67
siri/sxml/notify_estimated_timetable.go on lines 26..36
siri/sxml/notify_estimated_timetable.go on lines 53..63
siri/sxml/notify_general_message.go on lines 42..52
siri/sxml/notify_general_message.go on lines 64..74
siri/sxml/notify_situation_exchange.go on lines 29..39
siri/sxml/notify_stop_monitoring.go on lines 29..39
siri/sxml/notify_stop_monitoring.go on lines 48..58
siri/sxml/notify_stop_monitoring.go on lines 60..70
siri/sxml/notify_vehicle_monitoring.go on lines 53..63
siri/sxml/situation_exchange_reponse.go on lines 174..184
siri/sxml/situation_exchange_reponse.go on lines 186..196
siri/sxml/situation_exchange_reponse.go on lines 277..287
siri/sxml/situation_exchange_reponse.go on lines 289..299
siri/sxml/situation_exchange_reponse.go on lines 343..353
siri/sxml/situation_exchange_reponse.go on lines 355..365
siri/sxml/situation_exchange_reponse.go on lines 374..384
siri/sxml/situation_exchange_reponse.go on lines 415..425
siri/sxml/stop_monitoring_response.go on lines 122..132
siri/sxml/stop_monitoring_response.go on lines 141..151
siri/sxml/stop_monitoring_response.go on lines 153..163
siri/sxml/stop_points_discovery_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 72..82

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

func (notify *XMLNotifySituationExchange) SituationExchangesDeliveries() []*XMLSituationExchangeDelivery {
    if notify.deliveries == nil {
        deliveries := []*XMLSituationExchangeDelivery{}
        nodes := notify.findNodes("SituationExchangeDelivery")
        for _, node := range nodes {
Severity: Major
Found in siri/sxml/notify_situation_exchange.go and 27 other locations - About 40 mins to fix
siri/sxml/estimated_timetable_response.go on lines 48..58
siri/sxml/estimated_timetable_response.go on lines 60..70
siri/sxml/estimated_timetable_response.go on lines 72..82
siri/sxml/lines_discovery_response.go on lines 57..67
siri/sxml/notify_estimated_timetable.go on lines 26..36
siri/sxml/notify_estimated_timetable.go on lines 53..63
siri/sxml/notify_general_message.go on lines 42..52
siri/sxml/notify_general_message.go on lines 64..74
siri/sxml/notify_stop_monitoring.go on lines 29..39
siri/sxml/notify_stop_monitoring.go on lines 48..58
siri/sxml/notify_stop_monitoring.go on lines 60..70
siri/sxml/notify_vehicle_monitoring.go on lines 41..51
siri/sxml/notify_vehicle_monitoring.go on lines 53..63
siri/sxml/situation_exchange_reponse.go on lines 174..184
siri/sxml/situation_exchange_reponse.go on lines 186..196
siri/sxml/situation_exchange_reponse.go on lines 277..287
siri/sxml/situation_exchange_reponse.go on lines 289..299
siri/sxml/situation_exchange_reponse.go on lines 343..353
siri/sxml/situation_exchange_reponse.go on lines 355..365
siri/sxml/situation_exchange_reponse.go on lines 374..384
siri/sxml/situation_exchange_reponse.go on lines 415..425
siri/sxml/stop_monitoring_response.go on lines 122..132
siri/sxml/stop_monitoring_response.go on lines 141..151
siri/sxml/stop_monitoring_response.go on lines 153..163
siri/sxml/stop_points_discovery_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 60..70
siri/sxml/vehicle_monitoring_response.go on lines 72..82

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

func (request *XMLSubscriptionRequest) XMLSubscriptionSMEntries() []*XMLStopMonitoringSubscriptionRequestEntry {
    if len(request.smEntries) != 0 {
        return request.smEntries
    }
    nodes := request.findNodes("StopMonitoringSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 50..59
siri/sxml/subscription_request.go on lines 61..70
siri/sxml/subscription_request.go on lines 72..81
siri/sxml/subscription_request.go on lines 83..92
siri/sxml/subscription_request.go on lines 94..103

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

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

func (request *XMLSubscriptionRequest) XMLSubscriptionETTEntries() []*XMLEstimatedTimetableSubscriptionRequestEntry {
    if len(request.ettEntries) != 0 {
        return request.ettEntries
    }
    nodes := request.findNodes("EstimatedTimetableSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 39..48
siri/sxml/subscription_request.go on lines 61..70
siri/sxml/subscription_request.go on lines 72..81
siri/sxml/subscription_request.go on lines 83..92
siri/sxml/subscription_request.go on lines 94..103

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

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

func (request *XMLSubscriptionRequest) XMLSubscriptionGMEntries() []*XMLGeneralMessageSubscriptionRequestEntry {
    if len(request.gmEntries) != 0 {
        return request.gmEntries
    }
    nodes := request.findNodes("GeneralMessageSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 39..48
siri/sxml/subscription_request.go on lines 50..59
siri/sxml/subscription_request.go on lines 61..70
siri/sxml/subscription_request.go on lines 72..81
siri/sxml/subscription_request.go on lines 94..103

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

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

func (request *XMLSubscriptionRequest) XMLSubscriptionPTTEntries() []*XMLProductionTimetableSubscriptionRequestEntry {
    if len(request.pttEntries) != 0 {
        return request.pttEntries
    }
    nodes := request.findNodes("ProductionTimetableSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 39..48
siri/sxml/subscription_request.go on lines 50..59
siri/sxml/subscription_request.go on lines 61..70
siri/sxml/subscription_request.go on lines 83..92
siri/sxml/subscription_request.go on lines 94..103

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

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

func (request *XMLSubscriptionRequest) XMLSubscriptionSXEntries() []*XMLSituationExchangeSubscriptionRequestEntry {
    if len(request.sxEntries) != 0 {
        return request.sxEntries
    }
    nodes := request.findNodes("SituationExchangeSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 39..48
siri/sxml/subscription_request.go on lines 50..59
siri/sxml/subscription_request.go on lines 61..70
siri/sxml/subscription_request.go on lines 72..81
siri/sxml/subscription_request.go on lines 83..92

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

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 (line *Line) ReferentOrSelfCode(codeSpace string) (Code, bool) {
    ref, ok := line.Referent()
    if ok {
        code, ok := ref.Code(codeSpace)
        if ok {
Severity: Minor
Found in model/lines.go and 1 other location - About 35 mins to fix
model/stop_area.go on lines 180..193

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

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

func (request *XMLSubscriptionRequest) XMLSubscriptionVMEntries() []*XMLVehicleMonitoringSubscriptionRequestEntry {
    if len(request.vmEntries) != 0 {
        return request.vmEntries
    }
    nodes := request.findNodes("VehicleMonitoringSubscriptionRequest")
Severity: Major
Found in siri/sxml/subscription_request.go and 5 other locations - About 35 mins to fix
siri/sxml/subscription_request.go on lines 39..48
siri/sxml/subscription_request.go on lines 50..59
siri/sxml/subscription_request.go on lines 72..81
siri/sxml/subscription_request.go on lines 83..92
siri/sxml/subscription_request.go on lines 94..103

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

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 (stopArea *StopArea) ReferentOrSelfCode(codeSpace string) (Code, bool) {
    ref, ok := stopArea.Referent()
    if ok {
        code, ok := ref.Code(codeSpace)
        if ok {
Severity: Minor
Found in model/stop_area.go and 1 other location - About 35 mins to fix
model/lines.go on lines 127..140

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

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 logXMLStopPointsDiscoveryResponse(message *audit.BigQueryMessage, response *sxml.XMLStopPointsDiscoveryResponse) {
    if !response.Status() {
        message.Status = "Error"
        message.ErrorDetails = response.ErrorString()
    }
Severity: Minor
Found in core/siri_stop_points_discovery_request_collector.go and 1 other location - About 35 mins to fix
core/siri_lines_discovery_request_collector.go on lines 129..137

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

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 logXMLLinesDiscoveryResponse(message *audit.BigQueryMessage, response *sxml.XMLLinesDiscoveryResponse) {
    if !response.Status() {
        message.Status = "Error"
        message.ErrorDetails = response.ErrorString()
    }
Severity: Minor
Found in core/siri_lines_discovery_request_collector.go and 1 other location - About 35 mins to fix
core/siri_stop_points_discovery_request_collector.go on lines 131..139

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

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 (connector *SIRIEstimatedTimetableSubscriptionBroadcaster) directionType(direction string) (dir string) {
    in, out, err := connector.partner.PartnerSettings.SIRIDirectionType()
    if err {
        return direction
    }
Severity: Minor
Found in core/estimated_timetable_broadcaster.go and 2 other locations - About 35 mins to fix
core/broadcast_stop_monitoring_builder.go on lines 186..202
core/production_timetable_broadcaster.go on lines 262..278

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

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

        if sa.References.Valid && len(sa.References.String) > 0 {
            references := make(map[string]Reference)
            if err = json.Unmarshal([]byte(sa.References.String), &references); err != nil {
                return err
            }
Severity: Major
Found in model/stop_area.go and 3 other locations - About 35 mins to fix
model/lines.go on lines 357..363
model/stop_visit.go on lines 604..610
model/vehicle_journey.go on lines 335..341

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

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 (builder *EstimatedTimetableUpdateEventBuilder) directionRef(direction string) (dir string) {
    in, out, err := builder.partner.PartnerSettings.SIRIDirectionType()
    if err {
        return direction
    }
Severity: Minor
Found in core/estimated_timetable_update_event_builder.go and 2 other locations - About 35 mins to fix
core/stop_monitoring_update_event_builder.go on lines 136..152
core/vehicle_monitoring_update_event_builder.go on lines 151..167

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

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

        if vj.References.Valid && len(vj.References.String) > 0 {
            references := make(map[string]Reference)
            if err = json.Unmarshal([]byte(vj.References.String), &references); err != nil {
                return err
            }
Severity: Major
Found in model/vehicle_journey.go and 3 other locations - About 35 mins to fix
model/lines.go on lines 357..363
model/stop_area.go on lines 541..547
model/stop_visit.go on lines 604..610

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

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

        if sl.References.Valid && len(sl.References.String) > 0 {
            references := make(map[string]Reference)
            if err = json.Unmarshal([]byte(sl.References.String), &references); err != nil {
                return err
            }
Severity: Major
Found in model/lines.go and 3 other locations - About 35 mins to fix
model/stop_area.go on lines 541..547
model/stop_visit.go on lines 604..610
model/vehicle_journey.go on lines 335..341

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

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