rl404/go-malscraper

View on GitHub

Showing 369 of 389 total issues

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

func (p *Parser) GetPeopleManga(id int) ([]model.Role, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id), "#contentWrapper")
    if err != nil {
        return nil, code, err
    }
Severity: Minor
Found in internal/parser/people.go and 1 other location - About 40 mins to fix
internal/parser/people.go on lines 29..35

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

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) GetPeopleStaff(id int) ([]model.Role, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id), "#contentWrapper")
    if err != nil {
        return nil, code, err
    }
Severity: Minor
Found in internal/parser/people.go and 1 other location - About 40 mins to fix
internal/parser/people.go on lines 38..44

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

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetUserFavorite(user string) (*model.UserFavorite, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "profile", user), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/user.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30

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

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetPeople(id int) (*model.People, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id), "#contentWrapper")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/people.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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

func (r *review) getSourceType(sourceArea *goquery.Selection) string {
    typ := sourceArea.Find("small").First().Text()
    typ = strings.Replace(typ, "(", "", -1)
    typ = strings.Replace(typ, ")", "", -1)
    return strings.ToLower(typ)
Severity: Major
Found in internal/parser/user/user_review.go and 2 other locations - About 40 mins to fix
internal/parser/review/review_details.go on lines 54..59
internal/parser/review/reviews.go on lines 72..77

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

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetManga(id int) (*model.Manga, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetArticle(id int) (*model.Article, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "featured", id), ".content-left")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/article.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetNews(id int) (*model.News, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "news", id), ".content-left")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/news.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetAnime(id int) (*model.Anime, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 7 other locations - About 40 mins to fix
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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

func (r *reviews) getSourceType(sourceArea *goquery.Selection) string {
    typ := sourceArea.Find("small").First().Text()
    typ = strings.Replace(typ, "(", "", -1)
    typ = strings.Replace(typ, ")", "", -1)
    return strings.ToLower(typ)
Severity: Major
Found in internal/parser/review/reviews.go and 2 other locations - About 40 mins to fix
internal/parser/review/review_details.go on lines 54..59
internal/parser/user/user_review.go on lines 87..92

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

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

func (d *detail) getSourceType(topArea *goquery.Selection) string {
    typeStr := topArea.Find("small").First().Text()
    typeStr = strings.Replace(typeStr, "(", "", -1)
    typeStr = strings.Replace(typeStr, ")", "", -1)
    return strings.ToLower(typeStr)
Severity: Major
Found in internal/parser/review/review_details.go and 2 other locations - About 40 mins to fix
internal/parser/review/reviews.go on lines 72..77
internal/parser/user/user_review.go on lines 87..92

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

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetUserStats(user string) (*model.UserStats, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "profile", user), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/user.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 15..21
internal/parser/user.go on lines 33..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 110.

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

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

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

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

Refactorings

Further Reading

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

func (p *Parser) GetUser(user string) (*model.User, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "profile", user), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/user.go and 7 other locations - About 40 mins to fix
internal/parser/anime.go on lines 11..17
internal/parser/article.go on lines 11..17
internal/parser/manga.go on lines 11..17
internal/parser/news.go on lines 11..17
internal/parser/people.go on lines 11..17
internal/parser/user.go on lines 24..30
internal/parser/user.go on lines 33..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 110.

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 (m *Malscraper) GetUserAnimeAdv(query model.UserListQuery) ([]model.UserAnime, int, error) {
    if query.Page == 0 {
        query.Page = 1
    }
    return m.api.GetUserAnime(query)
Severity: Minor
Found in api_user.go and 1 other location - About 40 mins to fix
api_search.go on lines 75..80

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

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 (m *Malscraper) AdvSearchManga(query model.Query) ([]model.MangaSearch, int, error) {
    if query.Page == 0 {
        query.Page = 1
    }
    return m.api.SearchManga(query)
Severity: Minor
Found in api_search.go and 1 other location - About 40 mins to fix
api_user.go on lines 116..121

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

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 (p *Parser) GetMangaPicture(id int) ([]string, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "manga", id, "a", "pics"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/manga.go and 3 other locations - About 40 mins to fix
internal/parser/anime.go on lines 113..119
internal/parser/character.go on lines 51..57
internal/parser/people.go on lines 65..71

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

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 (p *Parser) GetAnimePicture(id int) ([]string, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "anime", id, "a", "pics"), ".js-scrollfix-bottom-rel")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/anime.go and 3 other locations - About 40 mins to fix
internal/parser/character.go on lines 51..57
internal/parser/manga.go on lines 84..90
internal/parser/people.go on lines 65..71

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

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 (m *Malscraper) GetUserMangaAdv(query model.UserListQuery) ([]model.UserManga, int, error) {
    if query.Page == 0 {
        query.Page = 1
    }
    return m.api.GetUserManga(query)
Severity: Minor
Found in api_user.go and 1 other location - About 40 mins to fix
api_search.go on lines 37..42

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

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 (p *Parser) GetCharacterPicture(id int) ([]string, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "character", id, "a", "pictures"), "#content")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/character.go and 3 other locations - About 40 mins to fix
internal/parser/anime.go on lines 113..119
internal/parser/manga.go on lines 84..90
internal/parser/people.go on lines 65..71

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

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 (p *Parser) GetPeoplePicture(id int) ([]string, int, error) {
    doc, code, err := p.getDoc(utils.BuildURL(malURL, "people", id, "a", "pictures"), "#content table tr td")
    if err != nil {
        return nil, code, err
    }
Severity: Major
Found in internal/parser/people.go and 3 other locations - About 40 mins to fix
internal/parser/anime.go on lines 113..119
internal/parser/character.go on lines 51..57
internal/parser/manga.go on lines 84..90

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

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