SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

  def destroy
    @download.destroy
    respond_to do |format|
      if @download.destroyed?
        format.html { destroy_redirect @download, notice: 'Download was successfully destroyed.' }
Severity: Major
Found in app/controllers/downloads_controller.rb and 15 other locations - About 1 hr to fix
app/controllers/citations_controller.rb on lines 86..94
app/controllers/collecting_events_controller.rb on lines 86..94
app/controllers/containers_controller.rb on lines 82..90
app/controllers/contents_controller.rb on lines 67..75
app/controllers/controlled_vocabulary_terms_controller.rb on lines 63..71
app/controllers/descriptors_controller.rb on lines 84..92
app/controllers/georeferences_controller.rb on lines 123..131
app/controllers/observations_controller.rb on lines 92..100
app/controllers/otus_controller.rb on lines 101..109
app/controllers/people_controller.rb on lines 71..79
app/controllers/sequence_relationships_controller.rb on lines 66..74
app/controllers/tags_controller.rb on lines 91..99
app/controllers/taxon_name_classifications_controller.rb on lines 92..100
app/controllers/taxon_name_relationships_controller.rb on lines 73..81
app/controllers/taxon_names_controller.rb on lines 73..81

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

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

  def sv_validate_priority
    unless self.type_class.nomenclatural_priority.nil?
      date1 = self.subject_taxon_name.cached_nomenclature_date
      date2 = self.object_taxon_name.cached_nomenclature_date
      if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
app/models/taxon_name_relationship/typification/genus/tautonomy.rb on lines 30..36

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

  def destroy
    @sequence_relationship.destroy
    respond_to do |format|
      if @sequence_relationship.destroyed?
        format.html { destroy_redirect @sequence_relationship, notice: 'Sequence relationship was successfully destroyed.' }
Severity: Major
Found in app/controllers/sequence_relationships_controller.rb and 15 other locations - About 1 hr to fix
app/controllers/citations_controller.rb on lines 86..94
app/controllers/collecting_events_controller.rb on lines 86..94
app/controllers/containers_controller.rb on lines 82..90
app/controllers/contents_controller.rb on lines 67..75
app/controllers/controlled_vocabulary_terms_controller.rb on lines 63..71
app/controllers/descriptors_controller.rb on lines 84..92
app/controllers/downloads_controller.rb on lines 36..44
app/controllers/georeferences_controller.rb on lines 123..131
app/controllers/observations_controller.rb on lines 92..100
app/controllers/otus_controller.rb on lines 101..109
app/controllers/people_controller.rb on lines 71..79
app/controllers/tags_controller.rb on lines 91..99
app/controllers/taxon_name_classifications_controller.rb on lines 92..100
app/controllers/taxon_name_relationships_controller.rb on lines 73..81
app/controllers/taxon_names_controller.rb on lines 73..81

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

  def create_nomen_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :nomen_taxon_names_md5)
      @result = BatchLoad::Import::TaxonNames::NomenInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items were created."
Severity: Major
Found in app/controllers/taxon_names_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 324..337
app/controllers/collection_objects_controller.rb on lines 350..363
app/controllers/descriptors_controller.rb on lines 162..177
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/otus_controller.rb on lines 220..233
app/controllers/sequences_controller.rb on lines 141..154
app/controllers/sequences_controller.rb on lines 167..180

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

  def create_castor_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Castor_collection_objects_md5)
      @result = BatchLoad::Import::CollectionObjects::CastorInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items were created."
Severity: Major
Found in app/controllers/collection_objects_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 350..363
app/controllers/descriptors_controller.rb on lines 162..177
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/otus_controller.rb on lines 220..233
app/controllers/sequences_controller.rb on lines 141..154
app/controllers/sequences_controller.rb on lines 167..180
app/controllers/taxon_names_controller.rb on lines 199..212

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

  def destroy
    @tag.destroy
    respond_to do |format|
      if @tag.destroyed?
        format.html { destroy_redirect @tag, notice: 'Tag was successfully destroyed.' }
