datacite/lupo

View on GitHub

Showing 575 of 596 total issues

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

  field :funders, FunderConnectionWithTotalType, null: false do
    argument :query, String, required: false
    argument :first, Int, required: false, default_value: 25
    argument :after, String, required: false
  end
Severity: Minor
Found in app/graphql/types/query_type.rb and 2 other locations - About 20 mins to fix
app/graphql/types/query_type.rb on lines 80..84
app/graphql/types/query_type.rb on lines 204..208

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

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

    def set_include
      if params[:include].present?
        @include =
          params[:include].split(",").map { |i| i.downcase.underscore.to_sym }
        @include = @include & %i[provider]
Severity: Minor
Found in app/controllers/repositories_controller.rb and 4 other locations - About 20 mins to fix
app/controllers/contacts_controller.rb on lines 183..189
app/controllers/media_controller.rb on lines 136..142
app/controllers/metadata_controller.rb on lines 131..137
app/controllers/providers_controller.rb on lines 364..370

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

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

  field :prefixes, PrefixConnectionWithTotalType, null: false do
    argument :query, String, required: false
    argument :first, Int, required: false, default_value: 25
    argument :after, String, required: false
  end
Severity: Minor
Found in app/graphql/types/query_type.rb and 2 other locations - About 20 mins to fix
app/graphql/types/query_type.rb on lines 99..103
app/graphql/types/query_type.rb on lines 204..208

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

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

    def set_include
      if params[:include].present?
        @include =
          params[:include].split(",").map { |i| i.downcase.underscore.to_sym }
        @include = @include & %i[doi]
Severity: Minor
Found in app/controllers/metadata_controller.rb and 4 other locations - About 20 mins to fix
app/controllers/contacts_controller.rb on lines 183..189
app/controllers/media_controller.rb on lines 136..142
app/controllers/providers_controller.rb on lines 364..370
app/controllers/repositories_controller.rb on lines 323..329

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

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

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

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

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

Refactorings

Further Reading

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

            if fields
              render(
                json: DataciteDoiSerializer.new(results, options.merge(fields: fields)).serializable_hash.to_json,
                status: :ok
              )
Severity: Minor
Found in app/controllers/datacite_dois_controller.rb and 1 other location - About 20 mins to fix
app/controllers/datacite_dois_controller.rb on lines 205..214

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

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

          if fields
            render(
              json: ProviderSerializer.new(@providers, options.merge(fields: fields)).serializable_hash.to_json,
              status: :ok
            )
Severity: Minor
Found in app/controllers/providers_controller.rb and 2 other locations - About 20 mins to fix
app/controllers/clients_controller.rb on lines 124..133
app/controllers/organizations_controller.rb on lines 115..124

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

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

          if fields
            render(
              json: ProviderSerializer.new(@providers, options.merge(fields: fields)).serializable_hash.to_json,
              status: :ok
            )
Severity: Minor
Found in app/controllers/organizations_controller.rb and 2 other locations - About 20 mins to fix
app/controllers/clients_controller.rb on lines 124..133
app/controllers/providers_controller.rb on lines 138..147

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

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 dissertations(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "Dissertation,Thesis"
    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 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 13 locations. Consider refactoring.
Open

  def peer_reviews(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "\"Peer review\""
    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 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 13 locations. Consider refactoring.
Open

  def books(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "Book"
    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 1087..1090
app/graphql/types/query_type.rb on lines 1130..1133
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 instruments(**args)
    args[:resource_type_id] = "Other"
    args[:resource_type] = "Instrument"
    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 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/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(
      dois(**args),
Severity: Major
Found in app/graphql/types/repository_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 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

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

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 journal_articles(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "JournalArticle"
    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 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 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 book_chapters(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "BookChapter"
    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 1087..1090
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/organization_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/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 :service_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 303..312
app/models/provider.rb on lines 312..321
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 :secondary_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 303..312
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 :secondary_service_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 303..312
app/models/provider.rb on lines 312..321
app/models/provider.rb on lines 321..330
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 data_management_plans(**args)
    args[:resource_type_id] = "Text"
    args[:resource_type] = "Data Management Plan"
    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 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

Severity
Category
Status
Source
Language