Showing 546 of 546 total issues

Similar blocks of code found in 17 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 16 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 148..155
siri/siri/estimated_timetable_response.go on lines 172..179
siri/siri/general_message_response.go on lines 108..115
siri/siri/general_message_response.go on lines 117..124
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_response.go on lines 150..157
siri/siri/situation_exchange_response.go on lines 159..166
siri/siri/situation_exchange_response.go on lines 168..175
siri/siri/translated_string.go on lines 16..23
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 148..156
siri/siri/vehicle_monitoring_response.go on lines 158..166
siri/siri/vehicle_monitoring_response.go on lines 168..176

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

func (affects *SIRIAffects) BuildSituationAffectsXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "situation_affects.template", affects); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/situation_exchange_response.go and 16 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 148..155
siri/siri/estimated_timetable_response.go on lines 172..179
siri/siri/general_message_response.go on lines 108..115
siri/siri/general_message_response.go on lines 117..124
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 150..157
siri/siri/situation_exchange_response.go on lines 159..166
siri/siri/translated_string.go on lines 16..23
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 148..156
siri/siri/vehicle_monitoring_response.go on lines 158..166
siri/siri/vehicle_monitoring_response.go on lines 168..176

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

func (request *SIRIEstimatedTimetableRequest) BuildEstimatedTimetableRequestXMLRaw() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "estimated_timetable_request_raw.template", request); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/estimated_timetable_request.go and 16 other locations - About 40 mins to fix
siri/siri/estimated_timetable_request.go on lines 58..66
siri/siri/estimated_timetable_response.go on lines 148..155
siri/siri/estimated_timetable_response.go on lines 172..179
siri/siri/general_message_response.go on lines 108..115
siri/siri/general_message_response.go on lines 117..124
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 150..157
siri/siri/situation_exchange_response.go on lines 159..166
siri/siri/situation_exchange_response.go on lines 168..175
siri/siri/translated_string.go on lines 16..23
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 148..156
siri/siri/vehicle_monitoring_response.go on lines 158..166
siri/siri/vehicle_monitoring_response.go on lines 168..176

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

func (t *SIRITranslatedString) BuildTranslatedStringXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "translated_string.template", t); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/translated_string.go and 16 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 148..155
siri/siri/estimated_timetable_response.go on lines 172..179
siri/siri/general_message_response.go on lines 108..115
siri/siri/general_message_response.go on lines 117..124
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 150..157
siri/siri/situation_exchange_response.go on lines 159..166
siri/siri/situation_exchange_response.go on lines 168..175
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 148..156
siri/siri/vehicle_monitoring_response.go on lines 158..166
siri/siri/vehicle_monitoring_response.go on lines 168..176

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

func (delivery *SIRIEstimatedTimetableDelivery) BuildEstimatedTimetableDeliveryXMLRaw() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "estimated_timetable_delivery_raw.template", delivery); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/estimated_timetable_response.go and 16 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 148..155
siri/siri/general_message_response.go on lines 108..115
siri/siri/general_message_response.go on lines 117..124
siri/siri/production_timetable_response.go on lines 76..84
siri/siri/situation_exchange_request.go on lines 62..69
siri/siri/situation_exchange_response.go on lines 150..157
siri/siri/situation_exchange_response.go on lines 159..166
siri/siri/situation_exchange_response.go on lines 168..175
siri/siri/translated_string.go on lines 16..23
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 148..156
siri/siri/vehicle_monitoring_response.go on lines 158..166
siri/siri/vehicle_monitoring_response.go on lines 168..176

Duplicated Code

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

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

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

Tuning

This issue has a mass of 108.

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

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

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

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

Refactorings

Further Reading

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

func 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 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 195..208

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

        if sv.References.Valid && len(sv.References.String) > 0 {
            references := make(map[string]Reference)
            if err = json.Unmarshal([]byte(sv.References.String), &references); err != nil {
                return err
            }
Severity: Major
Found in model/stop_visit.go and 3 other locations - About 35 mins to fix
model/lines.go on lines 357..363
model/stop_area.go on lines 548..554
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 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 548..554
model/stop_visit.go on lines 605..611
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 *BroadcastStopMonitoringBuilder) directionType(direction string) (dir string) {
    in, out, err := builder.partner.PartnerSettings.SIRIDirectionType()
    if err {
        return direction
    }
Severity: Minor
Found in core/broadcast_stop_monitoring_builder.go and 2 other locations - About 35 mins to fix
core/estimated_timetable_broadcaster.go on lines 304..320
core/production_timetable_broadcaster.go on lines 264..280

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

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 548..554
model/stop_visit.go on lines 605..611

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

func (builder *StopMonitoringUpdateEventBuilder) directionRef(direction string) (dir string) {
    in, out, err := builder.partner.PartnerSettings.SIRIDirectionType()
    if err {
        return direction
    }
Severity: Minor
Found in core/stop_monitoring_update_event_builder.go and 2 other locations - About 35 mins to fix
core/estimated_timetable_update_event_builder.go on lines 145..161
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 3 locations. Consider refactoring.
Open

func (connector *SIRIProductionTimetableSubscriptionBroadcaster) directionType(direction string) (dir string) {
    in, out, err := connector.partner.PartnerSettings.SIRIDirectionType()
    if err {
        return direction
    }
Severity: Minor
Found in core/production_timetable_broadcaster.go and 2 other locations - About 35 mins to fix
core/broadcast_stop_monitoring_builder.go on lines 188..204
core/estimated_timetable_broadcaster.go on lines 304..320

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 (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 188..204
core/production_timetable_broadcaster.go on lines 264..280

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

Method MemoryVehicleJourneys.Load has 5 return statements (exceeds 4 allowed).
Open

func (manager *MemoryVehicleJourneys) Load(referentialSlug string) error {
    var selectVehicleJourneys []SelectVehicleJourney
    modelName := manager.model.Date()
    sqlQuery := fmt.Sprintf("select * from vehicle_journeys where referential_slug = '%s' and model_name = '%s'", referentialSlug, modelName.String())
    _, err := Database.Select(&selectVehicleJourneys, sqlQuery)
Severity: Major
Found in model/vehicle_journey.go - About 35 mins to fix
    Severity
    Category
    Status
    Source
    Language