catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

        it('should return true if submission has it\'s error flag set to true', () => {
            e.submissionError(true);
            expect(e.hasSubmissionError()).toBeTrue();
        });
Severity: Minor
Found in legacy/spec/helpers/error.spec.js and 2 other locations - About 30 mins to fix
legacy/spec/helpers/error.spec.js on lines 66..69
legacy/spec/helpers/error.spec.js on lines 93..96

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

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

Avoid too many return statements within this function.
Open

                    return (
                        <Todo />
                    )
Severity: Major
Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                        return (
                            <Share project={project} />
                        )
    Severity: Major
    Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return false;
      Severity: Major
      Found in legacy/src/h.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return hasErrorOn('address_neighbourhood')
        Severity: Major
        Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return hasErrorOn('address_zip_code')
          Severity: Major
          Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

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

                                m(`input.text-field.w-input[type="text"][id="image${entry_id_suffix}"]`, {
                                    oninput: (event) => image(event.target.value),
                                    value: image()
                                })
            Severity: Major
            Found in legacy/src/c/admin-home-banners-entry.js and 4 other locations - About 30 mins to fix
            legacy/src/c/admin-home-banners-entry.js on lines 25..28
            legacy/src/c/admin-home-banners-entry.js on lines 32..35
            legacy/src/c/admin-home-banners-entry.js on lines 39..42
            legacy/src/c/admin-home-banners-entry.js on lines 46..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 45.

            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

            Avoid too many return statements within this function.
            Open

                    return true;
            Severity: Major
            Found in legacy/src/h.ts - About 30 mins to fix

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

              const updateProject = (project_id) => {
                  const projectData = {
                      budget: fields.budget()
                  };
              
              
              Severity: Major
              Found in legacy/src/vms/project-budget-vm.js and 3 other locations - About 30 mins to fix
              legacy/src/vms/project-card-vm.js on lines 65..71
              legacy/src/vms/project-description-vm.js on lines 17..23
              legacy/src/vms/project-video-vm.js on lines 16..22

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

              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 false if submission has it\'s error flag set to false', () => {
                          e.submissionError(false);
                          expect(e.hasSubmissionError()).toBeFalse();
                      });
              Severity: Minor
              Found in legacy/spec/helpers/error.spec.js and 2 other locations - About 30 mins to fix
              legacy/spec/helpers/error.spec.js on lines 66..69
              legacy/spec/helpers/error.spec.js on lines 89..92

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

              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

                  account: `${account.account}${account.account_digit ? `-${account.account_digit}` : ''}`,
              Severity: Minor
              Found in legacy/src/vms/insight-vm.js and 1 other location - About 30 mins to fix
              legacy/src/vms/insight-vm.js on lines 10..10

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

              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 rewardsLoader = projectId => {
                  vm.project_id(projectId);
              
                  return catarse.loaderWithToken(models.rewardDetail.getPageOptions(vm.parameters()));
              };
              Severity: Minor
              Found in legacy/src/vms/reward-vm.js and 1 other location - About 30 mins to fix
              legacy/src/root/surveys-show.js on lines 46..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 45.

              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

                  } else if (/\s\d?$/.test(value)) {
                      e.preventDefault();
                      return setTimeout(() => $target.value = cardNumberProp(value.replace(/\d$/, '')));
                  }
              Severity: Minor
              Found in legacy/src/vms/credit-card-vm.js and 1 other location - About 30 mins to fix
              legacy/src/vms/credit-card-vm.js on lines 135..141

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

              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

                  agency: `${account.agency}${account.agency_digit ? `-${account.agency_digit}` : ''}`,
              Severity: Minor
              Found in legacy/src/vms/insight-vm.js and 1 other location - About 30 mins to fix
              legacy/src/vms/insight-vm.js on lines 11..11

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

              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

                          surveyLoader = () => {
                              vm.contribution_id(contributionId);
                              return catarse.loaderWithToken(models.survey.getPageOptions(vm.parameters()));
                          },
              Severity: Minor
              Found in legacy/src/root/surveys-show.js and 1 other location - About 30 mins to fix
              legacy/src/vms/reward-vm.js on lines 24..28

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

              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 l = commonAnalytics.loaderWithToken(models.projectSubscribersInfo.postOptions({
                          id: vnode.attrs.project.common_id
                      }));
              Severity: Minor
              Found in legacy/src/c/project-goals-edit.js and 1 other location - About 30 mins to fix
              legacy/src/c/cancel-subscription-content.js on lines 21..23

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

              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

                if (e.sourceURL) {
                  file = e.sourceURL;
                }
                else if (e.fileName) {
                  file = e.fileName;
              Severity: Minor
              Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 30 mins to fix
              legacy/spec/lib/jasmine/jasmine.js on lines 614..619

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

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

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

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

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

              Refactorings

              Further Reading

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

                                          m('.w-col.w-col-2.w-col-small-2.w-col-stack.w-col-tiny-2', [
                                              m('.fontweight-semibold', slip.total_subscriptions + credit_card.total_subscriptions),
                                              m('.fontsize-smallest.fontcolor-secondary', credit_card.total_subscriptions),
                                              m('.fontsize-smallest.fontcolor-secondary', slip.total_subscriptions)
                                          ]),
              Severity: Minor
              Found in legacy/src/c/subscriptions-per-month-table.js and 1 other location - About 30 mins to fix
              legacy/src/c/subscriptions-per-month-table.js on lines 54..58

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

              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

                          cLoader
                              .load()
                              .then(
                                  _.compose(
                                      collection,
              Severity: Minor
              Found in legacy/src/c/projects-display.js and 1 other location - About 30 mins to fix
              legacy/src/vms/user-vm.js on lines 234..242

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

              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('.table-col.w-hidden-small.w-hidden-tiny.w-col.w-col-2.w-col-small-2.w-col-stack.w-col-tiny-2', [
                                              m('.fontweight-semibold', slip.new_subscriptions + credit_card.new_subscriptions),
                                              m('.fontsize-smallest.fontcolor-secondary', credit_card.new_subscriptions),
                                              m('.fontsize-smallest.fontcolor-secondary', slip.new_subscriptions)
                                          ]),
              Severity: Minor
              Found in legacy/src/c/subscriptions-per-month-table.js and 1 other location - About 30 mins to fix
              legacy/src/c/subscriptions-per-month-table.js on lines 64..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 45.

              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