cerebris/jsonapi-resources

View on GitHub
lib/jsonapi/exceptions.rb

Summary

Maintainability
F
3 days
Test Coverage

File exceptions.rb has 502 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module JSONAPI
  module Exceptions
    class Error < RuntimeError
      attr_reader :error_object_overrides

Severity: Major
Found in lib/jsonapi/exceptions.rb - About 1 day to fix

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

        class InvalidPageValue < Error
          attr_accessor :page, :value
    
          def initialize(page, value, error_object_overrides = {})
            @page = page
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 4 other locations - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 221..237
    lib/jsonapi/exceptions.rb on lines 241..257
    lib/jsonapi/exceptions.rb on lines 312..328
    lib/jsonapi/exceptions.rb on lines 332..348

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 49.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidFilterValue < Error
          attr_accessor :filter, :value
    
          def initialize(filter, value, error_object_overrides = {})
            @filter = filter
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 4 other locations - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 241..257
    lib/jsonapi/exceptions.rb on lines 312..328
    lib/jsonapi/exceptions.rb on lines 332..348
    lib/jsonapi/exceptions.rb on lines 575..591

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

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidField < Error
          attr_accessor :field, :type
    
          def initialize(type, field, error_object_overrides = {})
            @field = field
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 4 other locations - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 221..237
    lib/jsonapi/exceptions.rb on lines 241..257
    lib/jsonapi/exceptions.rb on lines 332..348
    lib/jsonapi/exceptions.rb on lines 575..591

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

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidRelationship < Error
          attr_accessor :relationship_name, :type
    
          def initialize(type, relationship_name, error_object_overrides = {})
            @relationship_name = relationship_name
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 4 other locations - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 221..237
    lib/jsonapi/exceptions.rb on lines 241..257
    lib/jsonapi/exceptions.rb on lines 312..328
    lib/jsonapi/exceptions.rb on lines 575..591

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

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidFieldValue < Error
          attr_accessor :field, :value
    
          def initialize(field, value, error_object_overrides = {})
            @field = field
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 4 other locations - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 221..237
    lib/jsonapi/exceptions.rb on lines 312..328
    lib/jsonapi/exceptions.rb on lines 332..348
    lib/jsonapi/exceptions.rb on lines 575..591

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

    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

        class NotAcceptableError < Error
          attr_accessor :media_type
    
          def initialize(media_type, error_object_overrides = {})
            @media_type = media_type
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 1 other location - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 106..122

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

    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

        class InvalidSortCriteria < Error
          attr_accessor :sort_criteria, :resource
    
          def initialize(resource, sort_criteria, error_object_overrides = {})
            @resource = resource
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 1 other location - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 352..368

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

    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

        class UnsupportedMediaTypeError < Error
          attr_accessor :media_type
    
          def initialize(media_type, error_object_overrides = {})
            @media_type = media_type
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 1 other location - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 126..142

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

    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

        class InvalidInclude < Error
          attr_accessor :relationship, :resource
    
          def initialize(resource, relationship, error_object_overrides = {})
            @resource = resource
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 1 other location - About 1 hr to fix
    lib/jsonapi/exceptions.rb on lines 372..388

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

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

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

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

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

    Refactorings

    Further Reading

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

        class ParameterNotAllowed < Error
          attr_accessor :param
    
          def initialize(param, error_object_overrides = {})
            @param = param
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class ParameterMissing < Error
          attr_accessor :param
    
          def initialize(param, error_object_overrides = {})
            @param = param
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 392..406

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

        class FilterNotAllowed < Error
          attr_accessor :filter
    
          def initialize(filter, error_object_overrides = {})
            @filter = filter
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 392..406
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class TypeMismatch < Error
          attr_accessor :type
    
          def initialize(type, error_object_overrides = {})
            @type = type
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 392..406
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class RecordNotFound < Error
          attr_accessor :id
    
          def initialize(id, error_object_overrides = {})
            @id = id
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 392..406
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class InvalidFiltersSyntax < Error
          attr_accessor :filters
    
          def initialize(filters, error_object_overrides = {})
            @filters = filters
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 70..84
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 392..406
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class InvalidResource < Error
          attr_accessor :resource
    
          def initialize(resource, error_object_overrides = {})
            @resource = resource
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 6 other locations - About 45 mins to fix
    lib/jsonapi/exceptions.rb on lines 88..102
    lib/jsonapi/exceptions.rb on lines 184..199
    lib/jsonapi/exceptions.rb on lines 203..217
    lib/jsonapi/exceptions.rb on lines 294..308
    lib/jsonapi/exceptions.rb on lines 392..406
    lib/jsonapi/exceptions.rb on lines 410..424

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

        class ToManySetReplacementForbidden < Error
          def errors
            [create_error_object(code: JSONAPI::FORBIDDEN,
                                 status: :forbidden,
                                 title: I18n.translate('jsonapi-resources.exceptions.to_many_set_replacement_forbidden.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidLinksObject < Error
          def errors
            [create_error_object(code: JSONAPI::INVALID_LINKS_OBJECT,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.invalid_links_object.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidPageObject < Error
          def errors
            [create_error_object(code: JSONAPI::INVALID_PAGE_OBJECT,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.invalid_page_object.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidRequestFormat < Error
          def errors
            [create_error_object(code: JSONAPI::BAD_REQUEST,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.invalid_request_format.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class SaveFailed < Error
          def errors
            [create_error_object(code: JSONAPI::SAVE_FAILED,
                                 status: :unprocessable_entity,
                                 title: I18n.translate('jsonapi-resources.exceptions.save_failed.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class MissingKey < Error
          def errors
            [create_error_object(code: JSONAPI::KEY_ORDER_MISMATCH,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.missing_key.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidFieldFormat < Error
          def errors
            [create_error_object(code: JSONAPI::INVALID_FIELD_FORMAT,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.invalid_field_format.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 272..279
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 26.

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

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

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

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

    Refactorings

    Further Reading

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

        class InvalidDataFormat < Error
          def errors
            [create_error_object(code: JSONAPI::INVALID_DATA_FORMAT,
                                 status: :bad_request,
                                 title: I18n.translate('jsonapi-resources.exceptions.invalid_data_format.title',
    Severity: Major
    Found in lib/jsonapi/exceptions.rb and 7 other locations - About 15 mins to fix
    lib/jsonapi/exceptions.rb on lines 162..169
    lib/jsonapi/exceptions.rb on lines 173..180
    lib/jsonapi/exceptions.rb on lines 261..268
    lib/jsonapi/exceptions.rb on lines 283..290
    lib/jsonapi/exceptions.rb on lines 447..454
    lib/jsonapi/exceptions.rb on lines 532..539
    lib/jsonapi/exceptions.rb on lines 543..550

    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

    There are no issues that match your filters.

    Category
    Status