catarse/catarse.js

View on GitHub

Showing 810 of 1,380 total issues

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

    context: function(description, specDefinitions) {
        var suite = jasmine.grammar.getEnv().describe(description, specDefinitions);
        suite.tags = ['context'];
        return suite;
    },
Severity: Major
Found in legacy/spec/lib/jasmine-species/jasmine-grammar.js and 2 other locations - About 1 hr to fix
legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 123..127
legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 154..158

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

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

    topic: function(description, specDefinitions) {
        var suite = jasmine.grammar.getEnv().describe(description, specDefinitions);
        suite.tags = ['topic'];
        return suite;
    },
Severity: Major
Found in legacy/spec/lib/jasmine-species/jasmine-grammar.js and 2 other locations - About 1 hr to fix
legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 123..127
legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 132..136

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

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

                                m('.w-col.w-col-4.u-marginbottom-20', [
                                    m('.text-success.lineheight-loose.fontsize-larger',
                                        h.formatNumber(stats.total_projects_success, 0, 3)
                                    ),
                                    m('.fontsize-smaller', m.trust(window.I18n.t('stats.projects_html', I18nScope())))
Severity: Major
Found in legacy/src/root/press.js and 1 other location - About 1 hr to fix
legacy/src/root/press.js on lines 70..75

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

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 toggleAnonymous = (projectId, contribution) =>
    m.request({
        method: 'GET',
        config: h.setCsrfToken,
        url: `/projects/${projectId}/contributions/${contribution.contribution_id}/toggle_anonymous`,
Severity: Major
Found in legacy/src/vms/user-vm.js and 1 other location - About 1 hr to fix
legacy/src/vms/user-vm.js on lines 107..112

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

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 toggleDelivery = (projectId, contribution) =>
    m.request({
        method: 'GET',
        config: h.setCsrfToken,
        url: `/projects/${projectId}/contributions/${contribution.contribution_id}/toggle_delivery`,
Severity: Major
Found in legacy/src/vms/user-vm.js and 1 other location - About 1 hr to fix
legacy/src/vms/user-vm.js on lines 114..119

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

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

                            !_.isEmpty(state.vm.submissionError()) ? 
                                (
                                    m('.card.card-error.u-radius.zindex-10.u-marginbottom-30.fontsize-smaller',
                                        m('.u-marginbottom-10.fontweight-bold', m.trust(state.vm.submissionError()))) 
                                )
Severity: Major
Found in legacy/src/c/payment-credit-card.js and 1 other location - About 1 hr to fix
legacy/src/c/payment-slip.js on lines 102..102

Duplicated Code

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

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

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

Tuning

This issue has a mass of 57.

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

                                m('.w-col.w-col-4.u-marginbottom-20', [
                                    m('.text-success.lineheight-loose.fontsize-larger',
                                        h.formatNumber(stats.total_contributors, 0, 3)
                                    ),
                                    m('.fontsize-smaller', m.trust(window.I18n.t('stats.people_html', I18nScope())))
Severity: Major
Found in legacy/src/root/press.js and 1 other location - About 1 hr to fix
legacy/src/root/press.js on lines 76..81

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

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/balances)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(BalanceMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/balance.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/recommended_projects)'+'(.*)')).andReturn({
      'responseText' : JSON.stringify(RecommendedProjectsMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/recommended-projects.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/bank_accounts)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(BankAccountMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/bank-accounts.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/statistics)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(StatisticMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/statistic.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp('('+apiPrefix + '\/notifications)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(NotificationMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/notifications.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/project_details)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(ProjectDetailsMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/project-details.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/categories)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(CategoryMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/categories.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/reward_details)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(RewardDetailsMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/reward-details.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/project_contributions_per_location)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(ProjectContributionsPerLocationMockery())
  });
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/balance_transfers)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(BalanceTransferMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/balance-transfers.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/balance_transactions)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(BalanceTransactionMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/balance-transactions.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

            jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/contributors)'+'(.*)')).andReturn({
                'responseText' : JSON.stringify(ContributorMockery())
            });
Severity: Major
Found in legacy/spec/components/project-contributions.spec.js and 19 other locations - About 1 hr to fix
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/team.mock.js on lines 35..37
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/team_totals)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(TeamTotalMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/team.mock.js and 19 other locations - About 1 hr to fix
legacy/spec/components/project-contributions.spec.js on lines 11..13
legacy/spec/lib/mocks/balance-transactions.mock.js on lines 27..29
legacy/spec/lib/mocks/balance-transfers.mock.js on lines 68..70
legacy/spec/lib/mocks/balance.mock.js on lines 13..15
legacy/spec/lib/mocks/bank-accounts.mock.js on lines 23..25
legacy/spec/lib/mocks/categories.mock.js on lines 15..17
legacy/spec/lib/mocks/countries.mock.js on lines 17..19
legacy/spec/lib/mocks/goals.mock.js on lines 20..22
legacy/spec/lib/mocks/notifications.mock.js on lines 16..18
legacy/spec/lib/mocks/post-entry.mock.js on lines 27..29
legacy/spec/lib/mocks/project-contributions-per-location.mock.js on lines 27..29
legacy/spec/lib/mocks/project-details.mock.js on lines 38..40
legacy/spec/lib/mocks/project-post-details.mock.js on lines 18..20
legacy/spec/lib/mocks/project.mock.js on lines 130..132
legacy/spec/lib/mocks/recommended-projects.mock.js on lines 21..23
legacy/spec/lib/mocks/reward-details.mock.js on lines 20..22
legacy/spec/lib/mocks/statistic.mock.js on lines 18..20
legacy/spec/lib/mocks/subscription-version.mock.js on lines 110..112
legacy/spec/lib/mocks/user-details.mock.js on lines 57..59

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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