catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

    oninit: function(vnode) {
        const vm = projectBudgetVM,
            mapErrors = [
                  ['budget', ['budget']]
            ],
Severity: Minor
Found in legacy/src/c/project-budget-edit.js - About 1 hr to fix

    Function collectionsMapper has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            const collectionsMapper = (sampleNo, name) => {
                const f = filters[name],
                    forSubPledged = name === 'sub' ? { pledged: 'gte.1000' } : {},
                    defaultOptions = {
                        order: 'score.desc',
    Severity: Minor
    Found in legacy/src/c/projects-display.js - About 1 hr to fix

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

          oninit: function(vnode) {
              const designStates = {
                      waiting_funds: {
                          processing: {
                              lineClass: '.done',
      Severity: Minor
      Found in legacy/src/c/project-successful-progress-bar.js - About 1 hr to fix

        Function formatCardInputNumber has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const formatCardInputNumber = (e, cardNumberProp) => {
            let $target,
                card,
                digit,
                length,
        Severity: Minor
        Found in legacy/src/vms/credit-card-vm.js - About 1 hr to fix

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

                  it('should return a success CSS class when contribution state is paid', () => {
                      let contribution = ContributionDetailMockery(1, {
                          state: 'paid'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 4 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 29..35
          legacy/spec/components/payment-status.spec.js on lines 36..42
          legacy/spec/components/payment-status.spec.js on lines 43..49
          legacy/spec/components/payment-status.spec.js on lines 50..56

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

          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

                  it('should return a credit card CSS class when contribution payment method is credit card', () => {
                      let contribution = ContributionDetailMockery(1, {
                          payment_method: 'CartaoDeCredito'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 2 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 64..70
          legacy/spec/components/payment-status.spec.js on lines 78..84

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

          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

                  it('should return an error CSS class when contribution payment method is not known', () => {
                      let contribution = ContributionDetailMockery(1, {
                          payment_method: 'foo'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 2 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 64..70
          legacy/spec/components/payment-status.spec.js on lines 71..77

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

          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 commonData = {
                              rewardCommonId: vnode.attrs.reward_common_id,
                              userCommonId: vnode.attrs.user_common_id,
                              projectCommonId: vnode.attrs.project_common_id,
                              amount: vnode.attrs.value * 100
          Severity: Major
          Found in legacy/src/c/payment-slip.js and 1 other location - About 1 hr to fix
          legacy/src/c/payment-credit-card.js on lines 126..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 64.

          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

                  it('should return a boleto CSS class when contribution payment method is boleto', () => {
                      let contribution = ContributionDetailMockery(1, {
                          payment_method: 'BoletoBancario'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 2 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 71..77
          legacy/spec/components/payment-status.spec.js on lines 78..84

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

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

                  it('should return a success CSS class when contribution state is refunded', () => {
                      let contribution = ContributionDetailMockery(1, {
                          state: 'refunded'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 4 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 22..28
          legacy/spec/components/payment-status.spec.js on lines 36..42
          legacy/spec/components/payment-status.spec.js on lines 43..49
          legacy/spec/components/payment-status.spec.js on lines 50..56

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

          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

                      validateProjectForm = () => {
                          projectCategoryError(projectCategory() == -1);
                          projectNameError(projectName().trim() === '');
          
                          return (!projectCategoryError() && !projectNameError());
          Severity: Major
          Found in legacy/src/root/start.js and 1 other location - About 1 hr to fix
          legacy/src/root/sub-project-new.js on lines 22..27

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

          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-hidden-small.w-hidden-tiny.fontsize-smaller.flex-column', [
                                                          m.trust(window.I18n.t('aon_diff_html', I18nScope())),
                                                          m.trust(window.I18n.t('aon_diff_fees_html', I18nScope({ percentage: serviceFee })))
                                                      ]),
          Severity: Major
          Found in legacy/src/c/project-goal-edit.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-goal-edit.js on lines 113..116

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

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

                  it('should return a warning CSS class when contribution state is pending', () => {
                      let contribution = ContributionDetailMockery(1, {
                          state: 'pending'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 4 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 22..28
          legacy/spec/components/payment-status.spec.js on lines 29..35
          legacy/spec/components/payment-status.spec.js on lines 43..49
          legacy/spec/components/payment-status.spec.js on lines 50..56

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

          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

                      validateProjectForm = () => {
                          projectCategoryError(projectCategory() == -1);
                          projectNameError(projectName().trim() === '');
          
                          return (!projectCategoryError() && !projectNameError());
          Severity: Major
          Found in legacy/src/root/sub-project-new.js and 1 other location - About 1 hr to fix
          legacy/src/root/start.js on lines 94..99

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

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

                  it('should return an error CSS class when contribution state is refused', () => {
                      let contribution = ContributionDetailMockery(1, {
                          state: 'refused'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 4 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 22..28
          legacy/spec/components/payment-status.spec.js on lines 29..35
          legacy/spec/components/payment-status.spec.js on lines 36..42
          legacy/spec/components/payment-status.spec.js on lines 50..56

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

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

                  it('should return an error CSS class when contribution state is not known', () => {
                      let contribution = ContributionDetailMockery(1, {
                          state: 'foo'
                      })[0];
                      setController(contribution);
          Severity: Major
          Found in legacy/spec/components/payment-status.spec.js and 4 other locations - About 1 hr to fix
          legacy/spec/components/payment-status.spec.js on lines 22..28
          legacy/spec/components/payment-status.spec.js on lines 29..35
          legacy/spec/components/payment-status.spec.js on lines 36..42
          legacy/spec/components/payment-status.spec.js on lines 43..49

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

          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 commonData = {
                                  rewardCommonId: vnode.attrs.reward_common_id,
                                  userCommonId: vnode.attrs.user_common_id,
                                  projectCommonId: vnode.attrs.project_common_id,
                                  amount: vnode.attrs.value * 100
          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 37..42

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

          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-hidden-small.w-hidden-tiny.fontsize-smaller.flex-column', [
                                                          m.trust(window.I18n.t('flex_diff_html', I18nScope())),
                                                          m.trust(window.I18n.t('flex_diff_fees_html', I18nScope({ percentage: serviceFee })))
                                                      ])
          Severity: Major
          Found in legacy/src/c/project-goal-edit.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-goal-edit.js on lines 109..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 64.

          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

          Function loadSurvey has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  const loadSurvey = () => {
                      surveyLoader().load().then((data) => {
                          survey(_.first(data));
                          finished(!_.isEmpty(survey().finished_at));
                          answeredAt(survey().survey_answered_at);
          Severity: Minor
          Found in legacy/src/root/surveys-show.js - About 1 hr to fix

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

                oninit: function(vnode) {
                    
                    const {
                        ViewContentEvent,
                    } = projectVM;
            Severity: Minor
            Found in legacy/src/root/projects-subscription-contribution.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language