autoforce/APIcasso

View on GitHub
app/controllers/apicasso/apidocs_controller.rb

Summary

Maintainability
C
1 day
Test Coverage

Class has too many lines. [478/100]
Open

  class ApidocsController < Apicasso::ApplicationController
    skip_before_action :restrict_access

    include Swagger::Blocks
    # Default application settings for documentation generation.

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Block has too many lines. [369/25]
Open

    ActiveRecord::Base.descendants.each do |model|
      next if MODELS_EXCLUDED.include?(model.name) || model.abstract_class

      # Resource definitions of GET, OPTIONS, POST
      swagger_path "/#{model.name.underscore}" do

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Complex method Apicasso::ApidocsController::operation(get)::response#200 (237.7)
Open

            response 200 do
              key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.response",
                                      default: "#{inner_name} response, which include records matching current query and pagination metadata")
              schema do
                key :name, :total

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method Apicasso::ApidocsController::operation#get (202.9)
Open

          operation :get do
            key :summary, I18n.t("activerecord.models.#{inner_name.underscore}.index.summary", default: inner_name)
            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.description", default: inner_name)
            key :operationId, "find#{inner_name.pluralize}"
            key :produces, ['application/json']

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Block has too many lines. [142/25]
Open

      model.reflect_on_all_associations.each do |association|
        begin
          inner_name = association.class_name.to_s.classify
        rescue NoMethodError, ActionController::RoutingError
          inner_name = association.name.to_s.classify

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [141/25]
Open

      swagger_path "/#{model.name.underscore}" do
        operation :get do
          key :summary, I18n.t("activerecord.models.#{model.name.underscore}.index.summary", default: model.name)
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.index.description", default: model.name)
          key :operationId, "find#{model.name.pluralize}"

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [131/25]
Open

        swagger_path "/#{model.name.underscore}/{id}/#{association.name}" do
          operation :get do
            key :summary, I18n.t("activerecord.models.#{inner_name.underscore}.index.summary", default: inner_name)
            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.description", default: inner_name)
            key :operationId, "find#{inner_name.pluralize}"

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

File apidocs_controller.rb has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Apicasso
  # Controller used to generate an application Swagger JSON, used by
  # SwaggerUI to generate beautiful API documentation
  class ApidocsController < Apicasso::ApplicationController
    skip_before_action :restrict_access
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb - About 7 hrs to fix

Block has too many lines. [108/25]
Open

          operation :get do
            key :summary, I18n.t("activerecord.models.#{inner_name.underscore}.index.summary", default: inner_name)
            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.description", default: inner_name)
            key :operationId, "find#{inner_name.pluralize}"
            key :produces, ['application/json']

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [101/25]
Open

        operation :get do
          key :summary, I18n.t("activerecord.models.#{model.name.underscore}.index.summary", default: model.name)
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.index.description", default: model.name)
          key :operationId, "find#{model.name.pluralize}"
          key :produces, ['application/json']

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Complex method Apicasso::ApidocsController::operation#patch (75.7)
Open

        operation :patch do
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.response",
                                  default: "Updates a #{model.name}")
          key :operationId, "edit#{model.name}"
          key :produces, ['application/json']

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Block has too many lines. [79/25]
Open

      swagger_path "/#{model.name.underscore}/{id}" do
        operation :patch do
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.response",
                                  default: "Updates a #{model.name}")
          key :operationId, "edit#{model.name}"

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [61/25]
Open

          response 200 do
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.index.response",
                                    default: "#{model.name} response, which include records matching current query and pagination metadata")
            schema do
              key :name, :total

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [61/25]
Open

            response 200 do
              key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.response",
                                      default: "#{inner_name} response, which include records matching current query and pagination metadata")
              schema do
                key :name, :total

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Complex method Apicasso::ApidocsController::operation#post (51.1)
Open

        operation :post do
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.create.response",
                                  default: "Creates a #{model.name}")
          key :operationId, "add#{model.name}"
          key :produces, ['application/json']

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method Apicasso::ApidocsController::operation#delete (44.8)
Open

        operation :delete do
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.destroy.response",
                                  default: "Deletes a #{model.name}")
          key :operationId, "destroy#{model.name}"
          key :produces, ['application/json']

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Complex method Apicasso::ApidocsController::operation#options (38.4)
Open

          operation :options do
            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.schema.description",
                                    default: "#{inner_name} metadata information.")
            key :operationId, "schema#{inner_name.pluralize}"
            key :produces, ['application/json']

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Block has too many lines. [40/25]
Open

    swagger_root do
      MODELS_EXCLUDED = [
        'ApplicationRecord',
        'ActiveRecord::SchemaMigration',
        'Apicasso::ApplicationRecord',

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [39/25]
Open

    SWAGGERED_CLASSES.each do |klass|
      next if MODELS_EXCLUDED.include?(klass.name) || klass.abstract_class

      swagger_schema klass.name.to_sym do
        key :required, klass.presence_validators if klass.presence_validators?

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Complex method Apicasso::ApidocsController::operation(options)::response#200 (33.0)
Open

            response 200 do
              key :description, I18n.t("activerecord.models.#{inner_name.underscore}.schema.response",
                                      default: "#{inner_name} metadata as a json with field names as keys and field types as values.")
              schema do
                key :'$ref', "#{inner_name}".to_sym

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Block has too many lines. [32/25]
Open

        operation :patch do
          key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.response",
                                  default: "Updates a #{model.name}")
          key :operationId, "edit#{model.name}"
          key :produces, ['application/json']

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

          parameter do
            key :name, model.name.underscore.to_sym
            key :in, :body
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.create.description",
                                  default: "#{model.name} to add into application")
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 1 other location - About 45 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 292..299

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

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

          parameter do
            key :name, model.name.underscore.to_sym
            key :in, :body
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.description",
                                    default: "Existing #{model.name} to update on the application")
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 1 other location - About 45 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 256..263

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

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

          parameter do
            key :name, :id
            key :in, :path
            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",
                                    default: "ID of #{model.name} to delete on the application")
