YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

File json.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
Open

RubyLint.registry.register('JSON') do |defs|
  defs.define_constant('JSON') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_method('[]') do |method|
Severity: Minor
Found in lib/ruby-lint/definitions/core/json.rb - About 4 hrs to fix

    File matrix.rb has 337 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    RubyLint.registry.register('Matrix') do |defs|
      defs.define_constant('Matrix') do |klass|
        klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        klass.inherits(defs.constant_proxy('Matrix::CoercionHelper', RubyLint.registry))
        klass.inherits(defs.constant_proxy('ExceptionForMatrix', RubyLint.registry))
    Severity: Minor
    Found in lib/ruby-lint/definitions/core/matrix.rb - About 4 hrs to fix

      File unixserver.rb has 337 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      RubyLint.registry.register('UNIXServer') do |defs|
        defs.define_constant('UNIXServer') do |klass|
          klass.inherits(defs.constant_proxy('UNIXSocket', RubyLint.registry))
          klass.inherits(defs.constant_proxy('Socket::ListenAndAccept', RubyLint.registry))
          klass.inherits(defs.constant_proxy('IO::Socketable', RubyLint.registry))
      Severity: Minor
      Found in lib/ruby-lint/definitions/core/unixserver.rb - About 4 hrs to fix

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

          defs.define_constant('Mongoid::Criteria::MapReduce') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 4 hrs to fix
        lib/ruby-lint/definitions/gems/mongoid.rb on lines 1570..1630

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

        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

          defs.define_constant('Mongoid::Contextual::MapReduce') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 4 hrs to fix
        lib/ruby-lint/definitions/gems/mongoid.rb on lines 2733..2793

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

        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

          defs.define_constant('Celluloid::PoolManager::ClassMethods') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_instance_method('===') do |method|
              method.define_argument('other')
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/celluloid.rb on lines 677..731

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

        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

          defs.define_constant('Celluloid::ClassMethods') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_instance_method('===') do |method|
              method.define_argument('other')
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/celluloid.rb on lines 2056..2110

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

        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

          defs.define_constant('URI::HTTPS::LDAP') do |klass|
            klass.inherits(defs.constant_proxy('URI::Generic', RubyLint.registry))
        
            klass.define_method('build') do |method|
              method.define_argument('args')
        Severity: Major
        Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/core/uri.rb on lines 1085..1147

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

        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

          defs.define_constant('RSpec::Core::SuiteHookContext::ExecutionResult') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('RSpec::Core::HashImitatable', RubyLint.registry))
        
            klass.define_instance_method('ensure_timing_set') do |method|
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/rspec.rb on lines 1305..1367

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

        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

          defs.define_constant('URI::LDAP') do |klass|
            klass.inherits(defs.constant_proxy('URI::Generic', RubyLint.registry))
        
            klass.define_method('build') do |method|
              method.define_argument('args')
        Severity: Major
        Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/core/uri.rb on lines 812..874

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

        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

          defs.define_constant('RSpec::Core::Example::ExecutionResult') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('RSpec::Core::HashImitatable', RubyLint.registry))
        
            klass.define_instance_method('ensure_timing_set') do |method|
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/rspec.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/rspec.rb on lines 8904..8966

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

        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

          defs.define_constant('Sinatra::Application::HeaderHash') do |klass|
            klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))
        
            klass.define_method('new') do |method|
              method.define_optional_argument('hash')
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/sinatra.rb on lines 995..1053

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

        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

          defs.define_constant('Sinatra::Base::HeaderHash') do |klass|
            klass.inherits(defs.constant_proxy('Hash', RubyLint.registry))
        
            klass.define_method('new') do |method|
              method.define_optional_argument('hash')
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/sinatra.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/sinatra.rb on lines 139..197

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

        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

          defs.define_constant('ActionView::Helpers::ClassMethods') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_instance_method('full_sanitizer')
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/rails/action_view.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/rails/action_view.rb on lines 600..667

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

        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

          defs.define_constant('ActionView::Base::ClassMethods') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_instance_method('full_sanitizer')
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/rails/action_view.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/rails/action_view.rb on lines 2397..2464

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

        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

          defs.define_constant('URI::FTP') do |klass|
            klass.inherits(defs.constant_proxy('URI::Generic', RubyLint.registry))
            klass.inherits(defs.constant_proxy('OpenURI::OpenRead', RubyLint.registry))
        
            klass.define_method('build') do |method|
        Severity: Major
        Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/core/uri.rb on lines 495..544

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

        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

          defs.define_constant('URI::HTTPS::FTP') do |klass|
            klass.inherits(defs.constant_proxy('URI::Generic', RubyLint.registry))
            klass.inherits(defs.constant_proxy('OpenURI::OpenRead', RubyLint.registry))
        
            klass.define_method('build') do |method|
        Severity: Major
        Found in lib/ruby-lint/definitions/core/uri.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/core/uri.rb on lines 113..162

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

        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

          defs.define_constant('Mongoid::Criteria::GeoNear') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/mongoid.rb on lines 1458..1508

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

        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

          defs.define_constant('Mongoid::Contextual::GeoNear') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Mongoid::Contextual::Command', RubyLint.registry))
            klass.inherits(defs.constant_proxy('Enumerable', RubyLint.registry))
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/mongoid.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/mongoid.rb on lines 2668..2718

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

        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

          defs.define_constant('Celluloid::Task') do |klass|
            klass.inherits(defs.constant_proxy('Object', RubyLint.registry))
        
            klass.define_method('current')
        
        
        Severity: Major
        Found in lib/ruby-lint/definitions/gems/celluloid.rb and 1 other location - About 3 hrs to fix
        lib/ruby-lint/definitions/gems/celluloid.rb on lines 3236..3296

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

        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