Fazendaaa/AnilistBot

View on GitHub

Showing 179 of 179 total issues

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

export const handleAnime = async ({ user, filter, translation }: IAnimeContext): Promise<string> => {
    const common = { user, translation };

    if ('ALL' === filter) {
        return translation.t('watchlistOptions', { anime: await fetchAnimeList({ status: null, ...common }) });
Severity: Major
Found in src/lib/telegram/parse/media.ts and 1 other location - About 1 day to fix
src/lib/telegram/parse/media.ts on lines 105..121

Duplicated Code

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

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

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

Tuning

This issue has a mass of 297.

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

export const handleManga = async ({ user, filter, translation }: IMangaContext): Promise<string> => {
    const common = { user, translation };

    if ('ALL' === filter) {
        return translation.t('readlistOptions', { manga: await fetchMangaList({ status: null, ...common }) });
Severity: Major
Found in src/lib/telegram/parse/media.ts and 1 other location - About 1 day to fix
src/lib/telegram/parse/media.ts on lines 87..103

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

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

export const mangaNotifyKeyboard = ({ id, language, translation }: INotifyKeyboard): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t(language, 'buttonDescription'), `ANILIST/MANGA/DESCRIPTION/${id}`),
        Markup.callbackButton(translation.t(language, 'buttonGenres'), `ANILIST/MANGA/GENRES/${id}`),
        Markup.callbackButton(translation.t(language, 'buttonRemove'), `LIST/READ/UNSUBSCRIBE/${id}`)
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 1 other location - About 7 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 65..76

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

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

export const animeNotifyKeyboard = ({ id, language, translation }: INotifyKeyboard): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t(language, 'buttonDescription'), `ANILIST/ANIME/DESCRIPTION/${id}`),
        Markup.callbackButton(translation.t(language, 'buttonGenres'), `ANILIST/ANIME/GENRES/${id}`),
        Markup.callbackButton(translation.t(language, 'buttonRemove'), `LIST/WATCH/UNSUBSCRIBE/${id}`)
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 1 other location - About 7 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 78..89

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

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

export const animeMoreKeyboard = ({ id, translation }: IMoreKeyboard): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('buttonDescription'), `ANILIST/ANIME/DESCRIPTION/${id}`),
        Markup.callbackButton(translation.t('buttonGenres'), `ANILIST/ANIME/GENRES/${id}`),
        Markup.callbackButton(translation.t('buttonRemove'), `LIST/WATCH/UNSUBSCRIBE/${id}`)
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 1 other location - About 7 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 52..63

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

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

export const mangaMoreKeyboard = ({ id, translation }: IMoreKeyboard): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('buttonDescription'), `ANILIST/MANGA/DESCRIPTION/${id}`),
        Markup.callbackButton(translation.t('buttonGenres'), `ANILIST/MANGA/GENRES/${id}`),
        Markup.callbackButton(translation.t('buttonRemove'), `LIST/READ/UNSUBSCRIBE/${id}`)
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 1 other location - About 7 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 39..50

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

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

export const mediaSeason = ({ season, language, translation }: ISeasonContext): string => {
    let kind = translation.t(language, 'winter');

    if (null === season) {
        return '';
Severity: Major
Found in src/lib/telegram/formatting/media.ts and 1 other location - About 6 hrs to fix
src/lib/telegram/formatting/media.ts on lines 185..199

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

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

export const mediaStatus = ({ status, language, translation }: IStatusContext): string => {
    let kind = translation.t(language, 'cancelled');

    if (null === status) {
        return '';
Severity: Major
Found in src/lib/telegram/formatting/media.ts and 1 other location - About 6 hrs to fix
src/lib/telegram/formatting/media.ts on lines 169..183

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

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

export const watchlistKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('airingButton'), 'MEDIA/WATCH/RELEASING'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/WATCH/NOT_YET_RELEASED'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/WATCH/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const soonAnimeKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/WATCH/ALL'),
        Markup.callbackButton(translation.t('airingButton'), 'MEDIA/WATCH/RELEASING'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/WATCH/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const completedMangaKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/READ/ALL'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/READ/NOT_YET_RELEASED'),
        Markup.callbackButton(translation.t('publishingButton'), 'MEDIA/READ/RELEASING'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const cancelledAnimeKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/WATCH/ALL'),
        Markup.callbackButton(translation.t('airingButton'), 'MEDIA/WATCH/RELEASING'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/WATCH/NOT_YET_RELEASED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const publishingMangaKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/READ/ALL'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/READ/NOT_YET_RELEASED'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/READ/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242

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

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

export const soonMangaKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/READ/ALL'),
        Markup.callbackButton(translation.t('publishingButton'), 'MEDIA/READ/RELEASING'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/READ/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const cancelledMangaKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/READ/ALL'),
        Markup.callbackButton(translation.t('publishingButton'), 'MEDIA/READ/RELEASING'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/READ/NOT_YET_RELEASED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const airingAnimeKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/WATCH/ALL'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/WATCH/NOT_YET_RELEASED'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/WATCH/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const readlistKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('publishingButton'), 'MEDIA/READ/RELEASING'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/READ/NOT_YET_RELEASED'),
        Markup.callbackButton(translation.t('completedButton'), 'MEDIA/READ/FINISHED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 210..225
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const completedAnimeKeyboard = (translation: I18n): InlineKeyboardMarkup => {
    const firstLine = [
        Markup.callbackButton(translation.t('allButton'), 'MEDIA/WATCH/ALL'),
        Markup.callbackButton(translation.t('airingButton'), 'MEDIA/WATCH/RELEASING'),
        Markup.callbackButton(translation.t('soonButton'), 'MEDIA/WATCH/NOT_YET_RELEASED'),
Severity: Major
Found in src/lib/telegram/keyboard/list.ts and 9 other locations - About 6 hrs to fix
src/lib/telegram/keyboard/list.ts on lines 91..106
src/lib/telegram/keyboard/list.ts on lines 108..123
src/lib/telegram/keyboard/list.ts on lines 125..140
src/lib/telegram/keyboard/list.ts on lines 142..157
src/lib/telegram/keyboard/list.ts on lines 159..174
src/lib/telegram/keyboard/list.ts on lines 176..191
src/lib/telegram/keyboard/list.ts on lines 193..208
src/lib/telegram/keyboard/list.ts on lines 227..242
src/lib/telegram/keyboard/list.ts on lines 244..259

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

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

export const mediaStatus = ({ status, translation }: IStatusContext): string => {
    let kind = translation.t('cancelled');

    if (null === status) {
        return '';
Severity: Major
Found in src/lib/anilist/formatting/media.ts and 1 other location - About 6 hrs to fix
src/lib/anilist/formatting/media.ts on lines 162..176

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

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

export const mediaSeason = ({ season, translation }: ISeasonContext): string => {
    let kind = translation.t('winter');

    if (null === season) {
        return '';
Severity: Major
Found in src/lib/anilist/formatting/media.ts and 1 other location - About 6 hrs to fix
src/lib/anilist/formatting/media.ts on lines 178..192

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

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