rl404/go-malscraper

View on GitHub

Showing 369 of 389 total issues

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

func (r *recommendations) getRecommended(eachRecom *goquery.Selection) model.Source {
    area := eachRecom.Find("table tr td:nth-of-type(2)")
    return model.Source{
        ID:    r.getSourceID(area),
        Title: r.getSourceTitle(area),
Severity: Minor
Found in internal/parser/recommendation/recommendations.go and 1 other location - About 45 mins to fix
internal/parser/recommendation/recommendations.go on lines 41..49

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

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

func (m *Malscraper) SearchClub(name string, page ...int) ([]model.ClubSearch, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Major
Found in api_search.go and 3 other locations - About 45 mins to fix
api_search.go on lines 10..16
api_search.go on lines 47..53
api_search.go on lines 146..152

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

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

func (m *Malscraper) SearchUser(username string, page ...int) ([]model.UserSearch, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Major
Found in api_search.go and 3 other locations - About 45 mins to fix
api_search.go on lines 10..16
api_search.go on lines 47..53
api_search.go on lines 107..113

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

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

func (m *Malscraper) SearchAnime(title string, page ...int) ([]model.AnimeSearch, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Major
Found in api_search.go and 3 other locations - About 45 mins to fix
api_search.go on lines 47..53
api_search.go on lines 107..113
api_search.go on lines 146..152

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

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

func (m *Malscraper) SearchManga(title string, page ...int) ([]model.MangaSearch, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Major
Found in api_search.go and 3 other locations - About 45 mins to fix
api_search.go on lines 10..16
api_search.go on lines 107..113
api_search.go on lines 146..152

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

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

func (p *Parser) GetMangaCharacter(id int) ([]model.Role, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "characters"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetMangaRecommendation(id int) ([]model.Recommendation, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "userrecs"), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetMangaClub(id int) ([]model.ClubItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "clubs"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeNews(id int) ([]model.NewsItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "news"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeRecommendation(id int) ([]model.Recommendation, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "userrecs"), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeStaff(id int) ([]model.Role, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "characters"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetPeopleNews(id int) ([]model.NewsItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id, "a", "news"), "#content table tr td")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/people.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeArticle(id int) ([]model.ArticleItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "featured"), ".news-list")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetMangaNews(id int) ([]model.NewsItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "news"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetMangaArticle(id int) ([]model.ArticleItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "featured"), ".news-list")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeCharacter(id int) ([]model.CharacterItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "characters"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetPeopleArticle(id int) ([]model.ArticleItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id, "a", "featured"), ".news-list")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/people.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/anime.go on lines 104..110
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53

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

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

func (p *Parser) GetAnimeClub(id int) ([]model.ClubItem, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "clubs"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 12 other locations - About 40 mins to fix
internal/parser/anime.go on lines 20..26
internal/parser/anime.go on lines 29..35
internal/parser/anime.go on lines 77..83
internal/parser/anime.go on lines 86..92
internal/parser/anime.go on lines 95..101
internal/parser/manga.go on lines 30..36
internal/parser/manga.go on lines 48..54
internal/parser/manga.go on lines 57..63
internal/parser/manga.go on lines 66..72
internal/parser/manga.go on lines 75..81
internal/parser/people.go on lines 47..53
internal/parser/people.go on lines 56..62

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

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

func (p *Parser) GetAnimeStats(id int) (*model.Stats, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "stats"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Minor
Found in internal/parser/anime.go and 1 other location - About 40 mins to fix
internal/parser/manga.go on lines 39..45

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

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

func (p *Parser) GetMangaStats(id int) (*model.Stats, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "stats"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Minor
Found in internal/parser/manga.go and 1 other location - About 40 mins to fix
internal/parser/anime.go on lines 58..64

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

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