MiraitSystems/enju_trunk

View on GitHub

Showing 351 of 1,155 total issues

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

  def update
    respond_to do |format|
      if @series_statement_merge.update_attributes(params[:series_statement_merge])
        flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.series_statement_merge'))
        format.html { redirect_to(@series_statement_merge) }
Severity: Major
Found in app/controllers/series_statement_merges_controller.rb and 10 other locations - About 1 hr to fix
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
app/controllers/user_checkout_stats_controller.rb on lines 64..72
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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 update
    respond_to do |format|
      if @checkout_stat_has_manifestation.update_attributes(params[:checkout_stat_has_manifestation])
        flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.checkout_stat_has_manifestation'))
        format.html { redirect_to(@checkout_stat_has_manifestation) }
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
app/controllers/series_statement_merges_controller.rb on lines 67..75
app/controllers/user_checkout_stats_controller.rb on lines 64..72
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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 update
    respond_to do |format|
      if @manifestation_checkout_stat.update_attributes(params[:manifestation_checkout_stat])
        flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.manifestation_checkout_stat'))
        format.html { redirect_to(@manifestation_checkout_stat) }
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
app/controllers/series_statement_merges_controller.rb on lines 67..75
app/controllers/user_checkout_stats_controller.rb on lines 64..72
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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 update
    respond_to do |format|
      if @reserve_stat_has_user.update_attributes(params[:reserve_stat_has_user])
        flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.reserve_stat_has_user'))
        format.html { redirect_to(@reserve_stat_has_user) }
Severity: Major
Found in app/controllers/reserve_stat_has_users_controller.rb and 10 other locations - About 1 hr to fix
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/series_statement_merges_controller.rb on lines 67..75
app/controllers/user_checkout_stats_controller.rb on lines 64..72
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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 update
    respond_to do |format|
      if @manifestation_reserve_stat.update_attributes(params[:manifestation_reserve_stat])
        flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.manifestation_reserve_stat'))
        format.html { redirect_to(@manifestation_reserve_stat) }
Severity: Major
Found in app/controllers/manifestation_reserve_stats_controller.rb and 10 other locations - About 1 hr to fix
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
app/controllers/series_statement_merges_controller.rb on lines 67..75
app/controllers/user_checkout_stats_controller.rb on lines 64..72
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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 update
    respond_to do |format|
      if @user_checkout_stat.update_attributes(params[:user_checkout_stat])
        flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.user_checkout_stat'))
        format.html { redirect_to(@user_checkout_stat) }
