Showing 525 of 525 total issues

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

        file_gtfs_realtime_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*VehiclePosition_CarriageDetails); 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 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[10].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*EntitySelector); 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 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 5 locations. Consider refactoring.
Open

func (client *SIRIClient) StopDiscovery(request *siri.SIRIStopPointsDiscoveryRequest) (*sxml.XMLStopPointsDiscoveryResponse, error) {
    node, err := client.prepareAndSendRequest(siriClientArguments{
        request:           request,
        expectedResponses: []string{"StopPointsDiscoveryResponse"},
        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 216..228
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[11].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TranslatedString); 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 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[12].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TranslatedImage); 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 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[0].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*FeedMessage); 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 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
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[9].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*VehicleDescriptor); 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 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[14].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripUpdate_StopTimeEvent); 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 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[5].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*Alert); 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 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[6].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TimeRange); 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 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[8].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripDescriptor); 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 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[13].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*Shape); 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 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 5 locations. Consider refactoring.
Open

func (client *SIRIClient) SituationMonitoring(request *siri.SIRIGetGeneralMessageRequest) (*sxml.XMLGeneralMessageResponse, error) {
    node, err := client.prepareAndSendRequest(siriClientArguments{
        request:           request,
        expectedResponses: []string{"GetGeneralMessageResponse"},
        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 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[2].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*FeedEntity); 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 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[4].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*VehiclePosition); 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 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 5 locations. Consider refactoring.
Open

func (client *SIRIClient) VehicleMonitoring(request *siri.SIRIGetVehicleMonitoringRequest) (*sxml.XMLVehicleMonitoringResponse, error) {
    node, err := client.prepareAndSendRequest(siriClientArguments{
        request:           request,
        expectedResponses: []string{"GetVehicleMonitoringResponse"},
        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 244..256

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[17].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TripUpdate_StopTimeUpdate_StopTimeProperties); 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 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[19].Exporter = func(v interface{}, i int) interface{} {
            switch v := v.(*TranslatedString_Translation); 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 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

Method SXSubscriber.prepareSIRISituationExchangeSubscriptionRequest has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
Open

func (subscriber *SXSubscriber) prepareSIRISituationExchangeSubscriptionRequest() {
    subscriptions := subscriber.connector.partner.Subscriptions().FindSubscriptionsByKind(SituationExchangeCollect)
    if len(subscriptions) == 0 {
        logger.Log.Debugf("SituationExchangeSubscriber visit without SituationExchangeCollect subscriptions")
        return
Severity: Minor
Found in core/siri_situation_exchange_subscriber.go - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method MemoryReferentials.SaveToDatabase has 7 return statements (exceeds 4 allowed).
Open

func (manager *MemoryReferentials) SaveToDatabase() (int, error) {
    // Begin transaction
    tx, err := model.Database.Begin()
    if err != nil {
        return http.StatusInternalServerError, fmt.Errorf("database error: %v", err)
Severity: Major
Found in core/referential.go - About 45 mins to fix
    Severity
    Category
    Status
    Source
    Language