rl404/go-malscraper

View on GitHub

Showing 389 of 389 total issues

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

func (v *Validator) GetMangaWithGenre(id int, page int) ([]model.MangaItem, int, error) {
    if page <= 0 {
        return nil, http.StatusBadRequest, errors.ErrInvalidPage
    }
    if !v.isMangaGenreValid(id) {
Severity: Major
Found in internal/validator/genre.go and 3 other locations - About 50 mins to fix
internal/validator/article.go on lines 33..41
internal/validator/genre.go on lines 19..27
internal/validator/news.go on lines 33..41

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

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

    e.area.Find("table.episode_list").First().Find(".episode-list-data").Each(func(i int, eachEp *goquery.Selection) {
        epList = append(epList, model.Episode{
            Episode:       e.getEpisode(eachEp),
            Link:          e.getLink(eachEp),
            Title:         e.getTitle(eachEp),
Severity: Minor
Found in internal/parser/anime/anime_episode.go and 1 other location - About 50 mins to fix
internal/parser/search/search_club.go on lines 26..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 121.

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

    c.area.Find("tr.table-data").Each(func(i int, eachClub *goquery.Selection) {
        clubs = append(clubs, model.ClubSearch{
            ID:      c.getID(eachClub),
            Name:    c.getName(eachClub),
            Image:   c.getImage(eachClub),
Severity: Minor
Found in internal/parser/search/search_club.go and 1 other location - About 50 mins to fix
internal/parser/anime/anime_episode.go on lines 27..36

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

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 (v *Validator) SearchPeople(name string, page int) ([]model.PeopleSearch, int, error) {
    if len(name) < 3 {
        return nil, http.StatusBadRequest, errors.Err3LettersSearch
    }
    if page <= 0 {
Severity: Minor
Found in internal/validator/search.go and 1 other location - About 50 mins to fix
internal/validator/search.go on lines 83..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 119.

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 (v *Validator) SearchCharacter(name string, page int) ([]model.CharacterSearch, int, error) {
    if len(name) < 3 {
        return nil, http.StatusBadRequest, errors.Err3LettersSearch
    }
    if page <= 0 {
Severity: Minor
Found in internal/validator/search.go and 1 other location - About 50 mins to fix
internal/validator/search.go on lines 94..102

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

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 (r *review) getProgress(topArea *goquery.Selection) string {
    progress := topArea.Find("div").First().Find("div:nth-of-type(2)").Text()
    progress = strings.Replace(progress, "episodes seen", "", -1)
    progress = strings.Replace(progress, "chapters read", "", -1)
    return strings.TrimSpace(progress)
Severity: Major
Found in internal/parser/manga/manga_review.go and 3 other locations - About 50 mins to fix
internal/parser/anime/anime_review.go on lines 99..104
internal/parser/review/reviews.go on lines 109..114
internal/parser/user/user_review.go on lines 115..120

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

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 (r *review) getProgress(topArea *goquery.Selection) string {
    progress := topArea.Find("div").First().Find("div:nth-of-type(2)").Text()
    progress = strings.Replace(progress, "episodes seen", "", -1)
    progress = strings.Replace(progress, "chapters read", "", -1)
    return strings.TrimSpace(progress)
Severity: Major
Found in internal/parser/anime/anime_review.go and 3 other locations - About 50 mins to fix
internal/parser/manga/manga_review.go on lines 100..105
internal/parser/review/reviews.go on lines 109..114
internal/parser/user/user_review.go on lines 115..120

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

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 (r *reviews) getProgress(topArea *goquery.Selection) string {
    area := topArea.Find("div").First().Find("div:nth-of-type(2)").Text()
    value := strings.Replace(area, "episodes seen", "", -1)
    value = strings.Replace(value, "chapters read", "", -1)
    return strings.TrimSpace(value)
Severity: Major
Found in internal/parser/review/reviews.go and 3 other locations - About 50 mins to fix
internal/parser/anime/anime_review.go on lines 99..104
internal/parser/manga/manga_review.go on lines 100..105
internal/parser/user/user_review.go on lines 115..120

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

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 (r *review) getProgress(topArea *goquery.Selection) string {
    area := topArea.Find("div").First().Find("div:nth-of-type(2)").Text()
    value := strings.Replace(area, "episodes seen", "", -1)
    value = strings.Replace(value, "chapters read", "", -1)
    return strings.TrimSpace(value)
Severity: Major
Found in internal/parser/user/user_review.go and 3 other locations - About 50 mins to fix
internal/parser/anime/anime_review.go on lines 99..104
internal/parser/manga/manga_review.go on lines 100..105
internal/parser/review/reviews.go on lines 109..114

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

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) GetUserManga(username string, page ...int) ([]model.UserManga, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Minor
Found in api_user.go and 1 other location - About 50 mins to fix
api_user.go on lines 88..94

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

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) GetUserAnime(username string, page ...int) ([]model.UserAnime, int, error) {
    p := 1
    if len(page) > 0 {
        p = page[0]
    }
Severity: Minor
Found in api_user.go and 1 other location - About 50 mins to fix
api_user.go on lines 126..132

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

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 (r *recommendations) getSource(eachRecom *goquery.Selection) model.Source {
    area := eachRecom.Find("table tr td:nth-of-type(1)")
    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 51..59

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

Avoid deeply nested control flow statements.
Open

    if match, _ := regexp.MatchString(`Today, ([0-9]{1,2}):([0-9]{2}) (AM|PM)`, str); match {
        today := now.Format("Jan 2, 2006")
        str = strings.Replace(str, "Today,", today, -1)
        return StrToTime(str)
    } else
Severity: Major
Found in pkg/utils/time.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

        if match, _ := regexp.MatchString(`([a-z]+) ([0-9]{1,2})$`, str); match {
            return 0, months[spltStr[0]], StrToNum(spltStr[1])
        } else
    
        // 2021
    Severity: Major
    Found in pkg/utils/time.go - About 45 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language