Severity: Major
Found in app/controllers/tags_controller.rb and 15 other locations - About 1 hr to fix
app/controllers/citations_controller.rb on lines 86..94
app/controllers/collecting_events_controller.rb on lines 86..94
app/controllers/containers_controller.rb on lines 82..90
app/controllers/contents_controller.rb on lines 67..75
app/controllers/controlled_vocabulary_terms_controller.rb on lines 63..71
app/controllers/descriptors_controller.rb on lines 84..92
app/controllers/downloads_controller.rb on lines 36..44
app/controllers/georeferences_controller.rb on lines 123..131
app/controllers/observations_controller.rb on lines 92..100
app/controllers/otus_controller.rb on lines 101..109
app/controllers/people_controller.rb on lines 71..79
app/controllers/sequence_relationships_controller.rb on lines 66..74
app/controllers/taxon_name_classifications_controller.rb on lines 92..100
app/controllers/taxon_name_relationships_controller.rb on lines 73..81
app/controllers/taxon_names_controller.rb on lines 73..81

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

  def create_qualitative_descriptor_batch_load
    if params[:file] && digested_cookie_exists?(
        params[:file].tempfile,
        :qualitative_descriptors_batch_load_md5)
      @result = BatchLoad::Import::Descriptors::QualitativeInterpreter.new(**batch_params)
Severity: Major
Found in app/controllers/descriptors_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 324..337
app/controllers/collection_objects_controller.rb on lines 350..363
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/otus_controller.rb on lines 220..233
app/controllers/sequences_controller.rb on lines 141..154
app/controllers/sequences_controller.rb on lines 167..180
app/controllers/taxon_names_controller.rb on lines 199..212

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

  def create_data_attributes_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :data_attributes_batch_load_otus_md5)
      @result = BatchLoad::Import::Otus::DataAttributesInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} TODO RECORD TYPES were created."
Severity: Major
Found in app/controllers/otus_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 324..337
app/controllers/collection_objects_controller.rb on lines 350..363
app/controllers/descriptors_controller.rb on lines 162..177
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/sequences_controller.rb on lines 141..154
app/controllers/sequences_controller.rb on lines 167..180
app/controllers/taxon_names_controller.rb on lines 199..212

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

  def destroy
    @taxon_name.destroy
    respond_to do |format|
      if @taxon_name.destroyed?
        format.html { destroy_redirect @taxon_name, notice: 'TaxonName was successfully destroyed.' }
Severity: Major
Found in app/controllers/taxon_names_controller.rb and 15 other locations - About 1 hr to fix
app/controllers/citations_controller.rb on lines 86..94
app/controllers/collecting_events_controller.rb on lines 86..94
app/controllers/containers_controller.rb on lines 82..90
app/controllers/contents_controller.rb on lines 67..75
app/controllers/controlled_vocabulary_terms_controller.rb on lines 63..71
app/controllers/descriptors_controller.rb on lines 84..92
app/controllers/downloads_controller.rb on lines 36..44
app/controllers/georeferences_controller.rb on lines 123..131
app/controllers/observations_controller.rb on lines 92..100
app/controllers/otus_controller.rb on lines 101..109
app/controllers/people_controller.rb on lines 71..79
app/controllers/sequence_relationships_controller.rb on lines 66..74
app/controllers/tags_controller.rb on lines 91..99
app/controllers/taxon_name_classifications_controller.rb on lines 92..100
app/controllers/taxon_name_relationships_controller.rb on lines 73..81

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

  def create_genbank_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Genbank_sequences_md5)
      @result = BatchLoad::Import::Sequences::GenbankInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} sequences were created."
