catarse/catarse.js

View on GitHub

Showing 810 of 1,380 total issues

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

    jasmine.Ajax.stubRequest(new RegExp("("+apiPrefix + '\/project_posts_details)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(PostEntryMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/post-entry.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/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 + '\/subscriptions)'+'(.*)')).andReturn({
        'responseText' : JSON.stringify(SubscriptionVersionMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/subscription-version.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/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

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

        const processVisitors = (data) => {
            if (!_.isEmpty(data)) {
                visitorsPerDay(data);
                visitorsTotal(_.first(data).total);
            }
Severity: Major
Found in legacy/src/c/project-insights.js and 1 other location - About 1 hr to fix
legacy/src/c/project-insights-sub.js on lines 46..51

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 2 locations. Consider refactoring.
Open

        const rewards = () => _.union(
            [{
                id: null,
                description: '',
                minimum_value: 5,
Severity: Major
Found in legacy/src/root/projects-subscription-contribution.js and 1 other location - About 1 hr to fix
legacy/src/root/projects-contribution.js on lines 22..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 + '\/goals)'+'(.*)')).andReturn({
      'responseText' : JSON.stringify(GoalsMockery())
    });
Severity: Major
Found in legacy/spec/lib/mocks/goals.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/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 2 locations. Consider refactoring.
Open

        recent = filtersVM({
            online_date: 'gte',
            open_for_contributions: 'eq'
        }).open_for_contributions('true').online_date(moment().subtract(5, 'days').format('YYYY-MM-DD')),
Severity: Major
Found in legacy/src/vms/project-filters-vm.js and 1 other location - About 1 hr to fix
legacy/src/vms/project-filters-vm.js on lines 28..31

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 + '\/countries)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(CountriesMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/countries.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/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

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

        const processVisitors = data => {
            if (!_.isEmpty(data)) {
                visitorsPerDay(data);
                visitorsTotal(_.first(data).total);
            }
Severity: Major
Found in legacy/src/c/project-insights-sub.js and 1 other location - About 1 hr to fix
legacy/src/c/project-insights.js on lines 48..53

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 + '\/user_details)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(UserDetailMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/user-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/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

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_posts_details)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(ProjectPostDetailsMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/project-post-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.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 + '\/projects)'+'(.*)')).andReturn({
    'responseText' : JSON.stringify(ProjectMockery())
  });
Severity: Major
Found in legacy/spec/lib/mocks/project.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/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 2 locations. Consider refactoring.
Open

    const projects = catarse.loaderWithToken(
        models.recommendedProjects.getPageOptions(
            catarse
                .filtersVM({ user_id: 'eq' })
                .user_id(user_id)
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 246..253

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

        expiring = filtersVM({
            expires_at: 'lte',
            open_for_contributions: 'eq'
        }).open_for_contributions('true').expires_at(moment().add(14, 'days').format('YYYY-MM-DD')),
Severity: Major
Found in legacy/src/vms/project-filters-vm.js and 1 other location - About 1 hr to fix
legacy/src/vms/project-filters-vm.js on lines 33..36

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

        const rewards = () => _.union(
            [{
                id: null,
                description: 'Obrigado. Eu só quero ajudar o projeto.',
                minimum_value: 10,
Severity: Major
Found in legacy/src/root/projects-contribution.js and 1 other location - About 1 hr to fix
legacy/src/root/projects-subscription-contribution.js on lines 23..32

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

        const project = catarse.loaderWithToken(
            models.project.getPageOptions(
                catarse
                    .filtersVM({ project_id: 'eq' })
                    .project_id(project_id)
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 262..269

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

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

                    rewardVM.updateReward(vnode.attrs.project_id, reward.id(), data).then(() => {
                        vnode.attrs.showSuccess(true);
                        reward.edit.toggle();

                        vnode.attrs.uploadImage(reward, imageFileToUpload, vnode.attrs.project_id, reward.id())
Severity: Major
Found in legacy/src/c/edit-reward-card.js and 1 other location - About 1 hr to fix
legacy/src/c/edit-reward-card.js on lines 141..168

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

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

                                                                    state.error().length > 0 ? m('.text-error', [
                                                                        m('br'),
                                                                        m('span.fa.fa-exclamation-triangle'),
                                                                        ` ${state.error()}`
                                                                    ]) : ''
Severity: Major
Found in legacy/src/root/projects-reward.js and 1 other location - About 1 hr to fix
legacy/src/c/project-reward-card.js on lines 220..224

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

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

                        state.error().length > 0 ? m('.text-error', [
                            m('br'),
                            m('span.fa.fa-exclamation-triangle'),
                            ` ${state.error()}`
                        ]) : ''
Severity: Major
Found in legacy/src/c/project-reward-card.js and 1 other location - About 1 hr to fix
legacy/src/root/projects-reward.js on lines 127..131

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

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('div',
                    m('.w-row', [
                        m('.w-col.w-col-3'),
                        m('.u-text-center.w-col.w-col-6', [
                            m("input.btn.btn-inactive.btn-large.u-marginbottom-20[name='commit'][type='submit'][value='Cancelar campanha']"),
Severity: Major
Found in legacy/src/c/cancel-project-modal-content.js and 1 other location - About 1 hr to fix
legacy/src/c/delete-project-modal-content.js on lines 87..101

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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('div',
                      m('.w-row',
                          [
                              m('.w-col.w-col-3'),
                              m('.u-text-center.w-col.w-col-6',
Severity: Major
Found in legacy/src/c/delete-project-modal-content.js and 1 other location - About 1 hr to fix
legacy/src/c/cancel-project-modal-content.js on lines 55..68

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

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