afimb/chouette2

View on GitHub

Showing 269 of 269 total issues

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

  def rule_parameter_breadcrumb (action)
    organisation_breadcrumb
    add_breadcrumb Referential.human_attribute_name("rule_parameter_sets"), organisation_path unless action == :index
    add_breadcrumb breadcrumb_label(@rule_parameter_set), organisation_rule_parameter_set_path(@rule_parameter_set),:title => breadcrumb_tooltip(@rule_parameter_set) if action == :edit
Severity: Minor
Found in app/helpers/breadcrumb_helper.rb and 1 other location - About 15 mins to fix
app/helpers/breadcrumb_helper.rb on lines 210..213

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

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

  def save
    File.open(directory + hub_name , "a:Windows_1252") do |f|
      f.write("LIGNE\u000D\u000A") if f.size == 0
      f.write(render)
    end if line.present?
Severity: Major
Found in app/exporters/chouette/hub/line_exporter.rb and 13 other locations - About 15 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 39..44
app/exporters/chouette/hub/company_exporter.rb on lines 28..33
app/exporters/chouette/hub/direction_exporter.rb on lines 32..37
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 28..33
app/exporters/chouette/hub/itl_exporter.rb on lines 58..63
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 42..47
app/exporters/chouette/hub/network_exporter.rb on lines 28..33
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 43..48
app/exporters/chouette/hub/route_exporter.rb on lines 37..42
app/exporters/chouette/hub/time_table_exporter.rb on lines 47..52
app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb on lines 51..56
app/exporters/chouette/hub/vehicle_journey_exporter.rb on lines 87..92
app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb on lines 93..98

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

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

  def save
    File.open(directory + hub_name , "a:Windows_1252") do |f|
      f.write("SCHEMA\u000D\u000A") if f.size == 0
      f.write(render)
    end if route.present?
Severity: Major
Found in app/exporters/chouette/hub/route_exporter.rb and 13 other locations - About 15 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 39..44
app/exporters/chouette/hub/company_exporter.rb on lines 28..33
app/exporters/chouette/hub/direction_exporter.rb on lines 32..37
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 28..33
app/exporters/chouette/hub/itl_exporter.rb on lines 58..63
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 42..47
app/exporters/chouette/hub/line_exporter.rb on lines 33..38
app/exporters/chouette/hub/network_exporter.rb on lines 28..33
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 43..48
app/exporters/chouette/hub/time_table_exporter.rb on lines 47..52
app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb on lines 51..56
app/exporters/chouette/hub/vehicle_journey_exporter.rb on lines 87..92
app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb on lines 93..98

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

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

  def save
    File.open(directory + hub_name , "a:Windows_1252") do |f|
      f.write("ITL\u000D\u000A") if f.size == 0
      f.write(render)
    end if stop_point.present?
Severity: Major
Found in app/exporters/chouette/hub/itl_exporter.rb and 13 other locations - About 15 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 39..44
app/exporters/chouette/hub/company_exporter.rb on lines 28..33
app/exporters/chouette/hub/direction_exporter.rb on lines 32..37
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 28..33
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 42..47
app/exporters/chouette/hub/line_exporter.rb on lines 33..38
app/exporters/chouette/hub/network_exporter.rb on lines 28..33
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 43..48
app/exporters/chouette/hub/route_exporter.rb on lines 37..42
app/exporters/chouette/hub/time_table_exporter.rb on lines 47..52
app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb on lines 51..56
app/exporters/chouette/hub/vehicle_journey_exporter.rb on lines 87..92
app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb on lines 93..98

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

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

  belongs_to :line, :parent_class => Chouette::Line, :optional => true, :finder => :find_by_objectid!, :param => :line_id do
    belongs_to :route, :parent_class => Chouette::Route, :optional => true, :finder => :find_by_objectid!, :param => :route_id
  end
Severity: Minor
Found in app/controllers/api/v1/vehicle_journeys_controller.rb and 2 other locations - About 15 mins to fix
app/controllers/api/v1/journey_patterns_controller.rb on lines 5..7
app/controllers/api/v1/stop_areas_controller.rb on lines 5..7

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

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

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

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

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

Refactorings

Further Reading

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

  def self.save( models, directory, kml_export)
    self.new( models, directory).tap do |specific_exporter|
      specific_exporter.save
    end
    kml_export.log_messages.create( :severity => "ok", :key => "EXPORT|ACCES_LINK_COUNT", :arguments => {"0" => models.size})
Severity: Minor
Found in app/exporters/chouette/kml/access_link_exporter.rb and 2 other locations - About 15 mins to fix
app/exporters/chouette/kml/access_point_exporter.rb on lines 23..27
app/exporters/chouette/kml/connection_link_exporter.rb on lines 23..27

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

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 commercial_stop_areas
    Chouette::StopArea.joins(:children => [:stop_points => [:route => [:line => :group_of_lines] ] ]).where(:group_of_lines => {:id => self.id}).uniq
Severity: Minor
Found in app/models/chouette/group_of_line.rb and 1 other location - About 15 mins to fix
app/models/chouette/network.rb on lines 21..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 25.

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

  def save
    File.open(directory + hub_name , "a:Windows_1252") do |f|
      f.write("PERIODE\u000D\u000A") if f.size == 0
      f.write(render)
    end if time_table.present?
Severity: Major
Found in app/exporters/chouette/hub/time_table_exporter.rb and 13 other locations - About 15 mins to fix
app/exporters/chouette/hub/commercial_stop_area_exporter.rb on lines 39..44
app/exporters/chouette/hub/company_exporter.rb on lines 28..33
app/exporters/chouette/hub/direction_exporter.rb on lines 32..37
app/exporters/chouette/hub/group_of_lines_exporter.rb on lines 28..33
app/exporters/chouette/hub/itl_exporter.rb on lines 58..63
app/exporters/chouette/hub/journey_pattern_exporter.rb on lines 42..47
app/exporters/chouette/hub/line_exporter.rb on lines 33..38
app/exporters/chouette/hub/network_exporter.rb on lines 28..33
app/exporters/chouette/hub/physical_stop_area_exporter.rb on lines 43..48
app/exporters/chouette/hub/route_exporter.rb on lines 37..42
app/exporters/chouette/hub/vehicle_journey_at_stop_exporter.rb on lines 51..56
app/exporters/chouette/hub/vehicle_journey_exporter.rb on lines 87..92
app/exporters/chouette/hub/vehicle_journey_operation_exporter.rb on lines 93..98

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

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

  belongs_to :line, :parent_class => Chouette::Line, :optional => true, :finder => :find_by_objectid!, :param => :line_id do
    belongs_to :route, :parent_class => Chouette::Route, :optional => true, :finder => :find_by_objectid!, :param => :route_id
  end
Severity: Minor
Found in app/controllers/api/v1/stop_areas_controller.rb and 2 other locations - About 15 mins to fix
app/controllers/api/v1/journey_patterns_controller.rb on lines 5..7
app/controllers/api/v1/vehicle_journeys_controller.rb on lines 5..7

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

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