YorickPeterse/ruby-lint

View on GitHub

Showing 2,162 of 2,162 total issues

Method inspect_constants has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def inspect_constants(source = constant, ignore = [])
      names          = []
      source_name    = source.name
      have_children  = []
      include_source = source != Object
Severity: Minor
Found in lib/ruby-lint/inspector.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  defs.define_constant('Nokogiri::HTML::DocumentFragment::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::EntityDecl::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::Attr::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::Document::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::Comment::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::DTD::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::Element::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::CharacterData::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::ElementDecl::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::ProcessingInstruction::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::DocumentFragment::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::Text::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873

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

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

  defs.define_constant('Nokogiri::XML::AttributeDecl::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Syck::Set::Bucket') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/core/syck.rb and 12 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/hash.rb on lines 256..301
lib/ruby-lint/definitions/core/option_parser.rb on lines 323..368
lib/ruby-lint/definitions/core/option_parser.rb on lines 793..838
lib/ruby-lint/definitions/core/syck.rb on lines 963..1008
lib/ruby-lint/definitions/gems/mongoid.rb on lines 309..354
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7098..7143
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1937..1982
lib/ruby-lint/definitions/rails/active_support.rb on lines 1905..1950
lib/ruby-lint/definitions/rails/active_support.rb on lines 2339..2384
lib/ruby-lint/definitions/rails/active_support.rb on lines 3566..3611
lib/ruby-lint/definitions/rails/active_support.rb on lines 3870..3915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1330..1375

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

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

  defs.define_constant('Nokogiri::HTML::Document::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Nokogiri::XML::CDATA::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5309..5360
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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

  defs.define_constant('Sprockets::Railtie::OrderedOptions::Bucket') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/rails/sprockets.rb and 12 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/hash.rb on lines 256..301
lib/ruby-lint/definitions/core/option_parser.rb on lines 323..368
lib/ruby-lint/definitions/core/option_parser.rb on lines 793..838
lib/ruby-lint/definitions/core/syck.rb on lines 661..706
lib/ruby-lint/definitions/core/syck.rb on lines 963..1008
lib/ruby-lint/definitions/gems/mongoid.rb on lines 309..354
lib/ruby-lint/definitions/gems/mongoid.rb on lines 7098..7143
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1937..1982
lib/ruby-lint/definitions/rails/active_support.rb on lines 1905..1950
lib/ruby-lint/definitions/rails/active_support.rb on lines 2339..2384
lib/ruby-lint/definitions/rails/active_support.rb on lines 3566..3611
lib/ruby-lint/definitions/rails/active_support.rb on lines 3870..3915

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

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

  defs.define_constant('Mongoid::Relations::Metadata::Bucket') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('delete') do |method|
      method.define_argument('key')
Severity: Major
Found in lib/ruby-lint/definitions/gems/mongoid.rb and 12 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/core/hash.rb on lines 256..301
lib/ruby-lint/definitions/core/option_parser.rb on lines 323..368
lib/ruby-lint/definitions/core/option_parser.rb on lines 793..838
lib/ruby-lint/definitions/core/syck.rb on lines 661..706
lib/ruby-lint/definitions/core/syck.rb on lines 963..1008
lib/ruby-lint/definitions/gems/mongoid.rb on lines 309..354
lib/ruby-lint/definitions/rails/action_controller.rb on lines 1937..1982
lib/ruby-lint/definitions/rails/active_support.rb on lines 1905..1950
lib/ruby-lint/definitions/rails/active_support.rb on lines 2339..2384
lib/ruby-lint/definitions/rails/active_support.rb on lines 3566..3611
lib/ruby-lint/definitions/rails/active_support.rb on lines 3870..3915
lib/ruby-lint/definitions/rails/sprockets.rb on lines 1330..1375

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

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

  defs.define_constant('Nokogiri::XML::EntityReference::SaveOptions') do |klass|
    klass.inherits(defs.constant_proxy('Object', RubyLint.registry))

    klass.define_instance_method('as_html')

Severity: Major
Found in lib/ruby-lint/definitions/gems/nokogiri.rb and 15 other locations - About 2 hrs to fix
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1018..1069
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 1252..1303
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2515..2566
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 2740..2791
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3050..3101
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3269..3320
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3488..3539
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 3725..3776
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4071..4122
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4324..4375
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4542..4593
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 4823..4874
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 5090..5141
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 6822..6873
lib/ruby-lint/definitions/gems/nokogiri.rb on lines 7506..7557

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

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