Severity: Major
Found in app/controllers/sequences_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 324..337
app/controllers/collection_objects_controller.rb on lines 350..363
app/controllers/descriptors_controller.rb on lines 162..177
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/otus_controller.rb on lines 220..233
app/controllers/sequences_controller.rb on lines 167..180
app/controllers/taxon_names_controller.rb on lines 199..212

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

  def create_buffered_batch_load
    if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Buffered_collection_objects_md5)
      @result = BatchLoad::Import::CollectionObjects::BufferedInterpreter.new(**batch_params)
      if @result.create
        flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items were created."
Severity: Major
Found in app/controllers/collection_objects_controller.rb and 9 other locations - About 1 hr to fix
app/controllers/collecting_events_controller.rb on lines 210..223
app/controllers/collecting_events_controller.rb on lines 237..250
app/controllers/collection_objects_controller.rb on lines 324..337
app/controllers/descriptors_controller.rb on lines 162..177
app/controllers/namespaces_controller.rb on lines 116..129
app/controllers/otus_controller.rb on lines 220..233
app/controllers/sequences_controller.rb on lines 141..154
app/controllers/sequences_controller.rb on lines 167..180
app/controllers/taxon_names_controller.rb on lines 199..212

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

  def matching_keyword_id_or
    return nil if keyword_id_or.empty?
    k = table.name.classify.safe_constantize
    t = ::Tag.arel_table

Severity: Major
Found in lib/queries/concerns/tags.rb and 1 other location - About 1 hr to fix
lib/queries/concerns/protocols.rb on lines 94..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 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

  def matching_protocol_id_or
    return nil if protocol_id_or.empty?
    k = table.name.classify.safe_constantize
    t = ::ProtocolRelationship.arel_table

Severity: Major
Found in lib/queries/concerns/protocols.rb and 1 other location - About 1 hr to fix
lib/queries/concerns/tags.rb on lines 102..110

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

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

  let index = state.objectsForDepictions.findIndex(item => {
    return (item.id == value.id && item.base_class == value.base_class)
  })
app/javascript/vue/tasks/images/new_image/store/mutations/addObjectForDepictions.js on lines 2..4

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

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

  let index = state.objectsForDepictions.findIndex(item => {
    return (item.id == value.id && item.base_class == value.base_class)
  })
app/javascript/vue/tasks/images/new_image/store/mutations/removeObjectForDepictions.js on lines 2..4

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

  handleEvents () {
    document.addEventListener('click', this.toggleHeaderEvent)
    document.addEventListener('click', this.togglePanelEvent)
    document.addEventListener('click', this.emitLoadPdfViewerEvent)
  },
Severity: Major
Found in app/assets/javascripts/views/shared/slideout.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/shared/slideout.js on lines 89..93

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

    autocomplete_input.autocomplete({
      source: '/people/autocomplete',
      open: function (event, ui) {
        TW.views.people.role_picker.bind_hover(form);
      },
Severity: Major
Found in app/assets/javascripts/views/people/_role_picker.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/views/filter/_area_picker.js on lines 24..40
app/assets/javascripts/views/topics/_topic_picker.js on lines 38..53

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

    autocomplete_input.autocomplete({
      source: '/geographic_areas/autocomplete',
      appendTo: autocomplete_input.parent(),
      open: function (event, ui) {
        TW.views.filter.area_picker.bind_hover(form);
Severity: Major
Found in app/assets/javascripts/views/filter/_area_picker.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/views/people/_role_picker.js on lines 87..101
app/assets/javascripts/views/topics/_topic_picker.js on lines 38..53

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

  removeEvents () {
    document.removeEventListener('click', this.toggleHeaderEvent)
    document.removeEventListener('click', this.togglePanelEvent)
    document.removeEventListener('click', this.emitLoadPdfViewerEvent)
  },
Severity: Major
Found in app/assets/javascripts/views/shared/slideout.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/shared/slideout.js on lines 83..87

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

Function handleClickCategoryFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function handleClickCategoryFilter(e) {
    const element = e.target
    const elementFilter = element.getAttribute('data-filter-category')
    const activated = element.classList.contains('activated')
    const allBtns = [
Severity: Minor
Found in app/assets/javascripts/views/hub/filterHub.js - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language