Severity: Major
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 40 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 282..289
app/controllers/apicasso/apidocs_controller.rb on lines 316..323

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

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

          parameter do
            key :name, :id
            key :in, :path
            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",
                                    default: "ID of #{model.name} to update on the application")
Severity: Major
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 40 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 316..323
app/controllers/apicasso/apidocs_controller.rb on lines 340..347

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

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

          parameter do
            key :name, :id
            key :in, :path
            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",
                                    default: "ID of #{model.name} to fetch on the application")
Severity: Major
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 40 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 282..289
app/controllers/apicasso/apidocs_controller.rb on lines 340..347

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

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

          response 200 do
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",
                                    default: "#{model.name} response")
            schema do
              key :'$ref', model.name.to_sym
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 20 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 266..270
app/controllers/apicasso/apidocs_controller.rb on lines 326..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 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

          response 200 do
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",
                                    default: "#{model.name} response")
            schema do
              key :'$ref', model.name.to_sym
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 20 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 266..270
app/controllers/apicasso/apidocs_controller.rb on lines 302..306

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

          response 201 do
            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",
                                    default: "#{model.name} response")
            schema do
              key :'$ref', model.name.to_sym
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 2 other locations - About 20 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 302..306
app/controllers/apicasso/apidocs_controller.rb on lines 326..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 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

          parameter do
            key :name, :sort
            key :in, :query
            key :description, I18n.t('apicasso.sort.description',
                                    default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 1 other location - About 15 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 376..384

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

            parameter do
              key :name, :sort
              key :in, :query
              key :description, I18n.t('apicasso.sort.description',
                                      default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')
Severity: Minor
Found in app/controllers/apicasso/apidocs_controller.rb and 1 other location - About 15 mins to fix
app/controllers/apicasso/apidocs_controller.rb on lines 139..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 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

Align the parameters of a method call if they span more than one line.
Open

                                    default: "ID of #{model.name} to delete on the application")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'Total records contained in current collection, as if there was no pagination.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: "The link of the previous page for the current collection. It can be null if there isn't any")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [263/80]
Open

                                    default: 'Records filtering by attribute and search query as affix. Usage: `?q[{attribute}{search_affix}]={matcher}`. All available search affixes are listed on: https://github.com/activerecord-hackery/ransack#search-matchers')

Line is too long. [96/80]
Open

                                    default: "ID of #{model.name} to update on the application")

Line is too long. [101/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'Total records contained in current collection, as if there was no pagination.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                  default: "Creates a #{model.name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'Records pagination size, which sets how many records will be rendered per request')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [89/80]
Open

        key :description, ENV.fetch('APP_DESCRIPTION', I18n.t('application.description'))

Line is too long. [81/80]
Open

            key :required, %i[*presence_validators] if klass.presence_validators?

Line is too long. [129/80]
Open

                                    default: 'Records pagination size, which sets how many records will be rendered per request')

Avoid using rescue in its modifier form.
Open

        inner_klass = begin inner_name.constantize rescue NameError; false end

This cop checks for uses of rescue in its modifier form.

Example:

# bad
some_method rescue handle_error

# good
begin
  some_method
