rl404/go-malscraper

View on GitHub

Showing 389 of 389 total issues

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

func (c cacherLog) Set(key string, data interface{}) error {
    c.logger.Trace("[%s] saving cache...", key)
    t := time.Now()
    if err := c.cacher.Set(key, data); err != nil {
        c.logger.Error("[%s] failed saving cache: %s", key, err.Error())
Severity: Major
Found in internal/cacher/cacher.go and 1 other location - About 1 hr to fix
internal/cacher/cacher.go on lines 45..54

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

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 (c cacherLog) Get(key string, data interface{}) error {
    c.logger.Trace("[%s] retrieving cache...", key)
    t := time.Now()
    if err := c.cacher.Get(key, data); err != nil {
        c.logger.Warn("[%s] failed retrieving cache: %s", key, err.Error())
Severity: Major
Found in internal/cacher/cacher.go and 1 other location - About 1 hr to fix
internal/cacher/cacher.go on lines 57..66

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

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 (c *Cacher) GetArticleTag() (data []model.ArticleTagItem, code int, err error) {
    // Get from cache.
    key := internal.GetKey(internal.KeyArticleTag)
    if c.cacher.Get(key, &data) == nil {
        return data, http.StatusOK, nil
Severity: Major
Found in internal/cacher/article.go and 2 other locations - About 1 hr to fix
internal/cacher/producer_magazine.go on lines 11..27
internal/cacher/producer_magazine.go on lines 49..65

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

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 (c *Cacher) GetMagazines() (data []model.ItemCount, code int, err error) {
    // Get from cache.
    key := internal.GetKey(internal.KeyMagazines)
    if c.cacher.Get(key, &data) == nil {
        return data, http.StatusOK, nil
Severity: Major
Found in internal/cacher/producer_magazine.go and 2 other locations - About 1 hr to fix
internal/cacher/article.go on lines 49..65
internal/cacher/producer_magazine.go on lines 11..27

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

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 (c *Cacher) GetProducers() (data []model.ItemCount, code int, err error) {
    // Get from cache.
    key := internal.GetKey(internal.KeyProducers)
    if c.cacher.Get(key, &data) == nil {
        return data, http.StatusOK, nil
Severity: Major
Found in internal/cacher/producer_magazine.go and 2 other locations - About 1 hr to fix
internal/cacher/article.go on lines 49..65
internal/cacher/producer_magazine.go on lines 49..65

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

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

Function StrToDate has 61 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func StrToDate(str string) (y, m, d int) {
    str = strings.TrimSpace(str)
    if str == "" {
        return 0, 0, 0
    }
Severity: Minor
Found in pkg/utils/time.go - About 1 hr to fix

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

    func (m *magazine) getAuthor(area *goquery.Selection) []model.Item {
        authors := []model.Item{}
        area.Find("span.producer").Find("a").Each(func(i int, each *goquery.Selection) {
            authors = append(authors, model.Item{
                ID:   m.getAuthorID(each),
    Severity: Major
    Found in internal/parser/producer_magazine/magazine.go and 1 other location - About 1 hr to fix
    internal/parser/producer_magazine/producer.go on lines 92..101

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

    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 *producer) getProducer(area *goquery.Selection) []model.Item {
        producers := []model.Item{}
        area.Find("span.producer").Find("a").Each(func(i int, each *goquery.Selection) {
            producers = append(producers, model.Item{
                ID:   p.getProducerID(each),
    Severity: Major
    Found in internal/parser/producer_magazine/producer.go and 1 other location - About 1 hr to fix
    internal/parser/producer_magazine/magazine.go on lines 88..97

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

    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) GetTopManga(t int, page int) ([]model.TopManga, int, error) {
        q := map[string]interface{}{"type": topMangaTypes[t], "limit": 50 * (page - 1)}
        doc, code, err := p.getDoc(utils.BuildURLWithQuery(q, malURL, "topmanga.php"), "#content")
        if err != nil {
            return nil, code, err
    Severity: Major
    Found in internal/parser/top.go and 1 other location - About 1 hr to fix
    internal/parser/top.go on lines 14..21

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

    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) GetTopAnime(t int, page int) ([]model.TopAnime, int, error) {
        q := map[string]interface{}{"type": topAnimeTypes[t], "limit": 50 * (page - 1)}
        doc, code, err := p.getDoc(utils.BuildURLWithQuery(q, malURL, "topanime.php"), "#content")
        if err != nil {
            return nil, code, err
    Severity: Major
    Found in internal/parser/top.go and 1 other location - About 1 hr to fix
    internal/parser/top.go on lines 24..31

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

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

    func (v *Validator) GetPeopleCharacter(id int) ([]model.PeopleCharacter, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/people.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetMangaRecommendation(id int) ([]model.Recommendation, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/manga.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetCharacterArticle(id int) ([]model.ArticleItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/character.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetPeopleArticle(id int) ([]model.ArticleItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/people.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..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 152.

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

    func (v *Validator) GetAnimeNews(id int) ([]model.NewsItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/anime.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetMangaNews(id int) ([]model.NewsItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/manga.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetCharacterClub(id int) ([]model.ClubItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/character.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetAnimeCharacter(id int) ([]model.CharacterItem, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/anime.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 99..117
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

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

    func (v *Validator) GetReview(id int) (*model.Review, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/review.go and 10 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 12..30
    internal/validator/anime.go on lines 123..141
    internal/validator/article.go on lines 12..30
    internal/validator/character.go on lines 12..30
    internal/validator/club.go on lines 20..38
    internal/validator/club.go on lines 86..104
    internal/validator/manga.go on lines 12..30
    internal/validator/manga.go on lines 78..96
    internal/validator/news.go on lines 12..30
    internal/validator/people.go on lines 12..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 152.

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

    func (v *Validator) GetMangaCharacter(id int) ([]model.Role, int, error) {
        if id <= 0 {
            return nil, http.StatusBadRequest, errors.ErrInvalidID
        }
    
    
    Severity: Major
    Found in internal/validator/manga.go and 18 other locations - About 1 hr to fix
    internal/validator/anime.go on lines 33..51
    internal/validator/anime.go on lines 54..72
    internal/validator/anime.go on lines 168..186
    internal/validator/anime.go on lines 189..207
    internal/validator/anime.go on lines 210..228
    internal/validator/anime.go on lines 231..249
    internal/validator/character.go on lines 33..51
    internal/validator/character.go on lines 99..117
    internal/validator/character.go on lines 120..138
    internal/validator/manga.go on lines 57..75
    internal/validator/manga.go on lines 120..138
    internal/validator/manga.go on lines 141..159
    internal/validator/manga.go on lines 162..180
    internal/validator/people.go on lines 33..51
    internal/validator/people.go on lines 54..72
    internal/validator/people.go on lines 75..93
    internal/validator/people.go on lines 96..114
    internal/validator/people.go on lines 117..135

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

    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