Showing 525 of 525 total issues

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

func (manager *MemoryStopAreas) FindByCode(code Code) (*StopArea, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/stop_area.go and 5 other locations - About 45 mins to fix
model/lines.go on lines 241..251
model/operator.go on lines 142..152
model/stop_visit.go on lines 325..335
model/vehicle_journey.go on lines 229..239
model/vehicles.go on lines 181..190

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (manager *MemoryVehicleJourneys) FindByCode(code Code) (*VehicleJourney, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/vehicle_journey.go and 5 other locations - About 45 mins to fix
model/lines.go on lines 241..251
model/operator.go on lines 142..152
model/stop_area.go on lines 283..293
model/stop_visit.go on lines 325..335
model/vehicles.go on lines 181..190

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (manager *MemoryVehicles) FindByCode(code Code) (*Vehicle, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/vehicles.go and 5 other locations - About 45 mins to fix
model/lines.go on lines 241..251
model/operator.go on lines 142..152
model/stop_area.go on lines 283..293
model/stop_visit.go on lines 325..335
model/vehicle_journey.go on lines 229..239

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (manager *MemoryOperators) FindByCode(code Code) (*Operator, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/operator.go and 5 other locations - About 45 mins to fix
model/lines.go on lines 241..251
model/stop_area.go on lines 283..293
model/stop_visit.go on lines 325..335
model/vehicle_journey.go on lines 229..239
model/vehicles.go on lines 181..190

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (schedules *StopVisitSchedules) SetArrivalTime(kind StopVisitScheduleType, arrivalTime time.Time) {
    schedules.Lock()
    _, ok := schedules.byType[kind]
    if !ok {
        schedules.byType[kind] = &StopVisitSchedule{kind: kind}
Severity: Minor
Found in model/stop_visit_schedule.go and 1 other location - About 45 mins to fix
model/stop_visit_schedule.go on lines 175..183

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (manager *MemoryLines) FindByCode(code Code) (*Line, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/lines.go and 5 other locations - About 45 mins to fix
model/operator.go on lines 142..152
model/stop_area.go on lines 283..293
model/stop_visit.go on lines 325..335
model/vehicle_journey.go on lines 229..239
model/vehicles.go on lines 181..190

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (manager *MemoryStopVisits) FindByCode(code Code) (*StopVisit, bool) {
    manager.mutex.RLock()
    defer manager.mutex.RUnlock()

    id, ok := manager.byCode.Find(code)
Severity: Major
Found in model/stop_visit.go and 5 other locations - About 45 mins to fix
model/lines.go on lines 241..251
model/operator.go on lines 142..152
model/stop_area.go on lines 283..293
model/vehicle_journey.go on lines 229..239
model/vehicles.go on lines 181..190

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

    for _, subscription := range subscriptions {
        for _, resource := range subscription.ResourcesByCodeCopy() {
            if resource.SubscribedAt().IsZero() && resource.RetryCount <= 10 {
                messageIdentifier := subscriber.connector.Partner().NewMessageIdentifier()
                linesToRequest[messageIdentifier] = &lineToRequest{
Severity: Minor
Found in core/siri_vehicle_monitoring_subscriber.go and 1 other location - About 45 mins to fix
core/siri_stop_monitoring_subscriber.go on lines 99..109

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (schedules *StopVisitSchedules) SetDepartureTime(kind StopVisitScheduleType, departureTime time.Time) {
    schedules.Lock()
    _, ok := schedules.byType[kind]
    if !ok {
        schedules.byType[kind] = &StopVisitSchedule{kind: kind}
Severity: Minor
Found in model/stop_visit_schedule.go and 1 other location - About 45 mins to fix
model/stop_visit_schedule.go on lines 198..206

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

    for _, subscription := range subscriptions {
        for _, resource := range subscription.ResourcesByCodeCopy() {
            if resource.SubscribedAt().IsZero() && resource.RetryCount <= 10 {
                messageIdentifier := subscriber.connector.Partner().NewMessageIdentifier()
                stopAreasToRequest[messageIdentifier] = &saToRequest{
Severity: Minor
Found in core/siri_stop_monitoring_subscriber.go and 1 other location - About 45 mins to fix
core/siri_vehicle_monitoring_subscriber.go on lines 100..110

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (response *XMLDeleteSubscriptionResponse) ResponseStatus() []*XMLTerminationResponseStatus {
    if len(response.responseStatus) == 0 {
        nodes := response.findNodes("TerminationResponseStatus")
        if nodes == nil {
            return response.responseStatus
Severity: Minor
Found in siri/sxml/delete_subscription_response.go and 1 other location - About 45 mins to fix
siri/sxml/general_message_response.go on lines 119..130

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

func (client *SIRIClient) SituationExchangeMonitoring(request *siri.SIRIGetSituationExchangeRequest) (*sxml.XMLSituationExchangeResponse, error) {
    node, err := client.prepareAndSendRequest(siriClientArguments{
        request:           request,
        expectedResponses: []string{"GetSituationExchangeResponse"},
        acceptGzip:        true,
Severity: Major
Found in remote/siri_client.go and 4 other locations - About 45 mins to fix
remote/siri_client.go on lines 188..200
remote/siri_client.go on lines 216..228
remote/siri_client.go on lines 230..242
remote/siri_client.go on lines 258..270

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

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

        file_gtfs_realtime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*FeedHeader); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3312..3325
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3368..3381
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3480..3493
gtfs/gtfs-realtime.pb.go on lines 3494..3507
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549
gtfs/gtfs-realtime.pb.go on lines 3550..3563

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

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

        file_gtfs_realtime_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripUpdate); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3284..3297
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3368..3381
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3480..3493
gtfs/gtfs-realtime.pb.go on lines 3494..3507
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549
gtfs/gtfs-realtime.pb.go on lines 3550..3563

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

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

        file_gtfs_realtime_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripUpdate_StopTimeUpdate); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3284..3297
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3312..3325
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3368..3381
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3494..3507
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549
gtfs/gtfs-realtime.pb.go on lines 3550..3563

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

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

        file_gtfs_realtime_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*Position); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3284..3297
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3312..3325
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3480..3493
gtfs/gtfs-realtime.pb.go on lines 3494..3507
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549
gtfs/gtfs-realtime.pb.go on lines 3550..3563

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

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

        file_gtfs_realtime_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TranslatedImage_LocalizedImage); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3284..3297
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3312..3325
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3368..3381
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3480..3493
gtfs/gtfs-realtime.pb.go on lines 3494..3507
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549

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

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

func (client *SIRIClient) StopMonitoring(request *siri.SIRIGetStopMonitoringRequest) (*sxml.XMLStopMonitoringResponse, error) {
    node, err := client.prepareAndSendRequest(siriClientArguments{
        request:           request,
        expectedResponses: []string{"GetStopMonitoringResponse"},
        acceptGzip:        true,
Severity: Major
Found in remote/siri_client.go and 4 other locations - About 45 mins to fix
remote/siri_client.go on lines 188..200
remote/siri_client.go on lines 230..242
remote/siri_client.go on lines 244..256
remote/siri_client.go on lines 258..270

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

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

        file_gtfs_realtime_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripUpdate_TripProperties); i {
            case 0:
                return &v.state
            case 1:
Severity: Major
Found in gtfs/gtfs-realtime.pb.go and 20 other locations - About 45 mins to fix
gtfs/gtfs-realtime.pb.go on lines 3270..3283
gtfs/gtfs-realtime.pb.go on lines 3284..3297
gtfs/gtfs-realtime.pb.go on lines 3298..3311
gtfs/gtfs-realtime.pb.go on lines 3312..3325
gtfs/gtfs-realtime.pb.go on lines 3326..3339
gtfs/gtfs-realtime.pb.go on lines 3340..3353
gtfs/gtfs-realtime.pb.go on lines 3354..3367
gtfs/gtfs-realtime.pb.go on lines 3368..3381
gtfs/gtfs-realtime.pb.go on lines 3382..3395
gtfs/gtfs-realtime.pb.go on lines 3396..3409
gtfs/gtfs-realtime.pb.go on lines 3410..3423
gtfs/gtfs-realtime.pb.go on lines 3424..3437
gtfs/gtfs-realtime.pb.go on lines 3438..3451
gtfs/gtfs-realtime.pb.go on lines 3452..3465
gtfs/gtfs-realtime.pb.go on lines 3466..3479
gtfs/gtfs-realtime.pb.go on lines 3480..3493
gtfs/gtfs-realtime.pb.go on lines 3508..3521
gtfs/gtfs-realtime.pb.go on lines 3522..3535
gtfs/gtfs-realtime.pb.go on lines 3536..3549
gtfs/gtfs-realtime.pb.go on lines 3550..3563

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

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