seppaleinen/torrentify

View on GitHub

Showing 11 of 12 total issues

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

class TestIsohuntClass < Test::Unit::TestCase
  def test_connection
    url = IsohuntParser::Parser::BASEURL

    assert_nothing_raised do
Severity: Major
Found in test-integration/manager/sites/isohunt_test.rb and 2 other locations - About 1 hr to fix
test-integration/manager/sites/kickass_test.rb on lines 8..39
test-integration/manager/sites/piratebay_test.rb on lines 8..39

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

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

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

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

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

Refactorings

Further Reading

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

class TestPirateBayClass < Test::Unit::TestCase
  def test_connection
    url = PirateBayParser::Parser::BASEURL

    assert_nothing_raised do
Severity: Major
Found in test-integration/manager/sites/piratebay_test.rb and 2 other locations - About 1 hr to fix
test-integration/manager/sites/isohunt_test.rb on lines 8..39
test-integration/manager/sites/kickass_test.rb on lines 8..39

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

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

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

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

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

Refactorings

Further Reading

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

class TestKickassClass < Test::Unit::TestCase
  def test_connection
    url = KickassParser::Parser::BASEURL

    assert_nothing_raised do
Severity: Major
Found in test-integration/manager/sites/kickass_test.rb and 2 other locations - About 1 hr to fix
test-integration/manager/sites/isohunt_test.rb on lines 8..39
test-integration/manager/sites/piratebay_test.rb on lines 8..39

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

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

  def main_divs
    divs = @page.search(".//tr[@class='even' or @class='odd']")
    torrents = []
    divs.each do |div|
      torrent_file = Parser.torrent_url(div)
Severity: Major
Found in lib/manager/sites/kickass_parser.rb and 3 other locations - About 55 mins to fix
lib/manager/sites/extratorrent_parser.rb on lines 62..74
lib/manager/sites/isohunt_parser.rb on lines 59..71
lib/manager/sites/piratebay_parser.rb on lines 64..76

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

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

  def main_divs
    divs = @page.search('.//tr')
    torrents = []
    divs.each do |div|
      torrent_file = Parser.torrent_url(div)
Severity: Major
Found in lib/manager/sites/piratebay_parser.rb and 3 other locations - About 55 mins to fix
lib/manager/sites/extratorrent_parser.rb on lines 62..74
lib/manager/sites/isohunt_parser.rb on lines 59..71
lib/manager/sites/kickass_parser.rb on lines 72..84

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

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

  def main_divs
    divs = @page.search(".//tr[@class='tlr' or @class='tlz']")
    torrents = []
    divs.each do |div|
      torrent_file = Parser.torrent_url(div)
Severity: Major
Found in lib/manager/sites/extratorrent_parser.rb and 3 other locations - About 55 mins to fix
lib/manager/sites/isohunt_parser.rb on lines 59..71
lib/manager/sites/kickass_parser.rb on lines 72..84
lib/manager/sites/piratebay_parser.rb on lines 64..76

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

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

  def main_divs
    divs = @page.search('.//tr[@data-key]')
    torrents = []
    divs.each do |div|
      torrent_file = Parser.torrent_url(div)
Severity: Major
Found in lib/manager/sites/isohunt_parser.rb and 3 other locations - About 55 mins to fix
lib/manager/sites/extratorrent_parser.rb on lines 62..74
lib/manager/sites/kickass_parser.rb on lines 72..84
lib/manager/sites/piratebay_parser.rb on lines 64..76

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

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

  def search_kickass(search_term)
    white_space = '%20'
    baseurl = KickassParser::Parser::BASEURL
    kickass_url = baseurl + '/usearch/'
    url = kickass_url + search_term.gsub(' ', white_space)
Severity: Minor
Found in lib/manager/mechanize_manager.rb and 3 other locations - About 30 mins to fix
lib/manager/mechanize_manager.rb on lines 45..55
lib/manager/mechanize_manager.rb on lines 63..73
lib/manager/mechanize_manager.rb on lines 81..91

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

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

  def search_isohunt(search_term)
    white_space = '%20'
    baseurl = IsohuntParser::Parser::BASEURL
    isohunt_url = baseurl + '/torrents/?ihq='
    url = isohunt_url + search_term.gsub(' ', white_space)
Severity: Minor
Found in lib/manager/mechanize_manager.rb and 3 other locations - About 30 mins to fix
lib/manager/mechanize_manager.rb on lines 27..37
lib/manager/mechanize_manager.rb on lines 45..55
lib/manager/mechanize_manager.rb on lines 81..91

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

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

  def search_piratebay(search_term)
    white_space = '%20'
    baseurl = PirateBayParser::Parser::BASEURL
    pirate_url = baseurl + '/search/'
    url = pirate_url + search_term.gsub(' ', white_space)
Severity: Minor
Found in lib/manager/mechanize_manager.rb and 3 other locations - About 30 mins to fix
lib/manager/mechanize_manager.rb on lines 27..37
lib/manager/mechanize_manager.rb on lines 63..73
lib/manager/mechanize_manager.rb on lines 81..91

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

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

  def search_extratorrent(search_term)
    white_space = '+'
    baseurl = ExtratorrentParser::Parser::BASEURL
    extratorrent_url = baseurl + '/search/?search='
    url = extratorrent_url + search_term.gsub(' ', white_space)
Severity: Minor
Found in lib/manager/mechanize_manager.rb and 3 other locations - About 30 mins to fix
lib/manager/mechanize_manager.rb on lines 27..37
lib/manager/mechanize_manager.rb on lines 45..55
lib/manager/mechanize_manager.rb on lines 63..73

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

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