datacite/lupo

View on GitHub

Showing 575 of 596 total issues

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

  field :publications,
        PublicationConnectionWithTotalType,
        null: true, description: "Funded publications" do
    argument :query, String, required: false
    argument :ids, [String], required: false
Severity: Major
Found in app/graphql/types/funder_type.rb and 5 other locations - About 4 hrs to fix
app/graphql/types/funder_type.rb on lines 25..52
app/graphql/types/funder_type.rb on lines 83..110
app/graphql/types/funder_type.rb on lines 112..140
app/graphql/types/member_type.rb on lines 163..190
app/graphql/types/repository_type.rb on lines 224..252

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

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

  field :softwares,
        SoftwareConnectionWithTotalType,
        null: true, description: "Funded software" do
    argument :query, String, required: false
    argument :ids, [String], required: false
Severity: Major
Found in app/graphql/types/funder_type.rb and 5 other locations - About 4 hrs to fix
app/graphql/types/funder_type.rb on lines 25..52
app/graphql/types/funder_type.rb on lines 54..81
app/graphql/types/funder_type.rb on lines 112..140
app/graphql/types/member_type.rb on lines 163..190
app/graphql/types/repository_type.rb on lines 224..252

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

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

  field :data_management_plans,
        DataManagementPlanConnectionWithTotalType,
        null: true,
        description: "Data management plans from this organization" do
    argument :query, String, required: false
Severity: Major
Found in app/graphql/types/funder_type.rb and 5 other locations - About 4 hrs to fix
app/graphql/types/funder_type.rb on lines 25..52
app/graphql/types/funder_type.rb on lines 54..81
app/graphql/types/funder_type.rb on lines 83..110
app/graphql/types/member_type.rb on lines 163..190
app/graphql/types/repository_type.rb on lines 224..252

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

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

  field :datasets,
        DatasetConnectionWithTotalType,
        null: true, description: "Funded datasets" do
    argument :query, String, required: false
    argument :ids, [String], required: false
Severity: Major
Found in app/graphql/types/funder_type.rb and 5 other locations - About 4 hrs to fix
app/graphql/types/funder_type.rb on lines 54..81
app/graphql/types/funder_type.rb on lines 83..110
app/graphql/types/funder_type.rb on lines 112..140
app/graphql/types/member_type.rb on lines 163..190
app/graphql/types/repository_type.rb on lines 224..252

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

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

File repositories_controller.rb has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class RepositoriesController < ApplicationController
  include ActionController::MimeResponds
  include Countable

  before_action :set_repository, only: %i[show update destroy]
