catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

    oninit: function(vnode) {
        const emailText = prop(''),
            loading = prop(false),
            project = vnode.attrs.project,
            showSuccess = prop(false),
Severity: Minor
Found in legacy/src/c/project-email-invite.js - About 1 hr to fix

    Function MockAjax has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().MockAjax = function($ajax) {
      function MockAjax(global) {
        var requestTracker = new $ajax.RequestTracker(),
          stubTracker = new $ajax.StubTracker(),
          paramParser = new $ajax.ParamParser(),
    Severity: Minor
    Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

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

      const getCreatorsListVM = () => {
          models.creatorSuggestion.pageSize(9);
          const creatorsListVM = catarse.paginationVM(models.creatorSuggestion, 'following.asc, total_published_projects.desc, total_contributed_projects.desc', {
              Prefer: 'count=exact',
          });
      Severity: Major
      Found in legacy/src/vms/friends-vm.js and 3 other locations - About 1 hr to fix
      legacy/src/vms/friends-vm.js on lines 8..13
      legacy/src/vms/friends-vm.js on lines 24..28
      legacy/src/vms/friends-vm.js on lines 30..34

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

      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

                  const filterRewVM = catarse
                          .filtersVM({
                              id: 'eq',
                          })
                          .id(subscription.reward_external_id),
      Severity: Major
      Found in legacy/src/c/user-subscription-box.js and 2 other locations - About 1 hr to fix
      legacy/src/c/dashboard-subscription-card.js on lines 26..29
      legacy/src/c/user-subscription-box.js on lines 35..40

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

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

      const getFriendsListVM = () => {
          models.userFriend.pageSize(9);
          const friendListVM = catarse.paginationVM(models.userFriend, 'following.asc,total_contributed_projects.desc', { Prefer: 'count=exact' });
      
          return h.createBasicPaginationVMWithAutoRedraw(friendListVM);
      Severity: Major
      Found in legacy/src/vms/friends-vm.js and 3 other locations - About 1 hr to fix
      legacy/src/vms/friends-vm.js on lines 15..22
      legacy/src/vms/friends-vm.js on lines 24..28
      legacy/src/vms/friends-vm.js on lines 30..34

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

      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

              const filterProjVM = catarse
                      .filtersVM({
                          project_id: 'eq',
                      })
                      .project_id(subscription.project_external_id),
      Severity: Major
      Found in legacy/src/c/user-subscription-box.js and 2 other locations - About 1 hr to fix
      legacy/src/c/dashboard-subscription-card.js on lines 26..29
      legacy/src/c/user-subscription-box.js on lines 63..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 65.

      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

                  const filterUserVM = catarse.filtersVM({
                          id: 'eq'
                      }).id(subscription.user_external_id),
                      lU = catarse.loaderWithToken(models.userDetail.getRowOptions(filterUserVM.parameters()));
      Severity: Major
      Found in legacy/src/c/dashboard-subscription-card.js and 2 other locations - About 1 hr to fix
      legacy/src/c/user-subscription-box.js on lines 35..40
      legacy/src/c/user-subscription-box.js on lines 63..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 65.

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

      const getUserFollowsListVM = () => {
          models.userFollow.pageSize(9);
          const userFollowsListVM = catarse.paginationVM(models.userFollow, 'created_at.desc', { Prefer: 'count=exact' });
          return h.createBasicPaginationVMWithAutoRedraw(userFollowsListVM);
      };
      Severity: Major
      Found in legacy/src/vms/friends-vm.js and 3 other locations - About 1 hr to fix
      legacy/src/vms/friends-vm.js on lines 8..13
      legacy/src/vms/friends-vm.js on lines 15..22
      legacy/src/vms/friends-vm.js on lines 30..34

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

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

      const getUserFollowersListVM = () => {
          models.userFollower.pageSize(9);
          const userFollowersListVM = catarse.paginationVM(models.userFollower, 'following.asc,created_at.desc', { Prefer: 'count=exact' });
          return h.createBasicPaginationVMWithAutoRedraw(userFollowersListVM);
      };
      Severity: Major
      Found in legacy/src/vms/friends-vm.js and 3 other locations - About 1 hr to fix
      legacy/src/vms/friends-vm.js on lines 8..13
      legacy/src/vms/friends-vm.js on lines 15..22
      legacy/src/vms/friends-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 65.

      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

                                          ] : [
                                              (project.state === 'draft' ? m('button.btn.btn-medium', {
                                                  onclick: state.validatePublish
                                              }, [
                                                  window.I18n.t('publish', I18nScope()), m.trust('  '), m('span.fa.fa-chevron-right')
      Severity: Major
      Found in legacy/src/c/project-dashboard-menu.js and 1 other location - About 1 hr to fix
      legacy/src/c/project-dashboard-menu.js on lines 179..185

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

      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 updateGoal = (projectId, goalId, goalData) => m.request({
          method: 'PATCH',
          url: `/projects/${projectId}/goals/${goalId}.json`,
          data: { goal: goalData },
          config: h.setCsrfToken
      Severity: Major
      Found in legacy/src/vms/project-goals-vm.js and 1 other location - About 1 hr to fix
      legacy/src/vms/reward-vm.js on lines 237..245

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

      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

                                          (project.mode === 'aon' ? [
                                              (project.state === 'draft' ? m('button.btn.btn-medium', {
                                                  onclick: state.validatePublish
                                              }, [
                                                  window.I18n.t('publish', I18nScope()), m.trust('  '), m('span.fa.fa-chevron-right')
      Severity: Major
      Found in legacy/src/c/project-dashboard-menu.js and 1 other location - About 1 hr to fix
      legacy/src/c/project-dashboard-menu.js on lines 185..191

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

      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 getProjectSubscribersListVM = () => {
          models.projectSubscriber.pageSize(15);
          const projectSubscribersListVM = commonProject.paginationVM(models.projectSubscriber, null, { Prefer: 'count=exact' });
          return h.createBasicPaginationVMWithAutoRedraw(projectSubscribersListVM);
      };
      Severity: Major
      Found in legacy/src/vms/project-list-vm.js and 1 other location - About 1 hr to fix
      legacy/src/vms/project-list-vm.js on lines 16..20

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

      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 updateReward = (projectId, rewardId, rewardData) =>
          m.request({
              method: 'PATCH',
              url: `/projects/${projectId}/rewards/${rewardId}.json`,
              data: {
      Severity: Major
      Found in legacy/src/vms/reward-vm.js and 1 other location - About 1 hr to fix
      legacy/src/vms/project-goals-vm.js on lines 69..74

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

      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 getProjectContributorsListVM = () => {
          models.contributor.pageSize(15);
          const projectContributorsListVM = catarse.paginationVM(models.contributor, null, { Prefer: 'count=exact' });
          return h.createBasicPaginationVMWithAutoRedraw(projectContributorsListVM);
      }
      Severity: Major
      Found in legacy/src/vms/project-list-vm.js and 1 other location - About 1 hr to fix
      legacy/src/vms/project-list-vm.js on lines 10..14

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

      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 oninit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          oninit: function(vnode) {
              const exploreButtonBehavoir = h.RedrawStream((/** @type {Event} */ event) => {
                  event.preventDefault();
                  m.route.set('/explore?ref=ctrse_header&filter=all');
              });
      Severity: Minor
      Found in legacy/src/root/menu.js - About 1 hr to fix

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

            oninit: function(vnode) {
                const projectIdVM = catarse.filtersVM({ project_id: 'eq' }),
                    projectAccounts = prop([]),
                    projectTransfers = prop([]),
                    showTaxModal = h.toggleProp(false, true),
        Severity: Minor
        Found in legacy/src/c/project-successful-onboard.js - About 1 hr to fix

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

              oninit: function(vnode) {
                  const fixedNavClass = 'project-nav-fixed',
                      isFixed = prop(false),
                      originalPosition = prop(-1),
                      project = vnode.attrs.project;
          Severity: Minor
          Found in legacy/src/c/project-tabs.js - About 1 hr to fix

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

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

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

                  oninit: function(vnode) {
                      const vm = projectDescriptionVM,
                          mapErrors = [
                                ['about_html', ['about_html']]
                          ],
              Severity: Minor
              Found in legacy/src/c/project-description-edit.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language