catarse/catarse.js

View on GitHub

Showing 810 of 1,380 total issues

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

        const newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + queryString + (window.location.hash === '#' ? '' : window.location.hash);
Severity: Major
Found in legacy/src/h.ts and 5 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 108..108
legacy/src/h.ts on lines 122..122
legacy/src/h.ts on lines 138..138
legacy/src/h.ts on lines 170..170
legacy/src/h.ts on lines 187..187

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

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

        const newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + queryString + (window.location.hash === '#' ? '' : window.location.hash);
Severity: Major
Found in legacy/src/h.ts and 5 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 108..108
legacy/src/h.ts on lines 122..122
legacy/src/h.ts on lines 154..154
legacy/src/h.ts on lines 170..170
legacy/src/h.ts on lines 187..187

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

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

        const newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + queryString + (window.location.hash === '#' ? '' : window.location.hash);
Severity: Major
Found in legacy/src/h.ts and 5 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 108..108
legacy/src/h.ts on lines 122..122
legacy/src/h.ts on lines 138..138
legacy/src/h.ts on lines 154..154
legacy/src/h.ts on lines 170..170

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

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

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

                    onsubmit(event : Event) {
                        event.preventDefault()
                        const url = `/${window.I18n.locale}/explore?ref=ctrse_header&utf8=✓&filter=all&pg_search=${searchParam()}`
                        m.route.set(url)
                        searchParam('')
Severity: Major
Found in legacy/src/c/header-menu-search.ts and 1 other location - About 2 hrs to fix
legacy/src/c/explore/explore-mobile-search.tsx on lines 35..41

Duplicated Code

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

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

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

Tuning

This issue has a mass of 77.

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

        const newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + queryString + (window.location.hash === '#' ? '' : window.location.hash);
Severity: Major
Found in legacy/src/h.ts and 5 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 108..108
legacy/src/h.ts on lines 138..138
legacy/src/h.ts on lines 154..154
legacy/src/h.ts on lines 170..170
legacy/src/h.ts on lines 187..187

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

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

    getRdToken = () => {
        if (_dataCache.rdToken) {
            return _dataCache.rdToken;
        }

Severity: Major
Found in legacy/src/h.ts and 2 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 477..484
legacy/src/h.ts on lines 985..993

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

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

    getNewsletterUrl = () => {
        if (_dataCache.newsletterUrl) {
            return _dataCache.newsletterUrl;
        }

Severity: Major
Found in legacy/src/h.ts and 2 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 469..476
legacy/src/h.ts on lines 985..993

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

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

    rootUrl = () => {
        if (_dataCache.rootUrl) {
            return _dataCache.rootUrl;
        }

Severity: Major
Found in legacy/src/h.ts and 2 other locations - About 2 hrs to fix
legacy/src/h.ts on lines 469..476
legacy/src/h.ts on lines 477..484

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

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

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

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

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

Refactorings

Further Reading

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

                case '#welcome_message':
                    return m(projectEditTab, {
                        title: window.I18n.t('welcome', I18nScope()),
                        subtitle: window.I18n.t('welcome_subtitle', I18nScope()),
                        content: m(projectEditWelcomeMessage, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 113..118

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

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

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

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

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

Refactorings

Further Reading

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

                case '#announce_expiration':
                    return m(projectEditTab, {
                        title: window.I18n.t('announce_expiration', I18nScope()),
                        subtitle: window.I18n.t('announce_expiration_subtitle', I18nScope()),
                        content: m(projectAnnounceExpiration, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..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 75.

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

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

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

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

Refactorings

Further Reading

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

                case '#budget':
                    return m(projectEditTab, {
                        title: window.I18n.t('budget', I18nScope()),
                        subtitle: window.I18n.t('budget_subtitle', I18nScope()),
                        content: m(projectEditBudget, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

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

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

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

Refactorings

Further Reading

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

                case '#user_about':
                    return m(projectEditTab, {
                        title: window.I18n.t('user_about', I18nScope()),
                        subtitle: window.I18n.t('user_about_subtitle', I18nScope()),
                        content: m(projectEditUserAbout, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

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

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

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

Refactorings

Further Reading

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

                case '#description':
                    return m(projectEditTab, {
                        title: window.I18n.t('description', I18nScope()),
                        subtitle: window.I18n.t('description_subtitle', I18nScope()),
                        content: m(projectEditDescription, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

const sendSubscriptionUpgrade = data => commonSubscriptionUpgrade.postWithToken(
    { data },
    null,
    (h.isDevEnv() ? { 'X-forwarded-For': '127.0.0.1' } : {})
)
Severity: Major
Found in legacy/src/vms/common-payment-vm.js and 1 other location - About 2 hrs to fix
legacy/src/vms/common-payment-vm.js on lines 78..83

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

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

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

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

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

Refactorings

Further Reading

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

                case '#reward':
                    return m(projectEditTab, {
                        title: window.I18n.t('reward_html', I18nScope()),
                        subtitle: window.I18n.t('reward_subtitle', I18nScope()),
                        content: m(projectEditReward, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

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

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

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

Refactorings

Further Reading

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

                case '#integrations':
                    return m(projectEditTab, {
                        title: window.I18n.t('integrations_html', I18nScope()),
                        subtitle: window.I18n.t('integrations_subtitle', I18nScope()),
                        content: m(ProjectEditIntegrations, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 78..83
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

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

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

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

Refactorings

Further Reading

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

                case '#user_settings':
                    return m(projectEditTab, {
                        title: window.I18n.t('user_settings', I18nScope()),
                        subtitle: window.I18n.t('user_settings_subtitle', I18nScope()),
                        content: m(projectEditUserSettings, _.extend({}, c_opts))
Severity: Major
Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
legacy/src/root/project-edit.js on lines 50..55
legacy/src/root/project-edit.js on lines 57..62
legacy/src/root/project-edit.js on lines 64..69
legacy/src/root/project-edit.js on lines 71..76
legacy/src/root/project-edit.js on lines 85..90
legacy/src/root/project-edit.js on lines 92..97
legacy/src/root/project-edit.js on lines 113..118

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

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

const paymentInfo = paymentId => commonPaymentInfo
    .postWithToken({ id: paymentId }, null, (h.isDevEnv() ? { 'X-forwarded-For': '127.0.0.1' } : {}))
    .catch((error) => {
        h.captureException(error);
        throw error;
Severity: Major
Found in legacy/src/vms/common-payment-vm.js and 1 other location - About 2 hrs to fix
legacy/src/vms/common-payment-vm.js on lines 22..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 75.

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

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

                                        m('.card.card-terciary.u-radius.u-marginbottom-40',
                                            m(addressForm, {
                                                addVM: state.vm.fields.address(),
                                                addressFields: state.vm.fields.address().fields,
                                                international: state.vm.isInternational,
Severity: Major
Found in legacy/src/root/projects-payment.js and 1 other location - About 1 hr to fix
legacy/src/root/projects-subscription-checkout.js on lines 337..344

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

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

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

                                m('.card.card-terciary.u-radius.u-marginbottom-40',
                                    m(addressForm, {
                                        addVM: state.vm.fields.address(),
                                        addressFields: state.vm.fields.address().fields,
                                        international: state.vm.isInternational,
Severity: Major
Found in legacy/src/root/projects-subscription-checkout.js and 1 other location - About 1 hr to fix
legacy/src/root/projects-payment.js on lines 337..344

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

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