rl404/go-malscraper

View on GitHub

Showing 369 of 389 total issues

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

package manga

import (
    "strings"

Severity: Major
Found in internal/parser/manga/manga_recommendation.go and 1 other location - About 2 days to fix
internal/parser/anime/anime_recommendation.go on lines 1..111

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

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

package anime

import (
    "strings"

Severity: Major
Found in internal/parser/anime/anime_recommendation.go and 1 other location - About 2 days to fix
internal/parser/manga/manga_recommendation.go on lines 1..111

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

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

package top

import (
    "strings"

Severity: Major
Found in internal/parser/top/top_anime.go and 1 other location - About 2 days to fix
internal/parser/top/top_manga.go on lines 1..88

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

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

package top

import (
    "strings"

Severity: Major
Found in internal/parser/top/top_manga.go and 1 other location - About 2 days to fix
internal/parser/top/top_anime.go on lines 1..88

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

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

package manga

import (
    "strings"
    "time"
Severity: Major
Found in internal/parser/manga/manga_news.go and 1 other location - About 2 days to fix
internal/parser/anime/anime_news.go on lines 1..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 1122.

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

package anime

import (
    "strings"
    "time"
Severity: Major
Found in internal/parser/anime/anime_news.go and 1 other location - About 2 days to fix
internal/parser/manga/manga_news.go on lines 1..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 1122.

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

package people

import (
    "strings"

Severity: Major
Found in internal/parser/people/people_article.go and 1 other location - About 2 days to fix
internal/parser/manga/manga_article.go on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1042.

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

package manga

import (
    "strings"

Severity: Major
Found in internal/parser/manga/manga_article.go and 1 other location - About 2 days to fix
internal/parser/people/people_article.go on lines 1..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1042.

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

package producermagazine

import (
    "regexp"
    "strings"
Severity: Major
Found in internal/parser/producer_magazine/producers.go and 1 other location - About 7 hrs to fix
internal/parser/producer_magazine/magazines.go on lines 1..51

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

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

package producermagazine

import (
    "regexp"
    "strings"
Severity: Major
Found in internal/parser/producer_magazine/magazines.go and 1 other location - About 7 hrs to fix
internal/parser/producer_magazine/producers.go on lines 1..51

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

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

package anime

import (
    "strings"

Severity: Major
Found in internal/parser/anime/anime_club.go and 1 other location - About 7 hrs to fix
internal/parser/manga/manga_club.go on lines 1..47

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

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

package manga

import (
    "strings"

Severity: Major
Found in internal/parser/manga/manga_club.go and 1 other location - About 7 hrs to fix
internal/parser/anime/anime_club.go on lines 1..47

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

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) GetUserManga(query model.UserListQuery) ([]model.UserManga, int, error) {
    data := []model.UserManga{}

    q := map[string]interface{}{
        "status": query.Status,
Severity: Major
Found in internal/parser/user.go and 1 other location - About 5 hrs to fix
internal/parser/user.go on lines 98..144

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

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) GetUserAnime(query model.UserListQuery) ([]model.UserAnime, int, error) {
    data := []model.UserAnime{}

    q := map[string]interface{}{
        "status": query.Status,
Severity: Major
Found in internal/parser/user.go and 1 other location - About 5 hrs to fix
internal/parser/user.go on lines 147..193

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

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 (s *stats) setSummary() {
    area := s.area.Find("h2").First().Next()
    for goquery.NodeName(area) == "div" {

        summaryType := area.Find("span").Text()
Severity: Major
Found in internal/parser/anime/anime_stats.go and 1 other location - About 4 hrs to fix
internal/parser/manga/manga_stats.go on lines 24..52

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

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 (s *stats) setSummary() {
    area := s.area.Find("h2").First().Next()
    for goquery.NodeName(area) == "div" {

        summaryType := area.Find("span").Text()
Severity: Major
Found in internal/parser/manga/manga_stats.go and 1 other location - About 4 hrs to fix
internal/parser/anime/anime_stats.go on lines 24..52

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

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

func (_m *API) GetArticles(page int, tag string) ([]model.ArticleItem, int, error) {
    ret := _m.Called(page, tag)

    var r0 []model.ArticleItem
    if rf, ok := ret.Get(0).(func(int, string) []model.ArticleItem); ok {
Severity: Major
Found in service/mocks/API.go and 21 other locations - About 4 hrs to fix
service/mocks/API.go on lines 136..163
service/mocks/API.go on lines 284..311
service/mocks/API.go on lines 404..431
service/mocks/API.go on lines 614..641
service/mocks/API.go on lines 734..761
service/mocks/API.go on lines 884..911
service/mocks/API.go on lines 1182..1209
service/mocks/API.go on lines 1242..1269
service/mocks/API.go on lines 1302..1329
service/mocks/API.go on lines 1572..1599
service/mocks/API.go on lines 1662..1689
service/mocks/API.go on lines 1722..1749
service/mocks/API.go on lines 1752..1779
service/mocks/API.go on lines 1782..1809
service/mocks/API.go on lines 1842..1869
service/mocks/API.go on lines 2022..2049
service/mocks/API.go on lines 2052..2079
service/mocks/API.go on lines 2112..2139
service/mocks/API.go on lines 2142..2169
service/mocks/API.go on lines 2232..2259
service/mocks/API.go on lines 2322..2349

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

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

func (_m *API) GetRecommendations(_type string, page int) ([]model.Recommendation, int, error) {
    ret := _m.Called(_type, page)

    var r0 []model.Recommendation
    if rf, ok := ret.Get(0).(func(string, int) []model.Recommendation); ok {
Severity: Major
Found in service/mocks/API.go and 21 other locations - About 4 hrs to fix
service/mocks/API.go on lines 136..163
service/mocks/API.go on lines 284..311
service/mocks/API.go on lines 404..431
service/mocks/API.go on lines 494..521
service/mocks/API.go on lines 614..641
service/mocks/API.go on lines 734..761
service/mocks/API.go on lines 884..911
service/mocks/API.go on lines 1182..1209
service/mocks/API.go on lines 1242..1269
service/mocks/API.go on lines 1302..1329
service/mocks/API.go on lines 1572..1599
service/mocks/API.go on lines 1722..1749
service/mocks/API.go on lines 1752..1779
service/mocks/API.go on lines 1782..1809
service/mocks/API.go on lines 1842..1869
service/mocks/API.go on lines 2022..2049
service/mocks/API.go on lines 2052..2079
service/mocks/API.go on lines 2112..2139
service/mocks/API.go on lines 2142..2169
service/mocks/API.go on lines 2232..2259
service/mocks/API.go on lines 2322..2349

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

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

func (_m *API) GetUserRecommendation(username string, page int) ([]model.Recommendation, int, error) {
    ret := _m.Called(username, page)

    var r0 []model.Recommendation
    if rf, ok := ret.Get(0).(func(string, int) []model.Recommendation); ok {
Severity: Major
Found in service/mocks/API.go and 21 other locations - About 4 hrs to fix
service/mocks/API.go on lines 136..163
service/mocks/API.go on lines 284..311
service/mocks/API.go on lines 404..431
service/mocks/API.go on lines 494..521
service/mocks/API.go on lines 614..641
service/mocks/API.go on lines 734..761
service/mocks/API.go on lines 884..911
service/mocks/API.go on lines 1182..1209
service/mocks/API.go on lines 1242..1269
service/mocks/API.go on lines 1302..1329
service/mocks/API.go on lines 1572..1599
service/mocks/API.go on lines 1662..1689
service/mocks/API.go on lines 1722..1749
service/mocks/API.go on lines 1752..1779
service/mocks/API.go on lines 1782..1809
service/mocks/API.go on lines 1842..1869
service/mocks/API.go on lines 2022..2049
service/mocks/API.go on lines 2052..2079
service/mocks/API.go on lines 2142..2169
service/mocks/API.go on lines 2232..2259
service/mocks/API.go on lines 2322..2349

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

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

func (_m *API) SearchCharacter(query string, page int) ([]model.CharacterSearch, int, error) {
    ret := _m.Called(query, page)

    var r0 []model.CharacterSearch
    if rf, ok := ret.Get(0).(func(string, int) []model.CharacterSearch); ok {
Severity: Major
Found in service/mocks/API.go and 21 other locations - About 4 hrs to fix
service/mocks/API.go on lines 136..163
service/mocks/API.go on lines 284..311
service/mocks/API.go on lines 404..431
service/mocks/API.go on lines 494..521
service/mocks/API.go on lines 614..641
service/mocks/API.go on lines 734..761
service/mocks/API.go on lines 884..911
service/mocks/API.go on lines 1182..1209
service/mocks/API.go on lines 1242..1269
service/mocks/API.go on lines 1302..1329
service/mocks/API.go on lines 1572..1599
service/mocks/API.go on lines 1662..1689
service/mocks/API.go on lines 1722..1749
service/mocks/API.go on lines 1752..1779
service/mocks/API.go on lines 1782..1809
service/mocks/API.go on lines 1842..1869
service/mocks/API.go on lines 2022..2049
service/mocks/API.go on lines 2052..2079
service/mocks/API.go on lines 2112..2139
service/mocks/API.go on lines 2142..2169
service/mocks/API.go on lines 2322..2349

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

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