rescue
  handle_error
end

Align the parameters of a method call if they span more than one line.
Open

                                  default: "#{model.name} metadata information.")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [100/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.schema.response",

Line is too long. [103/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.description",

Line is too long. [123/80]
Open

            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.description", default: inner_name)

Line is too long. [142/80]
Open

                                      default: "#{inner_name} response, which include records matching current query and pagination metadata")

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'An indication if current request is the last to paginate in the current collection')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                  default: "Creates a #{model.name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                  default: "Deletes a #{model.name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} response")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'An indication if current request is the last to paginate in the current collection')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'How many records were offsetted from the collection to render the current page')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [140/80]
Open

                                    default: "#{model.name} response, which include records matching current query and pagination metadata")

Line is too long. [100/80]
Open

                                      default: 'How many pages of data the current collection has.')

Line is too long. [98/80]
Open

            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",

Line is too long. [95/80]
Open

                                    default: "ID of #{model.name} to fetch on the application")

Line is too long. [93/80]
Open

              key :description, I18n.t("activerecord.errors.models.#{inner_name.underscore}",

Line is too long. [83/80]
Open

                                      default: "Unexpected error in #{inner_name}")

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Align the parameters of a method call if they span more than one line.
Open

                                  default: "#{model.name} to add into application")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{inner_name} metadata information.")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [103/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.create.description",

Line is too long. [101/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'How many records were offsetted from the collection to render the current page')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} response")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'Records filtering by attribute and search query as affix. Usage: `?q[{attribute}{search_affix}]={matcher}`. All available search affixes are listed on: https://github.com/activerecord-hackery/ransack#search-matchers')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [115/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.description", default: model.name)

Line is too long. [113/80]
Open

          key :summary, I18n.t("activerecord.models.#{model.name.underscore}.index.summary", default: model.name)

Line is too long. [121/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.index.description", default: model.name)

Line is too long. [105/80]
Open

                                      default: 'The records collection in the current pagination scope.')

Line is too long. [101/80]
Open

              key :description, I18n.t("activerecord.models.#{inner_name.underscore}.index.response",

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Align the parameters of a method call if they span more than one line.
Open

                                    default: "ID of #{model.name} to update on the application")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "ID of #{model.name} to fetch on the application")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: "Unexpected error in #{inner_name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Useless assignment to variable - inner_klass.
Open

        inner_klass = begin inner_name.constantize rescue NameError; false end

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

Line is too long. [98/80]
Open

      key :host, I18n.t('application.apicasso_host', default: ENV.fetch('ROOT', 'localhost:3000'))

Line is too long. [81/80]
Open

                                  default: "#{model.name} metadata information.")

Line is too long. [98/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.create.response",

Line is too long. [160/80]
Open

                                      default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')

Align the parameters of a method call if they span more than one line.
Open

                                    default: 'Records pagination size, which sets how many records will be rendered per request')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'How many pages of data the current collection has.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [141/80]
Open

                                      default: "The link of the previous page for the current collection. It can be null if there isn't any")

Line is too long. [130/80]
Open

                                        default: 'How many records were offsetted from the collection to render the current page')

Line is too long. [83/80]
Open

                                      default: "Unexpected error in #{inner_name}")

Line is too long. [134/80]
Open

                                      default: "#{inner_name} metadata as a json with field names as keys and field types as values.")

Align the parameters of a method call if they span more than one line.
Open

                                    default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: "The link of the next page for the current collection. It can be null if there isn't any")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [128/80]
Open

                                    default: 'Records pagination paging, which offsets collection based on `params[:per_page]`')

Line is too long. [132/80]
Open

                                    default: "#{model.name} metadata as a json with field names as keys and field types as values.")

Line is too long. [115/80]
Open

            key :summary, I18n.t("activerecord.models.#{inner_name.underscore}.index.summary", default: inner_name)

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Align the parameters of a method call if they span more than one line.
Open

                                  default: "Updates a #{model.name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [86/80]
Open

                      altText: I18n.t('app.logo.alttext', default: 'Application Logo')

Line is too long. [139/80]
Open

                                        default: "The link of the next page for the current collection. It can be null if there isn't any")

Line is too long. [102/80]
Open

              key :description, I18n.t("activerecord.models.#{inner_name.underscore}.schema.response",

Line is too long. [104/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.destroy.description",

Line is too long. [130/80]
Open

                                      default: 'Records pagination paging, which offsets collection based on `params[:per_page]`')

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'The records collection in the current pagination scope.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'An indication if current request is out of pagination bounds for the current collection')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [99/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.index.response",

Line is too long. [98/80]
Open

            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",

Line is too long. [99/80]
Open

                                    default: "Existing #{model.name} to update on the application")

