Showing 525 of 525 total issues

Method BroadcastSituationExchangeBuilder.canBroadcast has 5 return statements (exceeds 4 allowed).
Open

func (builder *BroadcastSituationExchangeBuilder) canBroadcast(situation model.Situation) bool {
    if situation.Origin == string(builder.partner.Slug()) {
        return false
    }

Severity: Major
Found in core/broadcast_situation_exchange_builder.go - About 35 mins to fix

    Method TimeController.serve has 5 return statements (exceeds 4 allowed).
    Open

    func (controller *TimeController) serve(response http.ResponseWriter, request *http.Request, requestData *RequestData) {
        switch {
        case request.Method == "GET":
            if requestData.Resource != "" {
                http.Error(response, "Invalid request", http.StatusBadRequest)
    Severity: Major
    Found in api/time_controller.go - About 35 mins to fix

      Method StopMonitoringLastChange.Haschanged has 5 return statements (exceeds 4 allowed).
      Open

      func (smlc *StopMonitoringLastChange) Haschanged(stopVisit *model.StopVisit) bool {
          // Don't send info on cancelled or departed SV
          if smlc.departureStatus == model.STOP_VISIT_DEPARTURE_DEPARTED || smlc.departureStatus == model.STOP_VISIT_DEPARTURE_CANCELLED || smlc.arrivalStatuts == model.STOP_VISIT_ARRIVAL_CANCELLED {
              return false
          }
      Severity: Major
      Found in core/ls/stop_monitoring_lc.go - About 35 mins to fix

        Method Loader.Load has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
        Open

        func (loader Loader) Load(reader io.Reader) Result {
            // Config CSV reader
            csvReader := csv.NewReader(reader)
            csvReader.Comment = '#'
            csvReader.FieldsPerRecord = -1
        Severity: Minor
        Found in model/load_from_csv.go - About 35 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 SIRIEstimatedTimetableRequestBroadcaster.stopPointRef has 5 return statements (exceeds 4 allowed).
        Open

        func (connector *SIRIEstimatedTimetableRequestBroadcaster) stopPointRef(stopAreaId model.StopAreaId) (*model.StopArea, string, bool) {
            stopPointRef, ok := connector.partner.Model().StopAreas().Find(stopAreaId)
            if !ok {
                return &model.StopArea{}, "", false
            }
        Severity: Major
        Found in core/siri_estimated_timetable_request_broadcaster.go - About 35 mins to fix

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

                  if so.Codes.Valid && len(so.Codes.String) > 0 {
                      codeMap := make(map[string]string)
                      if err = json.Unmarshal([]byte(so.Codes.String), &codeMap); err != nil {
                          return err
                      }
          Severity: Major
          Found in model/operator.go and 4 other locations - About 35 mins to fix
          model/lines.go on lines 365..371
          model/stop_area.go on lines 549..555
          model/stop_visit.go on lines 612..618
          model/vehicle_journey.go on lines 343..349

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

          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

                  if sa.Codes.Valid && len(sa.Codes.String) > 0 {
                      codeMap := make(map[string]string)
                      if err = json.Unmarshal([]byte(sa.Codes.String), &codeMap); err != nil {
                          return err
                      }
          Severity: Major
          Found in model/stop_area.go and 4 other locations - About 35 mins to fix
          model/lines.go on lines 365..371
          model/operator.go on lines 196..203
          model/stop_visit.go on lines 612..618
          model/vehicle_journey.go on lines 343..349

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

          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

                  if sl.Codes.Valid && len(sl.Codes.String) > 0 {
                      codeMap := make(map[string]string)
                      if err = json.Unmarshal([]byte(sl.Codes.String), &codeMap); err != nil {
                          return err
                      }
          Severity: Major
          Found in model/lines.go and 4 other locations - About 35 mins to fix
          model/operator.go on lines 196..203
          model/stop_area.go on lines 549..555
          model/stop_visit.go on lines 612..618
          model/vehicle_journey.go on lines 343..349

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

          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

                  if sv.Codes.Valid && len(sv.Codes.String) > 0 {
                      codeMap := make(map[string]string)
                      if err = json.Unmarshal([]byte(sv.Codes.String), &codeMap); err != nil {
                          return err
                      }
          Severity: Major
          Found in model/stop_visit.go and 4 other locations - About 35 mins to fix
          model/lines.go on lines 365..371
          model/operator.go on lines 196..203
          model/stop_area.go on lines 549..555
          model/vehicle_journey.go on lines 343..349

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

          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

                  if vj.Codes.Valid && len(vj.Codes.String) > 0 {
                      codeMap := make(map[string]string)
                      if err = json.Unmarshal([]byte(vj.Codes.String), &codeMap); err != nil {
                          return err
                      }
          Severity: Major
          Found in model/vehicle_journey.go and 4 other locations - About 35 mins to fix
          model/lines.go on lines 365..371
          model/operator.go on lines 196..203
          model/stop_area.go on lines 549..555
          model/stop_visit.go on lines 612..618

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

          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 (smb *SMBroadcaster) handleCancelledStopVisit(stopVisit *model.StopVisit, delivery *siri.SIRINotifyStopMonitoringDelivery, stopMonitoringBuilder *BroadcastStopMonitoringBuilder) bool {
              cancelledStopVisit := stopMonitoringBuilder.BuildCancelledStopVisit(stopVisit)
              if cancelledStopVisit == nil {
                  return false
              }
          Severity: Minor
          Found in core/stop_monitoring_broadcaster.go and 1 other location - About 35 mins to fix
          core/stop_monitoring_broadcaster.go on lines 241..248

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

          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 (smb *SMBroadcaster) handleMonitoredStopVisit(stopVisit *model.StopVisit, delivery *siri.SIRINotifyStopMonitoringDelivery, stopMonitoringBuilder *BroadcastStopMonitoringBuilder) bool {
              monitoredStopVisit := stopMonitoringBuilder.BuildMonitoredStopVisit(stopVisit)
              if monitoredStopVisit == nil {
                  return false
              }
          Severity: Minor
          Found in core/stop_monitoring_broadcaster.go and 1 other location - About 35 mins to fix
          core/stop_monitoring_broadcaster.go on lines 231..239

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 103.

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

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

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

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

          Refactorings

          Further Reading

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

              if request.PreviewInterval() != 0 {
                  duration := request.PreviewInterval()
                  now := connector.Clock().Now()
                  if !request.StartTime().IsZero() {
                      now = request.StartTime()
          Severity: Minor
          Found in core/siri_stop_monitoring_request_broadcaster.go and 1 other location - About 30 mins to fix
          core/siri_estimated_timetable_request_broadcaster.go on lines 84..91

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

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

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

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

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

          Refactorings

          Further Reading

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

              if request.PreviewInterval() != 0 {
                  duration := request.PreviewInterval()
                  now := connector.Clock().Now()
                  if !request.StartTime().IsZero() {
                      now = request.StartTime()
          Severity: Minor
          Found in core/siri_estimated_timetable_request_broadcaster.go and 1 other location - About 30 mins to fix
          core/siri_stop_monitoring_request_broadcaster.go on lines 73..80

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

          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 *GeneralMessageUpdateEventBuilder) SetGeneralMessageResponseUpdateEvents(event *[]*model.SituationUpdateEvent, xmlResponse *sxml.XMLGeneralMessageResponse) {
              xmlGeneralMessageEvents := xmlResponse.XMLGeneralMessages()
              if len(xmlGeneralMessageEvents) == 0 {
                  return
              }
          Severity: Minor
          Found in core/general_message_update_event_builder.go and 1 other location - About 30 mins to fix
          core/situation_exchange_update_event_builder.go on lines 43..52

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

          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 (partner *Partner) RegisterDiscoveredStopAreas(stops []string) {
              if !partner.CollectSettings().UseDiscoveredSA {
                  return
              }
          
          
          Severity: Minor
          Found in core/partner.go and 1 other location - About 30 mins to fix
          core/partner.go on lines 713..725

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

          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 *SituationExchangeUpdateEventBuilder) SetSituationExchangeUpdateEvents(event *[]*model.SituationUpdateEvent, xmlResponse *sxml.XMLSituationExchangeResponse) {
              xmlSituationExchangeDeliveries := xmlResponse.SituationExchangeDeliveries()
              if len(xmlSituationExchangeDeliveries) == 0 {
                  return
              }
          Severity: Minor
          Found in core/situation_exchange_update_event_builder.go and 1 other location - About 30 mins to fix
          core/general_message_update_event_builder.go on lines 51..60

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

          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 (partner *Partner) RegisterDiscoveredLines(lines []string) {
              if !partner.CollectSettings().UseDiscoveredLines {
                  return
              }
          
          
          Severity: Minor
          Found in core/partner.go and 1 other location - About 30 mins to fix
          core/partner.go on lines 699..711

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

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

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

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

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

          Refactorings

          Further Reading

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

          func (manager *MemoryStopAreas) Find(id StopAreaId) (*StopArea, bool) {
              manager.mutex.RLock()
              stopArea, ok := manager.byIdentifier[id]
              manager.mutex.RUnlock()
          
          
          Severity: Major
          Found in model/stop_area.go and 5 other locations - About 30 mins to fix
          model/lines.go on lines 216..225
          model/operator.go on lines 120..129
          model/stop_visit.go on lines 314..323
          model/vehicle_journey.go on lines 218..227
          model/vehicles.go on lines 170..179

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

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

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

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

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

          Refactorings

          Further Reading

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

          func (manager *MemoryOperators) Find(id OperatorId) (*Operator, bool) {
              manager.mutex.RLock()
              operator, ok := manager.byIdentifier[id]
              manager.mutex.RUnlock()
          
          
          Severity: Major
          Found in model/operator.go and 5 other locations - About 30 mins to fix
          model/lines.go on lines 216..225
          model/stop_area.go on lines 272..281
          model/stop_visit.go on lines 314..323
          model/vehicle_journey.go on lines 218..227
          model/vehicles.go on lines 170..179

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

          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