catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Function oninit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    oninit: function (vnode) {
        const
            firstValue = prop(0),
            secondValue = prop(0),
            clearFieldValues = () => { firstValue(0), secondValue(0) },
Severity: Minor
Found in legacy/src/c/filter-dropdown-number-range.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    view: function({state, attrs}) {
        let user = attrs.user,
            fields = state.fields,
            bankAccount = state.bankAccount();

Severity: Minor
Found in legacy/src/c/user-billing.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    view: function({state, attrs}) {
        const data = attrs.data,
            item = attrs.item(),
            btnValue = (state.setLoader() || state.getLoader()) ? 'por favor, aguarde...' : data.callToAction;

Severity: Minor
Found in legacy/src/c/admin-radio-action.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function trialsToGetPaymentInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const trialsToGetPaymentInfo = (p, catalog_payment_id, retries) => {
    if (retries > 0) {
        paymentInfo(catalog_payment_id).then((infoR) => {
            if (_.isNull(infoR.gateway_payment_method) || _.isUndefined(infoR.gateway_payment_method)) {
                if (!_.isNull(infoR.gateway_errors)) {
Severity: Minor
Found in legacy/src/vms/common-payment-vm.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    view: function({state, attrs}) {
        const buttonLabel = state.isSubscriptionEdit() && !attrs.isReactivation() ? window.I18n.t('subscription_edit', I18nScope()) : window.I18n.t('pay_slip', I18nScope());

        return m('.w-row',
                    m('.w-col.w-col-12',
Severity: Minor
Found in legacy/src/c/payment-slip.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    view: function({state, attrs}) {
        const project = attrs.project;
        const projectOwnerName = project.user ? (project.user.public_name || project.user.name) : (project.owner_public_name || project.owner_name);
        
        const projectLocalizationObject = {
Severity: Minor
Found in legacy/src/c/project-card.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    view: function({ state, attrs }) {
        if (h.userSignedIn() && h.getUserID() != attrs.follow_id) {
            let disableClass = attrs.disabledClass || '.w-button.btn.btn-medium.btn-terciary.u-margintop-20',
                enabledClass = attrs.enabledClass || '.w-button.btn.btn-medium.u-margintop-20';
            if (state.loading()) {
Severity: Minor
Found in legacy/src/c/user-follow-btn.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function oninit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    oninit: function(vnode) {
        const contributedProjects = prop(),
            latestProjects = prop([]),
            userDetails = prop({}),
            user_id = vnode.attrs.user.user_id,
Severity: Minor
Found in legacy/src/c/menu-profile.js - About 1 hr to fix

    Function oninit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const resource = _.first(vnode.attrs.collection()),
                limitDataset = vnode.attrs.limitDataset,
                source = !_.isUndefined(resource)
                    ? _.isNumber(limitDataset)
    Severity: Minor
    Found in legacy/src/c/project-data-chart.js - About 1 hr to fix

      Function oninit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          oninit: function(vnode) {
              const userFriendVM = catarse.filtersVM({ user_id: 'eq' }),
                  user = vnode.attrs.user,
                  friendListVM = getFriendsListVM(),
                  allLoading = prop(false),
      Severity: Minor
      Found in legacy/src/c/user-friends.js - About 1 hr to fix

        Function oninit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            oninit: function(vnode) {
                const user_id = vnode.attrs.userId,
                    showDraft = vnode.attrs.showDraft || false,
                    error = prop(false);
        
        
        Severity: Minor
        Found in legacy/src/c/user-created.js - About 1 hr to fix

          Function renderNode has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            return function renderNode(parent, node, treePath) {
              if (!node) {
                return ''
              }
              if (isArray(node)) {
          Severity: Minor
          Found in legacy/spec/lib/mithril-query/mithril-query.js - About 1 hr to fix

            Function closeModal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                closeModal = () => {
                    // Temp for rails unstyled close links
                    const close = (elm, selector) => {
                        const all = document.getElementsByClassName(selector);
                        let cur = elm.parentNode;
            Severity: Minor
            Found in legacy/src/h.ts - About 1 hr to fix

              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

              Severity
              Category
              Status
              Source
              Language