Line is too long. [86/80]
Open

        next if Apicasso.configuration.model_definitions_excluded.include?(inner_name)

Line is too long. [134/80]
Open

                                        default: 'An indication if current request is the last to paginate in the current collection')

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} response, which include records matching current query and pagination metadata")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} metadata as a json with field names as keys and field types as values.")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: "The link of the next page for the current collection. It can be null if there isn't any")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [137/80]
Open

                                      default: "The link of the next page for the current collection. It can be null if there isn't any")

Line is too long. [137/80]
Open

                                      default: 'An indication if current request is out of pagination bounds for the current collection')

Line is too long. [101/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.schema.description",

Line is too long. [98/80]
Open

            key :description, I18n.t("activerecord.models.attributes.#{model.name.underscore}.id",

Line is too long. [139/80]
Open

                                        default: 'An indication if current request is out of pagination bounds for the current collection')

Line is too long. [103/80]
Open

            key :description, I18n.t("activerecord.models.#{inner_name.underscore}.schema.description",

Line is too long. [83/80]
Open

                                    default: "#{inner_name} metadata information.")

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'How many pages of data the current collection has.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} response")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [128/80]
Open

                                      default: 'How many records were offsetted from the collection to render the current page')

Line is too long. [83/80]
Open

                                  default: "#{model.name} to add into application")

Line is too long. [101/80]
Open

            key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.description",

Line is too long. [265/80]
Open

                                      default: 'Records filtering by attribute and search query as affix. Usage: `?q[{attribute}{search_affix}]={matcher}`. All available search affixes are listed on: https://github.com/activerecord-hackery/ransack#search-matchers')

Line is too long. [129/80]
Open

                                        default: 'Total records contained in current collection, as if there was no pagination.')

Align the parameters of a method call if they span more than one line.
Open

                                    default: 'Records filtering by attribute and search query as affix. Usage: `?q[{attribute}{search_affix}]={matcher}`. All available search affixes are listed on: https://github.com/activerecord-hackery/ransack#search-matchers')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: 'Records pagination paging, which offsets collection based on `params[:per_page]`')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'An indication if current request is out of pagination bounds for the current collection')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: 'Records pagination paging, which offsets collection based on `params[:per_page]`')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: "#{inner_name} response, which include records matching current query and pagination metadata")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                        default: 'The records collection in the current pagination scope.')

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: "Unexpected error in #{inner_name}")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [158/80]
Open

                                    default: 'Parameters sorting splitted by `,` preffixed by `+` or `-` which translates into ascending or descending order')

Line is too long. [132/80]
Open

                                      default: 'An indication if current request is the last to paginate in the current collection')

Line is too long. [98/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.update.response",

Line is too long. [96/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.show.response",

Line is too long. [99/80]
Open

          key :description, I18n.t("activerecord.models.#{model.name.underscore}.destroy.response",

Line is too long. [131/80]
Open

                                      default: 'Records pagination size, which sets how many records will be rendered per request')

Line is too long. [143/80]
Open

                                        default: "The link of the previous page for the current collection. It can be null if there isn't any")

Line is too long. [93/80]
Open

              key :description, I18n.t("activerecord.errors.models.#{inner_name.underscore}",

Align the parameters of a method call if they span more than one line.
Open

                                      default: "The link of the previous page for the current collection. It can be null if there isn't any")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "Existing #{model.name} to update on the application")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                    default: "#{model.name} response")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Align the parameters of a method call if they span more than one line.
Open

                                      default: "#{inner_name} metadata as a json with field names as keys and field types as values.")

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

Line is too long. [107/80]
Open

          key :name, I18n.t("activerecord.models.#{model.name.underscore}", default: model.name.underscore)

Line is too long. [127/80]
Open

                                      default: 'Total records contained in current collection, as if there was no pagination.')

Line is too long. [96/80]
Open

                                    default: "ID of #{model.name} to delete on the application")

Line is too long. [102/80]
Open

                                        default: 'How many pages of data the current collection has.')

Line is too long. [107/80]
Open

                                        default: 'The records collection in the current pagination scope.')

Use %i or %I for an array of symbols.
Open

      key :required, [:code, :message]

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Prefer to_s over string interpolation.
Open

                  key :'$ref', "#{inner_name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Prefer to_s over string interpolation.
Open

                key :'$ref', "#{inner_name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Prefer to_s over string interpolation.
Open

              key :'$ref', "#{model.name}".to_sym

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

There are no issues that match your filters.

Category
Status