archivesspace/archivesspace

View on GitHub

Showing 944 of 2,413 total issues

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

  var username_typeahead = AS.delayedTypeAhead(function (query, callback) {
    $.ajax({
      url: AS.app_prefix('users/complete'),
      data: { query: query },
      type: 'GET',
Severity: Major
Found in frontend/app/assets/javascripts/session.select_user.js and 1 other location - About 3 hrs to fix
frontend/app/assets/javascripts/terms.crud.js on lines 19..31

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

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

    ASDate
      .left_join(Sequel.as(:enumeration_value, :date_type), :id => :date__date_type_id)
      .left_join(Sequel.as(:enumeration_value, :date_label), :id => :date__label_id)
      .filter(:archival_object_id => record_ids)
      .select(:archival_object_id,
Severity: Major
Found in backend/app/model/large_tree_resource.rb and 1 other location - About 3 hrs to fix
backend/app/model/large_tree_digital_object.rb on lines 31..55

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

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

    ASDate
      .left_join(Sequel.as(:enumeration_value, :date_type), :id => :date__date_type_id)
      .left_join(Sequel.as(:enumeration_value, :date_label), :id => :date__label_id)
      .filter(:digital_object_component_id => record_ids)
      .select(:digital_object_component_id,
Severity: Major
Found in backend/app/model/large_tree_digital_object.rb and 1 other location - About 3 hrs to fix
backend/app/model/large_tree_resource.rb on lines 68..92

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

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

BulkActionLocationUpdate.prototype.show = function () {
  var dialog_content = AS.renderTemplate('bulk_action_update_location', {
    selection: this.bulkContainerSearch.get_selection(),
  });

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

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

BulkActionIlsHoldingUpdate.prototype.show = function () {
  var dialog_content = AS.renderTemplate('bulk_action_update_ils_holding', {
    selection: this.bulkContainerSearch.get_selection(),
  });

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518
frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

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

BulkActionContainerProfileUpdate.prototype.show = function () {
  var dialog_content = AS.renderTemplate(
    'bulk_action_update_container_profile',
    {
      selection: this.bulkContainerSearch.get_selection(),
Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518
frontend/app/assets/javascripts/top_containers.bulk.js on lines 576..592

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

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

BulkActionMultipleLocationUpdate.prototype.show = function () {
  var dialog_content = AS.renderTemplate(
    'bulk_action_update_location_multiple',
    {
      selection: this.bulkContainerSearch.get_selection(),
Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 3 other locations - About 3 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 359..372
frontend/app/assets/javascripts/top_containers.bulk.js on lines 433..449
frontend/app/assets/javascripts/top_containers.bulk.js on lines 505..518

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

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

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

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

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

Refactorings

Further Reading

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

      if (!$.isEmptyObject(rooms)) {
        $room.empty();
        $room.append($('<option>'));
        for (var room in rooms) {
          $room.append($('<option>').html(room));
Severity: Major
Found in frontend/app/assets/javascripts/space_calculator.js and 1 other location - About 3 hrs to fix
frontend/app/assets/javascripts/space_calculator.js on lines 159..166

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

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

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

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

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

Refactorings

Further Reading

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

      if (!$.isEmptyObject(floors)) {
        $floor.empty();
        $floor.append($('<option>'));
        for (var floor in floors) {
          $floor.append($('<option>').html(floor));
Severity: Major
Found in frontend/app/assets/javascripts/space_calculator.js and 1 other location - About 3 hrs to fix
frontend/app/assets/javascripts/space_calculator.js on lines 175..182

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

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

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

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

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

Refactorings

Further Reading

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

  def query
    results = db.fetch(query_string)
    sorted = {}
    results.each do |result|
      top_id = result[:top_container_id]
reports/accessions/accession_instances_subreport/accession_instances_subreport.rb on lines 10..35
reports/resources/resource_instances_subreport/resource_instances_subreport.rb on lines 10..35

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

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

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

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

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

Refactorings

Further Reading

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

  def query
    results = db.fetch(query_string)
    sorted = {}
    results.each do |result|
      top_id = result[:top_container_id]
reports/accessions/accession_instances_subreport/accession_instances_subreport.rb on lines 10..35
reports/resources/archival_object_instances_subreport/archival_object_instances_subreport.rb on lines 10..35

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

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

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

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

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

Refactorings

Further Reading

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

  def query
    results = db.fetch(query_string)
    sorted = {}
    results.each do |result|
      top_id = result[:top_container_id]
reports/resources/archival_object_instances_subreport/archival_object_instances_subreport.rb on lines 10..35
reports/resources/resource_instances_subreport/resource_instances_subreport.rb on lines 10..35

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

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

    date_label = json.has_key?('dates') && json['dates'].length > 0 ?
                   json['dates'].map do |date|
                     if date['expression']
                       date['date_type'] == 'bulk' ? "#{I18n.t("date_type_bulk.bulk")}: #{date['expression']}" : date['expression']
                     elsif date['begin'] and date['end']
Severity: Major
Found in backend/app/model/archival_object.rb and 1 other location - About 2 hrs to fix
backend/app/model/digital_object_component.rb on lines 57..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 102.

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

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

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

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

Refactorings

Further Reading

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

    date_label = json.has_key?('dates') && json['dates'].length > 0 ?
                  json['dates'].map do |date|
                    if date['expression']
                      date['date_type'] == 'bulk' ? "#{I18n.t("date_type_bulk.bulk")}: #{date['expression']}" : date['expression']
                    elsif date['begin'] and date['end']
Severity: Major
Found in backend/app/model/digital_object_component.rb and 1 other location - About 2 hrs to fix
backend/app/model/archival_object.rb on lines 72..83

Duplicated Code

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

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

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

Tuning

This issue has a mass of 102.

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

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

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

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

Refactorings

Further Reading

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

BulkActionIlsHoldingUpdate.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

Duplicated Code

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

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

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

Tuning

This issue has a mass of 91.

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

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

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

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

Refactorings

Further Reading

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

BulkActionIndicatorRapidEntry.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616

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

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

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

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

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

Refactorings

Further Reading

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

BulkActionContainerProfileUpdate.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

Duplicated Code

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

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

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

Tuning

This issue has a mass of 91.

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

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

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

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

Refactorings

Further Reading

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

BulkActionMultipleLocationUpdate.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

Duplicated Code

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

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

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

Tuning

This issue has a mass of 91.

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

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

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

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

Refactorings

Further Reading

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

BulkActionLocationUpdate.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
frontend/app/assets/javascripts/top_containers.bulk.js on lines 608..616
frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

Duplicated Code

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

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

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

Tuning

This issue has a mass of 91.

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

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

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

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

Refactorings

Further Reading

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

BulkActionBarcodeRapidEntry.prototype.setup_menu_item = function () {
  var self = this;

  self.$menuItem = $('#' + self.MENU_ID, self.bulkContainerSearch.$toolbar);

Severity: Major
Found in frontend/app/assets/javascripts/top_containers.bulk.js and 5 other locations - About 2 hrs to fix
frontend/app/assets/javascripts/top_containers.bulk.js on lines 349..357
frontend/app/assets/javascripts/top_containers.bulk.js on lines 423..431
frontend/app/assets/javascripts/top_containers.bulk.js on lines 495..503
frontend/app/assets/javascripts/top_containers.bulk.js on lines 566..574
frontend/app/assets/javascripts/top_containers.bulk.js on lines 703..711

Duplicated Code

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

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

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

Tuning

This issue has a mass of 91.

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