afimb/chouette2

View on GitHub

Showing 269 of 269 total issues

Method compliance_icon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def compliance_icon( compliance_check)
    return nil unless compliance_check.compliance_check_validation_report
    compliance_check.compliance_check_validation_report.tap do |cct|
      if cct.failed? || cct.any_error_severity_failure?
        return 'icons/link_page_alert.png'
Severity: Minor
Found in app/helpers/compliance_checks_helper.rb - About 25 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 compliance_icon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def compliance_icon( export_task)
    return nil unless export_task.compliance_check_task
    export_task.compliance_check_task.tap do |cct|
      if cct.failed? || cct.any_error_severity_failure?
        return 'icons/link_page_alert.png'
Severity: Minor
Found in app/helpers/exports_helper.rb - About 25 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

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

Method compliance_icon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def compliance_icon( import_task)
    return nil unless import_task.compliance_check_task
    import_task.compliance_check_task.tap do |cct|
      if cct.failed? || cct.any_error_severity_failure?
        return 'icons/link_page_alert.png'
Severity: Minor
Found in app/helpers/imports_helper.rb - About 25 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

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

Method shortcuts_update_for_add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def shortcuts_update_for_add( stop_point)
    stop_points << stop_point unless stop_points.include?( stop_point)

    ordered_stop_points = stop_points
    ordered_stop_points = ordered_stop_points.sort { |a,b| a.position <=> b.position} unless ordered_stop_points.empty?
Severity: Minor
Found in app/models/chouette/journey_pattern.rb - About 25 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 parse_query_and_convenience_headers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_query_and_convenience_headers(options)
      headers = options.fetch(:headers, {})
      CONVENIENCE_HEADERS.each do |h|
        if header = options.delete(h)
          headers[h] = header
Severity: Minor
Found in lib/ievkitdeprecated/client.rb - About 25 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

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

  def self.save( routes, directory, kml_export)
    routes.each do |route|
      self.new( route, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/kml/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/hub/route_exporter.rb on lines 28..34
app/exporters/chouette/kml/line_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 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/physical_stop_area_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/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

  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/export.rb and 1 other location - About 25 mins to fix
app/models/import.rb on lines 14..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 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 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( 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( networks, directory, hub_export)
    networks.each do |network|
      self.new( network, directory).tap do |specific_exporter|
        specific_exporter.save
      end
Severity: Major
Found in app/exporters/chouette/hub/network_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/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, 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 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 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

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

Severity
Category
Status
Source
Language