autoforce/APIcasso

View on GitHub

Showing 10 of 317 total issues

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

Severity
Category
Status
Source
Language