Showing 391 of 525 total issues

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

func (request *SIRIStopMonitoringRequest) BuildStopMonitoringRequestXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "stop_monitoring_request.template", request); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/stop_monitoring_request.go and 8 other locations - About 30 mins to fix
siri/siri/general_message_request.go on lines 62..69
siri/siri/general_message_response.go on lines 93..100
siri/siri/general_message_response.go on lines 102..109
siri/siri/notify_stop_monitoring.go on lines 67..74
siri/siri/production_timetable_response.go on lines 67..74
siri/siri/stop_monitoring_response.go on lines 114..121
siri/siri/stop_monitoring_response.go on lines 123..130
siri/siri/stop_monitoring_response.go on lines 132..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 100.

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

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

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

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

Refactorings

Further Reading

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

func (delivery *SIRIGeneralMessageDelivery) BuildGeneralMessageDeliveryXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "general_message_delivery.template", delivery); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/general_message_response.go and 8 other locations - About 30 mins to fix
siri/siri/general_message_request.go on lines 62..69
siri/siri/general_message_response.go on lines 102..109
siri/siri/notify_stop_monitoring.go on lines 67..74
siri/siri/production_timetable_response.go on lines 67..74
siri/siri/stop_monitoring_request.go on lines 57..64
siri/siri/stop_monitoring_response.go on lines 114..121
siri/siri/stop_monitoring_response.go on lines 123..130
siri/siri/stop_monitoring_response.go on lines 132..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 100.

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

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

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

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

Refactorings

Further Reading

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

func (request *SIRIGeneralMessageRequest) BuildGeneralMessageRequestXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "general_message_request.template", request); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/general_message_request.go and 8 other locations - About 30 mins to fix
siri/siri/general_message_response.go on lines 93..100
siri/siri/general_message_response.go on lines 102..109
siri/siri/notify_stop_monitoring.go on lines 67..74
siri/siri/production_timetable_response.go on lines 67..74
siri/siri/stop_monitoring_request.go on lines 57..64
siri/siri/stop_monitoring_response.go on lines 114..121
siri/siri/stop_monitoring_response.go on lines 123..130
siri/siri/stop_monitoring_response.go on lines 132..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 100.

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

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

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

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

Refactorings

Further Reading

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

func (an *XMLAffectedNetwork) AffectedSections() []*XMLAffectedSection {
    if len(an.affectedSections) == 0 {
        nodes := an.findNodes("AffectedSection")
        for _, section := range nodes {
            an.affectedSections = append(an.affectedSections, NewXMLAffectedSection(section))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 427..435
siri/sxml/situation_exchange_reponse.go on lines 447..455

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

func (an *XMLAffectedNetwork) AffectedRoutes() []*XMLAffectedRoute {
    if len(an.affectedRoutes) == 0 {
        nodes := an.findNodes("AffectedRoute")
        for _, affectedRoute := range nodes {
            an.affectedRoutes = append(an.affectedRoutes, NewXMLAffectedRoute(affectedRoute))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 427..435
siri/sxml/situation_exchange_reponse.go on lines 478..486

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

func (frame *SIRIDatedTimetableVersionFrame) BuildDatedTimetableVersionFrameXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "dated_timetable_version_frame.template", frame); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/production_timetable_response.go and 8 other locations - About 30 mins to fix
siri/siri/general_message_request.go on lines 62..69
siri/siri/general_message_response.go on lines 93..100
siri/siri/general_message_response.go on lines 102..109
siri/siri/notify_stop_monitoring.go on lines 67..74
siri/siri/stop_monitoring_request.go on lines 57..64
siri/siri/stop_monitoring_response.go on lines 114..121
siri/siri/stop_monitoring_response.go on lines 123..130
siri/siri/stop_monitoring_response.go on lines 132..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 100.

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

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

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

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

Refactorings

Further Reading

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

func (a *XMLAffect) AffectedNetworks() []*XMLAffectedNetwork {
    if len(a.affectedNetworks) == 0 {
        nodes := a.findNodes("AffectedNetwork")
        for _, affectedNetwork := range nodes {
            a.affectedNetworks = append(a.affectedNetworks, NewXMLAffectedNetwork(affectedNetwork))
Severity: Major
Found in siri/sxml/situation_exchange_reponse.go and 3 other locations - About 30 mins to fix
siri/sxml/general_message_response.go on lines 242..250
siri/sxml/situation_exchange_reponse.go on lines 447..455
siri/sxml/situation_exchange_reponse.go on lines 478..486

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

func (delivery *SIRIStopMonitoringDelivery) BuildStopMonitoringDeliveryXML() (string, error) {
    var buffer bytes.Buffer
    if err := templates.ExecuteTemplate(&buffer, "stop_monitoring_delivery.template", delivery); err != nil {
        logger.Log.Debugf("Error while executing template: %v", err)
        return "", err
Severity: Major
Found in siri/siri/stop_monitoring_response.go and 8 other locations - About 30 mins to fix
siri/siri/general_message_request.go on lines 62..69
siri/siri/general_message_response.go on lines 93..100
siri/siri/general_message_response.go on lines 102..109
siri/siri/notify_stop_monitoring.go on lines 67..74
siri/siri/production_timetable_response.go on lines 67..74
siri/siri/stop_monitoring_request.go on lines 57..64
siri/siri/stop_monitoring_response.go on lines 123..130
siri/siri/stop_monitoring_response.go on lines 132..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 100.

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

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

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

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

Refactorings

Further Reading

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

func (visit *IDFGeneralMessageStructure) LineSections() []*IDFLineSectionStructure {
    if len(visit.lineSections) == 0 {
        nodes := visit.findNodes("LineSection")
        for _, lineNode := range nodes {
            visit.lineSections = append(visit.lineSections, NewXMLLineSection(lineNode))
Severity: Major
Found in siri/sxml/general_message_response.go and 3 other locations - About 30 mins to fix
siri/sxml/situation_exchange_reponse.go on lines 427..435
siri/sxml/situation_exchange_reponse.go on lines 447..455
siri/sxml/situation_exchange_reponse.go on lines 478..486

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

func (builder *BroadcastGeneralMessageBuilder) SetLineRef(lineRef []string) {
    if (len(lineRef) == 0) || (len(lineRef) == 1 && lineRef[0] == "") {
        return
    }

Severity: Minor
Found in core/broadcast_general_message_builder.go and 1 other location - About 30 mins to fix
core/broadcast_general_message_builder.go on lines 45..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

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

func (builder *BroadcastGeneralMessageBuilder) SetStopPointRef(stopPointRef []string) {
    if (len(stopPointRef) == 0) || (len(stopPointRef) == 1 && stopPointRef[0] == "") {
        return
    }

Severity: Minor
Found in core/broadcast_general_message_builder.go and 1 other location - About 30 mins to fix
core/broadcast_general_message_builder.go on lines 35..43

Duplicated Code

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

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

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

Tuning

This issue has a mass of 100.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language