afimb/chouette2

View on GitHub

Showing 152 of 269 total issues

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

  def timeband_breadcrumb(action)
    referential_breadcrumb
    add_breadcrumb Chouette::Timeband.model_name.human(:count => 2), referential_timebands_path(@referential) unless action == :index
    add_breadcrumb breadcrumb_label(@timeband), referential_timeband_path(@referential, @timeband),:title => breadcrumb_tooltip(@timeband) if action == :edit
Severity: Major
Found in app/helpers/breadcrumb_helper.rb and 7 other locations - About 25 mins to fix
app/helpers/breadcrumb_helper.rb on lines 67..70
app/helpers/breadcrumb_helper.rb on lines 73..76
app/helpers/breadcrumb_helper.rb on lines 79..82
app/helpers/breadcrumb_helper.rb on lines 100..103
app/helpers/breadcrumb_helper.rb on lines 106..109
app/helpers/breadcrumb_helper.rb on lines 124..127
app/helpers/breadcrumb_helper.rb on lines 156..159

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

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

  def network_breadcrumb(action)
    referential_breadcrumb
    add_breadcrumb Chouette::Network.model_name.human(:count => 2), referential_networks_path(@referential) unless action == :index
    add_breadcrumb breadcrumb_label(@network), referential_line_path(@referential, @network),:title => breadcrumb_tooltip(@network) if action == :edit
Severity: Major
Found in app/helpers/breadcrumb_helper.rb and 7 other locations - About 25 mins to fix
app/helpers/breadcrumb_helper.rb on lines 73..76
app/helpers/breadcrumb_helper.rb on lines 79..82
app/helpers/breadcrumb_helper.rb on lines 100..103
app/helpers/breadcrumb_helper.rb on lines 106..109
app/helpers/breadcrumb_helper.rb on lines 118..121
app/helpers/breadcrumb_helper.rb on lines 124..127
app/helpers/breadcrumb_helper.rb on lines 156..159

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

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

  def initialize(schema)
    @schema = schema

    Chouette::ActiveRecord.connection_pool.spec.config.tap do |config|
      @database = config[:database]
Severity: Minor
Found in app/models/chouette/loader.rb and 1 other location - About 25 mins to fix
app/models/chouette/file_validator.rb on lines 5..12

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

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

      if stop_area.parents.present?
        page.assign "parents_layer", kml_layer(stop_area, { :parents => true }, :style_map => Design::StopAreasStyleMap.new(helpers).style_map)
        page << map.add_layer(:parents_layer)
        page << map.add_control( hover_control_display_name(:parents_layer) )
Severity: Minor
Found in app/maps/stop_area_map.rb and 1 other location - About 25 mins to fix
app/maps/stop_area_map.rb on lines 18..21

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

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

  def index

    index! do |format|
      format.html {
        if collection.out_of_range? && params[:page].to_i > 1
Severity: Minor
Found in app/controllers/companies_controller.rb and 1 other location - About 25 mins to fix
app/controllers/networks_controller.rb on lines 20..29

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

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

  def index
    index! do |format|
      format.html {
        if collection.out_of_range? && params[:page].to_i > 1
          redirect_to url_for params.merge(:page => 1)
Severity: Minor
Found in app/controllers/networks_controller.rb and 1 other location - About 25 mins to fix
app/controllers/companies_controller.rb on lines 12..22

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

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

  def index
    index! do |format|
      format.html {
        if collection.out_of_range? && params[:page].to_i > 1
          redirect_to url_for params.merge(:page => 1)
Severity: Minor
Found in app/controllers/connection_links_controller.rb and 2 other locations - About 25 mins to fix
app/controllers/group_of_lines_controller.rb on lines 21..29
app/controllers/lines_controller.rb on lines 13..21

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

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

  def index
    index! do |format|
      format.html {
        if collection.out_of_range? && params[:page].to_i > 1
          redirect_to url_for params.merge(:page => 1)
Severity: Minor
Found in app/controllers/lines_controller.rb and 2 other locations - About 25 mins to fix
app/controllers/connection_links_controller.rb on lines 15..23
app/controllers/group_of_lines_controller.rb on lines 21..29

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

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

  def initialize(helpers,options = {})
    @helpers= helpers
    @style = options[:style].present? ? default_style.merge(options[:style]) : default_style
    @temporary = options[:style].present? ? temporary_style.merge(options[:style]) : temporary_style
  end
Severity: Minor
Found in app/maps/design/access_points_style_map.rb and 1 other location - About 25 mins to fix
app/maps/design/stop_areas_style_map.rb on lines 40..44

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

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

  def initialize(helpers,options = {})
    @helpers= helpers
    @style = options[:style].present? ? default_style.merge(options[:style]) : default_style
    @temporary = options[:style].present? ? temporary_style.merge(options[:style]) : temporary_style
  end
Severity: Minor
Found in app/maps/design/stop_areas_style_map.rb and 1 other location - About 25 mins to fix
app/maps/design/access_points_style_map.rb on lines 39..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 30.

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

  def index
    index! do |format|
      format.html {
        if collection.out_of_range? && params[:page].to_i > 1
          redirect_to url_for params.merge(:page => 1)
Severity: Minor
Found in app/controllers/group_of_lines_controller.rb and 2 other locations - About 25 mins to fix
app/controllers/connection_links_controller.rb on lines 15..23
app/controllers/lines_controller.rb on lines 13..21

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

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

  def self.save( lines, directory, hub_export)
    lines.each do |line|
      self.new( line, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/line_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def self.save( routes, directory, hub_export)
    routes.each do |route|
      self.new( route, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/route_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def self.save( journey_patterns, directory, hub_export)
    journey_patterns.each do |journey_pattern|
      self.new( journey_pattern, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/direction_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def self.save( companies, directory, hub_export)
    companies.each do |company|
      self.new( company, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/company_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def self.save( groups_of_lines, directory, hub_export)
    groups_of_lines.each do |group_of_lines|
      self.new( group_of_lines, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/group_of_lines_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  module V1
    class LinesController < ChouetteController

      defaults :resource_class => Chouette::Line, :finder => :find_by_objectid!
      
Severity: Minor
Found in app/controllers/api/v1/lines_controller.rb and 1 other location - About 25 mins to fix
app/controllers/api/v1/networks_controller.rb on lines 2..11

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

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

  def self.save( stop_areas, directory, hub_export)
    stop_areas.each do |stop_area|
      self.new( stop_area, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/commercial_stop_area_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_exporter.rb on lines 19..25
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def self.save( lines, directory, kml_export)
    lines.each do |line|
      self.new( line, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/kml/line_exporter.rb and 10 other locations - About 25 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 30..36
app/exporters/chouette/hub/company_exporter.rb on lines 19..25
app/exporters/chouette/hub/direction_exporter.rb on lines 23..29
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 19..25
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 33..39
app/exporters/chouette/hub/line_exporter.rb on lines 24..30
app/exporters/chouette/hub/network_exporter.rb on lines 19..25
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 34..40
app/exporters/chouette/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/route_exporter.rb on lines 19..25

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

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

  def report
    Rails.cache.fetch("#{cache_key}/action_report", expires_in: cache_expiration) do
      report_path = links["action_report"]
      if report_path
        response = Ievkitdeprecated.get(report_path)
Severity: Minor
Found in app/models/import.rb and 1 other location - About 25 mins to fix
app/models/export.rb on lines 12..19

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

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