Severity: Minor
Found in app/controllers/repositories_controller.rb - About 4 hrs to fix

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

      field :datasets,
            DatasetConnectionWithTotalType,
            null: true, description: "Datasets from this organization" do
        argument :query, String, required: false
        argument :ids, [String], required: false
    Severity: Major
    Found in app/graphql/types/organization_type.rb and 3 other locations - About 4 hrs to fix
    app/graphql/types/organization_type.rb on lines 92..118
    app/graphql/types/organization_type.rb on lines 120..146
    app/graphql/types/organization_type.rb on lines 148..175

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

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

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

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

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

    Refactorings

    Further Reading

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

      field :data_management_plans,
            DataManagementPlanConnectionWithTotalType,
            null: true,
            description: "Data management plans from this organization" do
        argument :query, String, required: false
    Severity: Major
    Found in app/graphql/types/organization_type.rb and 3 other locations - About 4 hrs to fix
    app/graphql/types/organization_type.rb on lines 64..90
    app/graphql/types/organization_type.rb on lines 92..118
    app/graphql/types/organization_type.rb on lines 120..146

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

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

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

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

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

    Refactorings

    Further Reading

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

      field :publications,
            PublicationConnectionWithTotalType,
            null: true, description: "Publications from this organization" do
        argument :query, String, required: false
        argument :ids, [String], required: false
    Severity: Major
    Found in app/graphql/types/organization_type.rb and 3 other locations - About 4 hrs to fix
    app/graphql/types/organization_type.rb on lines 64..90
    app/graphql/types/organization_type.rb on lines 120..146
    app/graphql/types/organization_type.rb on lines 148..175

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

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

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

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

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

    Refactorings

    Further Reading

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

      field :softwares,
            SoftwareConnectionWithTotalType,
            null: true, description: "Software from this organization" do
        argument :query, String, required: false
        argument :ids, [String], required: false
    Severity: Major
    Found in app/graphql/types/organization_type.rb and 3 other locations - About 4 hrs to fix
    app/graphql/types/organization_type.rb on lines 64..90
    app/graphql/types/organization_type.rb on lines 92..118
    app/graphql/types/organization_type.rb on lines 148..175

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

    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

    File organization_type.rb has 354 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class OrganizationType < BaseObject
      MEMBER_ROLES = {
        "ROLE_CONSORTIUM" => "consortium",
        "ROLE_CONSORTIUM_ORGANIZATION" => "consortium_organization",
        "ROLE_ALLOCATOR" => "direct_member",
    Severity: Minor
    Found in app/graphql/types/organization_type.rb - About 4 hrs to fix

      File member_type.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class MemberType < BaseObject
        description "Information about members"
      
        field :id,
              ID,
      Severity: Minor
      Found in app/graphql/types/member_type.rb - About 4 hrs to fix

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

          field :works,
                WorkConnectionWithTotalType,
                null: true, description: "Authored works" do
            argument :query, String, required: false
            argument :ids, [String], required: false
        Severity: Major
        Found in app/graphql/types/person_type.rb and 1 other location - About 4 hrs to fix
        app/graphql/types/member_type.rb on lines 109..135

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

        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

          field :softwares,
                SoftwareConnectionWithTotalType,
                null: true, description: "Software by this provider." do
            argument :query, String, required: false
            argument :ids, [String], required: false
        Severity: Major
        Found in app/graphql/types/member_type.rb and 1 other location - About 4 hrs to fix
        app/graphql/types/person_type.rb on lines 124..150

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

        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

          field :datasets,
                DatasetConnectionWithTotalType,
                null: true, description: "Datasets by this provider." do
            argument :query, String, required: false
            argument :ids, String, required: false
        Severity: Major
        Found in app/graphql/types/member_type.rb and 1 other location - About 4 hrs to fix
        app/graphql/types/member_type.rb on lines 81..107

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

        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

          field :publications,
                PublicationConnectionWithTotalType,
                null: true, description: "Publications by this provider." do
            argument :query, String, required: false
            argument :ids, String, required: false
        Severity: Major
        Found in app/graphql/types/member_type.rb and 1 other location - About 4 hrs to fix
        app/graphql/types/member_type.rb on lines 53..79

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

        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

        Method organizations has 107 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def organizations
            authorize! :export, :organizations
        
            begin
              # Loop through all providers
        Severity: Major
        Found in app/controllers/exports_controller.rb - About 4 hrs to fix

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

            field :datasets,
                  DatasetConnectionWithTotalType,
                  null: true, description: "Authored datasets" do
              argument :query, String, required: false
              argument :ids, [String], required: false
          Severity: Major
          Found in app/graphql/types/person_type.rb and 1 other location - About 4 hrs to fix
          app/graphql/types/person_type.rb on lines 71..96

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

          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

            field :publications,
                  PublicationConnectionWithTotalType,
                  null: true, description: "Authored publications" do
              argument :query, String, required: false
              argument :ids, [String], required: false
          Severity: Major
          Found in app/graphql/types/person_type.rb and 1 other location - About 4 hrs to fix
          app/graphql/types/person_type.rb on lines 44..69

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

          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

          Method index has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def index
              sort =
                case params[:sort]
                when "relevance"
                  { "_score" => { order: "desc" } }
          Severity: Major
          Found in app/controllers/members_controller.rb - About 4 hrs to fix

            Method index has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def index
                sort =
                  case params[:sort]
                  when "relevance"
                    { "_score" => { order: "desc" } }
            Severity: Major
            Found in app/controllers/prefixes_controller.rb - About 4 hrs to fix
              Severity
              Category
              Status
              Source
              Language