datacite/lupo

View on GitHub

Showing 575 of 596 total issues

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

  def data_management_plans(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "Data Management Plan"
    ElasticsearchModelResponseConnection.new(
      response(**args),
Severity: Major
Found in app/graphql/types/member_type.rb and 12 other locations - About 20 mins to fix
app/graphql/types/funder_type.rb on lines 203..209
app/graphql/types/organization_type.rb on lines 290..296
app/graphql/types/query_type.rb on lines 915..918
app/graphql/types/query_type.rb on lines 958..961
app/graphql/types/query_type.rb on lines 1001..1004
app/graphql/types/query_type.rb on lines 1044..1047
app/graphql/types/query_type.rb on lines 1087..1090
app/graphql/types/query_type.rb on lines 1130..1133
app/graphql/types/query_type.rb on lines 1173..1176
app/graphql/types/query_type.rb on lines 1216..1219
app/graphql/types/query_type.rb on lines 1259..1262
app/graphql/types/repository_type.rb on lines 309..315

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

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

      indexes :technical_contact,
              type: :object,
              properties: {
                uid: { type: :keyword },
                email: { type: :text },
Severity: Major
Found in app/models/provider.rb and 6 other locations - About 20 mins to fix
app/models/provider.rb on lines 294..303
app/models/provider.rb on lines 303..312
app/models/provider.rb on lines 312..321
app/models/provider.rb on lines 321..330
app/models/provider.rb on lines 330..339
app/models/provider.rb on lines 339..348

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

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 options[:provider_id].present?
        options[:provider_id].split(",").each { |id|
          should_query << { term: { "provider_id": { value: id, case_insensitive: true } } }
        }
        minimum_should_match = 1
Severity: Minor
Found in app/models/doi/graphql_query.rb and 1 other location - About 20 mins to fix
app/models/doi/graphql_query.rb on lines 192..196

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

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 options[:client_id].present?
        options[:client_id].split(",").each { |id|
          should_query << { term: { "client_id": { value: id, case_insensitive: true } } }
        }
        minimum_should_match = 1
Severity: Minor
Found in app/models/doi/graphql_query.rb and 1 other location - About 20 mins to fix
app/models/doi/graphql_query.rb on lines 186..190

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

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

  def conference_papers(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "\"Conference paper\""
    ElasticsearchModelResponseConnection.new(response(**args), context: context, first: args[:first], after: args[:after])
Severity: Major
Found in app/graphql/types/query_type.rb and 12 other locations - About 20 mins to fix
app/graphql/types/funder_type.rb on lines 203..209
app/graphql/types/member_type.rb on lines 260..266
app/graphql/types/organization_type.rb on lines 290..296
app/graphql/types/query_type.rb on lines 915..918
app/graphql/types/query_type.rb on lines 958..961
app/graphql/types/query_type.rb on lines 1001..1004
app/graphql/types/query_type.rb on lines 1044..1047
app/graphql/types/query_type.rb on lines 1130..1133
app/graphql/types/query_type.rb on lines 1173..1176
app/graphql/types/query_type.rb on lines 1216..1219
app/graphql/types/query_type.rb on lines 1259..1262
app/graphql/types/repository_type.rb on lines 309..315

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

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

  def data_management_plans(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "Data Management Plan"
    ElasticsearchModelResponseConnection.new(
      response(**args),
Severity: Major
Found in app/graphql/types/funder_type.rb and 12 other locations - About 20 mins to fix
app/graphql/types/member_type.rb on lines 260..266
app/graphql/types/organization_type.rb on lines 290..296
app/graphql/types/query_type.rb on lines 915..918
app/graphql/types/query_type.rb on lines 958..961
app/graphql/types/query_type.rb on lines 1001..1004
app/graphql/types/query_type.rb on lines 1044..1047
app/graphql/types/query_type.rb on lines 1087..1090
app/graphql/types/query_type.rb on lines 1130..1133
app/graphql/types/query_type.rb on lines 1173..1176
app/graphql/types/query_type.rb on lines 1216..1219
app/graphql/types/query_type.rb on lines 1259..1262
app/graphql/types/repository_type.rb on lines 309..315

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

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

      indexes :secondary_technical_contact,
              type: :object,
              properties: {
                uid: { type: :keyword },
                email: { type: :text },
Severity: Major
Found in app/models/provider.rb and 6 other locations - About 20 mins to fix
app/models/provider.rb on lines 285..294
app/models/provider.rb on lines 303..312
app/models/provider.rb on lines 312..321
app/models/provider.rb on lines 321..330
app/models/provider.rb on lines 330..339
app/models/provider.rb on lines 339..348

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

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

      indexes :billing_contact,
              type: :object,
              properties: {
                uid: { type: :keyword },
                email: { type: :text },
Severity: Major
Found in app/models/provider.rb and 6 other locations - About 20 mins to fix
app/models/provider.rb on lines 285..294
app/models/provider.rb on lines 294..303
app/models/provider.rb on lines 312..321
app/models/provider.rb on lines 321..330
app/models/provider.rb on lines 330..339
app/models/provider.rb on lines 339..348

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

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

  def preprints(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "PostedContent,Preprint"
    ElasticsearchModelResponseConnection.new(response(**args), context: context, first: args[:first], after: args[:after])
Severity: Major
Found in app/graphql/types/query_type.rb and 12 other locations - About 20 mins to fix
app/graphql/types/funder_type.rb on lines 203..209
app/graphql/types/member_type.rb on lines 260..266
app/graphql/types/organization_type.rb on lines 290..296
app/graphql/types/query_type.rb on lines 915..918
app/graphql/types/query_type.rb on lines 958..961
app/graphql/types/query_type.rb on lines 1044..1047
app/graphql/types/query_type.rb on lines 1087..1090
app/graphql/types/query_type.rb on lines 1130..1133
app/graphql/types/query_type.rb on lines 1173..1176
app/graphql/types/query_type.rb on lines 1216..1219
app/graphql/types/query_type.rb on lines 1259..1262
app/graphql/types/repository_type.rb on lines 309..315

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

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

    @event =
      Event.where(subj_id: safe_params[:subj_id]).where(
        obj_id: safe_params[:obj_id],
      ).
        where(source_id: safe_params[:source_id]).
Severity: Minor
Found in app/controllers/events_controller.rb and 1 other location - About 20 mins to fix
app/controllers/old_events_controller.rb on lines 17..22

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

    @event =
      Event.where(subj_id: safe_params[:subj_id]).where(
        obj_id: safe_params[:obj_id],
      ).
        where(source_id: safe_params[:source_id]).
Severity: Minor
Found in app/controllers/old_events_controller.rb and 1 other location - About 20 mins to fix
app/controllers/events_controller.rb on lines 17..22

Duplicated Code

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

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

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

Tuning

This issue has a mass of 27.

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

  attribute :from_salesforce,
            if:
              Proc.new { |object, params|
                params[:detail] && params[:current_ability] &&
                  params[:current_ability].can?(:read_salesforce_id, object) ==
Severity: Minor
Found in app/serializers/provider_serializer.rb and 2 other locations - About 15 mins to fix
app/serializers/contact_serializer.rb on lines 34..42
app/serializers/repository_serializer.rb on lines 162..170

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

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

  def download_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.downloads.buckets)
Severity: Minor
Found in app/graphql/types/member_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 159..165
app/graphql/types/data_catalog_type.rb on lines 169..175
app/graphql/types/data_catalog_type.rb on lines 179..185
app/graphql/types/member_type.rb on lines 314..320
app/graphql/types/member_type.rb on lines 334..340

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

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 cumulative_years
    if deleted_at && deleted_at.year > created_at.year
      (created_at.year...deleted_at.year).to_a
    elsif deleted_at
      []
Severity: Minor
Found in app/models/client.rb and 1 other location - About 15 mins to fix
app/models/provider.rb on lines 757..764

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

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

  def citation_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.citations.buckets)
Severity: Minor
Found in app/graphql/types/member_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 159..165
app/graphql/types/data_catalog_type.rb on lines 169..175
app/graphql/types/data_catalog_type.rb on lines 179..185
app/graphql/types/member_type.rb on lines 314..320
app/graphql/types/member_type.rb on lines 324..330

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

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

  def view_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.views.buckets)
Severity: Minor
Found in app/graphql/types/member_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 159..165
app/graphql/types/data_catalog_type.rb on lines 169..175
app/graphql/types/data_catalog_type.rb on lines 179..185
app/graphql/types/member_type.rb on lines 324..330
app/graphql/types/member_type.rb on lines 334..340

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

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

  attribute :from_salesforce,
            if:
              Proc.new { |object, params|
                params[:detail] && params[:current_ability] &&
                  params[:current_ability].can?(:read_salesforce_id, object) ==
Severity: Minor
Found in app/serializers/repository_serializer.rb and 2 other locations - About 15 mins to fix
app/serializers/contact_serializer.rb on lines 34..42
app/serializers/provider_serializer.rb on lines 300..308

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

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

  def view_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.views.buckets)
Severity: Minor
Found in app/graphql/types/data_catalog_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 169..175
app/graphql/types/data_catalog_type.rb on lines 179..185
app/graphql/types/member_type.rb on lines 314..320
app/graphql/types/member_type.rb on lines 324..330
app/graphql/types/member_type.rb on lines 334..340

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

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

  def download_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.downloads.buckets)
Severity: Minor
Found in app/graphql/types/data_catalog_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 159..165
app/graphql/types/data_catalog_type.rb on lines 179..185
app/graphql/types/member_type.rb on lines 314..320
app/graphql/types/member_type.rb on lines 324..330
app/graphql/types/member_type.rb on lines 334..340

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

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

  def citation_count
    args = { first: 0 }
    @r = response(**args) if @r.nil?
    if @r.results.total.positive?
      aggregate_count(@r.response.aggregations.citations.buckets)
Severity: Minor
Found in app/graphql/types/data_catalog_type.rb and 5 other locations - About 15 mins to fix
app/graphql/types/data_catalog_type.rb on lines 159..165
app/graphql/types/data_catalog_type.rb on lines 169..175
app/graphql/types/member_type.rb on lines 314..320
app/graphql/types/member_type.rb on lines 324..330
app/graphql/types/member_type.rb on lines 334..340

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

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