Severity: Major
Found in app/controllers/user_checkout_stats_controller.rb and 10 other locations - About 1 hr to fix
app/controllers/agent_merges_controller.rb on lines 65..73
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/checkout_stat_has_users_controller.rb on lines 58..66
app/controllers/event_import_files_controller.rb on lines 73..81
app/controllers/manifestation_checkout_stats_controller.rb on lines 65..73
app/controllers/manifestation_reserve_stats_controller.rb on lines 64..72
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 58..66
app/controllers/reserve_stat_has_users_controller.rb on lines 58..66
app/controllers/series_statement_merges_controller.rb on lines 67..75
app/controllers/user_reserve_stats_controller.rb on lines 64..72

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

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

            function nextMonth() {
                var date = new Date(cal.date);
                date.setDate(date.getDate() + step);
                cal.setDate(date);
            };
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.simplecalendarjp.js on lines 1073..1077

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

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

  def update
    respond_to do |format|
      if @resource_import_file.update_attributes(params[:resource_import_file])
        format.html { redirect_to @resource_import_file, :notice => t('controller.successfully_updated', :model => t('activerecord.models.resource_import_file')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/resource_import_files_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/donates_controller.rb on lines 58..65
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscribes_controller.rb on lines 61..68
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

  def update
    respond_to do |format|
      if @subscribe.update_attributes(params[:subscribe])
        format.html { redirect_to @subscribe, :notice => t('controller.successfully_updated', :model => t('activerecord.models.subscribe')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/subscribes_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/donates_controller.rb on lines 58..65
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

  def update
    respond_to do |format|
      if @donate.update_attributes(params[:donate])
        format.html { redirect_to @donate, :notice => t('controller.successfully_updated', :model => t('activerecord.models.donate')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/donates_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscribes_controller.rb on lines 61..68
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

  def update
    respond_to do |format|
      if @subscription.update_attributes(params[:subscription])
        format.html { redirect_to @subscription, :notice => t('controller.successfully_updated', :model => t('activerecord.models.subscription')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/subscriptions_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/donates_controller.rb on lines 58..65
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscribes_controller.rb on lines 61..68

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

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

  def update
    respond_to do |format|
      if @shelf.update_attributes(params[:shelf])
        format.html { redirect_to @shelf, :notice => t('controller.successfully_updated', :model => t('activerecord.models.shelf')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/shelves_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/donates_controller.rb on lines 58..65
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/subscribes_controller.rb on lines 61..68
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

  def update
    respond_to do |format|
      if @accept.update_attributes(params[:accept])
        format.html { redirect_to @accept, notice:  t('controller.successfully_updated', model:  t('activerecord.models.accept')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/accepts_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/agent_import_files_controller.rb on lines 76..83
app/controllers/donates_controller.rb on lines 58..65
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscribes_controller.rb on lines 61..68
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

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

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

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

Refactorings

Further Reading

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

  if LibraryGroup.site_config.try(:url)
    uri = Addressable::URI.parse(LibraryGroup.site_config.url)
    default_url_options[:host] = uri.host
    default_url_options[:port] = uri.port if Setting.enju.web_port_number != 80
  else
Severity: Major
Found in app/mailers/reservation_notifier.rb and 1 other location - About 1 hr to fix
app/mailers/notifier.rb on lines 2..8

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

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

  def update
    respond_to do |format|
      if @agent_import_file.update_attributes(params[:agent_import_file])
        format.html { redirect_to @agent_import_file, :notice => t('controller.successfully_updated', :model => t('activerecord.models.agent_import_file')) }
        format.json { head :no_content }
Severity: Major
Found in app/controllers/agent_import_files_controller.rb and 6 other locations - About 1 hr to fix
app/controllers/accepts_controller.rb on lines 131..138
app/controllers/donates_controller.rb on lines 58..65
app/controllers/resource_import_files_controller.rb on lines 76..83
app/controllers/shelves_controller.rb on lines 108..115
app/controllers/subscribes_controller.rb on lines 61..68
app/controllers/subscriptions_controller.rb on lines 65..72

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

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

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

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

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

Refactorings

Further Reading

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

  if LibraryGroup.site_config.try(:url)
    uri = Addressable::URI.parse(LibraryGroup.site_config.url)
    default_url_options[:host] = uri.host
    default_url_options[:port] = uri.port if Setting.enju.web_port_number != 80
  else
Severity: Major
Found in app/mailers/notifier.rb and 1 other location - About 1 hr to fix
app/mailers/reservation_notifier.rb on lines 2..8

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

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

                    case 39: // KEY right
                    if (++x < 7)
                        ne = cal.ar_days[y][x];
                    else {
                        x = 0;
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.simplecalendarjp.js on lines 1085..1093

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

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

                    case 37: // KEY left
                    if (--x >= 0)
                        ne = cal.ar_days[y][x];
                    else {
                        x = 6;
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.simplecalendarjp.js on lines 1102..1110

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

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

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

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

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

Refactorings

Further Reading

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

  def destroy
    @realize.destroy

    respond_to do |format|
      case
Severity: Major
Found in app/controllers/realizes_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/creates_controller.rb on lines 89..102
app/controllers/owns_controller.rb on lines 89..102
app/controllers/produces_controller.rb on lines 93..106

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

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

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

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

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

Refactorings

Further Reading

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

  def destroy
    @create.destroy

    respond_to do |format|
      case
Severity: Major
Found in app/controllers/creates_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/owns_controller.rb on lines 89..102
app/controllers/produces_controller.rb on lines 93..106
app/controllers/realizes_controller.rb on lines 89..102

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

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