catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

    oninit: function(vnode) {
        const displayForm = h.toggleProp(false, true),
            displayFormWithName = prop(''),
            sendSuccess = prop(false),
            submitDisabled = prop(false),
Severity: Major
Found in legacy/src/c/project-report.js - About 3 hrs to fix

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

        oninit: function(vnode) {
            const builder = vnode.attrs.data,
                complete = prop(false),
                data = {},
                error = prop(false),
    Severity: Major
    Found in legacy/src/c/admin-radio-action.js - About 3 hrs to fix

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

                                      m(`a[id="rewards-link"][class="w-hidden-main w-hidden-medium dashboard-nav-link mf  ${(h.hashMatch('#rewards') || (h.mobileScreen() && h.hashMatch('')) ? 'selected' : '')}"][href="/${project().permalink}#rewards"]`, {
                                          style: 'float: left;',
                                          onclick: h.analytics.event({
                                              cat: 'project_view', act: 'project_rewards_view', project: project() })
                                      }, 'Recompensas') 
      Severity: Major
      Found in legacy/src/c/project-tabs.js and 1 other location - About 3 hrs to fix
      legacy/src/c/project-tabs.js on lines 77..81

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

      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

              it('should render a big project card when type is big', () => {
                  expect($output('big').find('.card-project-thumb.big').length).toEqual(1);
                  expect($output('big').contains(project.owner_name)).toEqual(true);
                  expect($output('big').contains(remainingTimeObj.unit)).toEqual(true);
              });
      Severity: Major
      Found in legacy/spec/components/project-card.spec.js and 1 other location - About 3 hrs to fix
      legacy/spec/components/project-card.spec.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 106.

      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

              it('should render a medium project card when type is medium', () => {
                  expect($output('medium').find('.card-project-thumb.medium').length).toEqual(1);
                  expect($output('medium').contains(project.owner_name)).toEqual(true);
                  expect($output('medium').contains(remainingTimeObj.unit)).toEqual(true);
              });
      Severity: Major
      Found in legacy/spec/components/project-card.spec.js and 1 other location - About 3 hrs to fix
      legacy/spec/components/project-card.spec.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 106.

      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(`a[id="rewards-link"][class="w-hidden-main w-hidden-medium dashboard-nav-link mf ${(h.hashMatch('#contribution_suggestions') || (h.mobileScreen() && h.hashMatch('')) ? 'selected' : '')}"][href="/${project().permalink}#contribution_suggestions"]`, {
                                          style: 'float: left;',
                                          onclick: h.analytics.event({
                                              cat: 'project_view', act: 'project_contribsuggestions_view', project: project() })
                                      }, 'Valores Sugeridos'),
      Severity: Major
      Found in legacy/src/c/project-tabs.js and 1 other location - About 3 hrs to fix
      legacy/src/c/project-tabs.js on lines 71..75

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

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

          view({ state, attrs }) {
      
              const onSearch = attrs.onSearch;
              const onSelect = attrs.onSelect;
              const isLoading = attrs.isLoading;
      Severity: Major
      Found in legacy/src/c/explore/explore-search-filter-select.js - About 3 hrs to fix

        Function wrap has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function wrap(component, customAttr) {
            if (!app) {
                app = document.getElementById('application');
            }
        
        
        Severity: Major
        Found in legacy/src/wrap.js - About 3 hrs to fix

          Function view has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              view({attrs}) {
                  const onClose = attrs.onClose;
                  const categories = attrs.categories;
                  const closePreventRedirect = (/** @type {Event} */ event) => {
                      event.preventDefault();
          Severity: Major
          Found in legacy/src/experiments/c/explore-light-box.js - About 3 hrs to fix

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

                view: function({state, attrs}) {
                    const project = attrs.project,
                        rewardDetails = attrs.rewardDetails,
                        activeSubscriptions = _.filter(state.userProjectSubscriptions(), sub => sub.status === 'active'),
                        sortedSubscriptions = _.sortBy(state.userProjectSubscriptions(), sub => _.indexOf(['active', 'started', 'canceling', 'inactive', 'canceled'], sub.status));
            Severity: Minor
            Found in legacy/src/c/project-header.js - About 3 hrs 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const {
                        ViewContentEvent,
                        AddToCartEvent
                    } = projectVM;
            Severity: Minor
            Found in legacy/src/root/projects-subscription-checkout.js - About 3 hrs 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 a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const storeKey = 'selectedReward',
                        MINIMUM_VALUE = 10,
                        reward = vnode.attrs.reward,
                        vm = rewardVM,
            Severity: Minor
            Found in legacy/src/c/project-reward-card.js - About 3 hrs 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 24 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function ({ attrs }) {
                    const disableInternational = attrs.disableInternational;
                    const countryName = attrs.countryName;
                    const fields = attrs.fields;
                    const international = attrs.international;
            Severity: Minor
            Found in legacy/src/c/address-form-national.js - About 3 hrs 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 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const goal = vnode.attrs.goal(),
                        project = vnode.attrs.project,
                        descriptionError = prop(false),
                        titleError = prop(false),
            Severity: Major
            Found in legacy/src/c/project-goal-edit-card.js - About 3 hrs to fix

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

                  oninit: function(vnode) {
                      const contributedProjects = h.RedrawStream();
                      const subscribedProjects = h.RedrawStream();
                      const projectReminders = h.RedrawStream();
                      const mailMarketingLists = h.RedrawStream();
              Severity: Major
              Found in legacy/src/c/user-notifications.js - About 3 hrs to fix

                Function saveReward has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            saveReward = () => {
                                isSavingReward(true);
                                validate();
                                if (vnode.attrs.error()) {
                                    isSavingReward(false);
                Severity: Major
                Found in legacy/src/c/edit-reward-card.js - About 3 hrs to fix

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

                          vnode.state = {
                              projectVM,
                              loadSurvey,
                              countryName,
                              stateName,
                  Severity: Major
                  Found in legacy/src/root/surveys-show.js and 1 other location - About 3 hrs to fix
                  legacy/src/c/user-about-edit.js on lines 200..219

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

                  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

                          vnode.state = {
                              removeLinks,
                              removeLink,
                              addLink,
                              fields,
                  Severity: Major
                  Found in legacy/src/c/user-about-edit.js and 1 other location - About 3 hrs to fix
                  legacy/src/root/surveys-show.js on lines 137..156

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

                  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

                              it('should render reminder when project is open_for_contributions and user signed in and is in_reminder', () => {
                                  let {
                                      output, projectDetail
                                  } = generateContextByNewState({
                                      open_for_contributions: true,
                  Severity: Major
                  Found in legacy/spec/components/project-sidebar.spec.js and 1 other location - About 3 hrs to fix
                  legacy/spec/components/project-sidebar.spec.js on lines 93..104

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

                  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

                              it('should render reminder when project is open_for_contributions and user signed in ant not in_reminder', () => {
                                  let {
                                      output, projectDetail
                                  } = generateContextByNewState({
                                      open_for_contributions: true,
                  Severity: Major
                  Found in legacy/spec/components/project-sidebar.spec.js and 1 other location - About 3 hrs to fix
                  legacy/spec/components/project-sidebar.spec.js on lines 80..91

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

                  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