catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

        const project = catarse.loaderWithToken(
            models.project.getPageOptions(
                catarse
                    .filtersVM({ project_id: 'eq' })
                    .project_id(project_id)
Severity: Major
Found in legacy/src/vms/user-vm.js and 1 other location - About 1 hr to fix
legacy/src/vms/user-vm.js on lines 262..269

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

Function submitNotes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            submitNotes = () => {
                loadingNotes(true);
                m.request({
                    method: 'PUT',
                    url: `/admin/balance_transfers/${vnode.attrs.item.id}`,
Severity: Minor
Found in legacy/src/c/admin-balance-transfer-item-detail.js - About 1 hr to fix

    Function saveGoal has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            const saveGoal = () => {
                validate();
                if (vnode.attrs.error()) {
                    return false;
                }
    Severity: Minor
    Found in legacy/src/c/project-goal-edit-card.js - About 1 hr to fix

      Function submitInvite has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  submitInvite = () => {
                      if (_.isEmpty(emailText()) || loading() === true) {
                      } else {
                          loading(true);
                          const emailList = _.reduce(emailText().split('\n'), (memo, text) => {
      Severity: Minor
      Found in legacy/src/c/project-email-invite.js - About 1 hr to fix

        Function execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
          this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
          var latchFunctionResult;
          try {
            latchFunctionResult = this.latchFunction.apply(this.spec);
        Severity: Minor
        Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

              oninit({ attrs, state } : m.Vnode<InputFindLocationAttrs, InputFindLocationState>) {
          
                  if (attrs.city_id) {
                      getCityById(attrs.city_id).then(city => {
                          state.selectedCity = city
          Severity: Minor
          Found in legacy/src/c/std/input-find-location.tsx - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
                  return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
                } else {
                  return "Expected function to throw an exception.";
                }
            Severity: Major
            Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if(project&&(project.id||project.project_id)) {
                        data.project={
                          id: project.id||project.project_id,
                          user_id: project.user_id||project.project_user_id,
                          category_id: project.category_id,
              Severity: Major
              Found in legacy/spec/lib/analytics.js - About 1 hr to fix

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

                                    rewardVM.updateReward(vnode.attrs.project_id, reward.id(), data).then(() => {
                                        vnode.attrs.showSuccess(true);
                                        reward.edit.toggle();
                
                                        vnode.attrs.uploadImage(reward, imageFileToUpload, vnode.attrs.project_id, reward.id())
                Severity: Major
                Found in legacy/src/c/edit-reward-card.js and 1 other location - About 1 hr to fix
                legacy/src/c/edit-reward-card.js on lines 141..168

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

                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

                                                                                    state.error().length > 0 ? m('.text-error', [
                                                                                        m('br'),
                                                                                        m('span.fa.fa-exclamation-triangle'),
                                                                                        ` ${state.error()}`
                                                                                    ]) : ''
                Severity: Major
                Found in legacy/src/root/projects-reward.js and 1 other location - About 1 hr to fix
                legacy/src/c/project-reward-card.js on lines 220..224

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

                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

                                        state.error().length > 0 ? m('.text-error', [
                                            m('br'),
                                            m('span.fa.fa-exclamation-triangle'),
                                            ` ${state.error()}`
                                        ]) : ''
                Severity: Major
                Found in legacy/src/c/project-reward-card.js and 1 other location - About 1 hr to fix
                legacy/src/root/projects-reward.js on lines 127..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 55.

                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('div',
                                    m('.w-row', [
                                        m('.w-col.w-col-3'),
                                        m('.u-text-center.w-col.w-col-6', [
                                            m("input.btn.btn-inactive.btn-large.u-marginbottom-20[name='commit'][type='submit'][value='Cancelar campanha']"),
                Severity: Major
                Found in legacy/src/c/cancel-project-modal-content.js and 1 other location - About 1 hr to fix
                legacy/src/c/delete-project-modal-content.js on lines 87..101

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

                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('div',
                                      m('.w-row',
                                          [
                                              m('.w-col.w-col-3'),
                                              m('.u-text-center.w-col.w-col-6',
                Severity: Major
                Found in legacy/src/c/delete-project-modal-content.js and 1 other location - About 1 hr to fix
                legacy/src/c/cancel-project-modal-content.js on lines 55..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 55.

                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

                                    rewardVM.createReward(vnode.attrs.project_id, data).then((r) => {
                                            vnode.attrs.showSuccess(true);
                                            reward.newReward = false;
                                            // save id so we can update without reloading the page
                                            reward.id(r.reward_id);
                Severity: Major
                Found in legacy/src/c/edit-reward-card.js and 1 other location - About 1 hr to fix
                legacy/src/c/edit-reward-card.js on lines 174..197

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

                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 (higherValue !== 0)
                                {
                                    placeholder = placeholder.replace('#V2', higherValue);
                                }
                                else
                Severity: Major
                Found in legacy/src/c/filter-dropdown-number-range.js and 1 other location - About 1 hr to fix
                legacy/src/c/filter-dropdown-number-range.js on lines 70..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 55.

                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

                                remove: {
                                    property: 'state',
                                    updateKey: 'id',
                                    callToAction: 'Apagar',
                                    innerLabel: 'Tem certeza que deseja apagar esse apoio?',
                Severity: Major
                Found in legacy/src/c/admin-contribution-detail.js and 1 other location - About 1 hr to fix
                legacy/src/c/admin-contribution-detail.js on lines 35..45

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

                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-row.fontsize-small.u-marginbottom-10', [
                                         m('.w-col.w-col-4', [
                                             m('.text-success', `+ R$ ${h.formatNumber(pt.irrf_tax, 2)}`)
                                         ]),
                                         m('.w-col.w-col-8', [
                Severity: Major
                Found in legacy/src/c/successful-project-tax-modal.js and 1 other location - About 1 hr to fix
                legacy/src/c/successful-project-tax-modal.js on lines 50..57

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

                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

                                _.map(surveyData.open_questions, (question) => {
                                    openQuestions().push({
                                        question,
                                        value: prop(question.answer)
                                    });
                Severity: Major
                Found in legacy/src/root/surveys-show.js and 1 other location - About 1 hr to fix
                legacy/src/root/surveys-show.js on lines 128..133

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

                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-row.fontsize-base.fontweight-semibold', [
                                        m('.w-col.w-col-4', [
                                            m('div', `R$ ${h.formatNumber(pt.total_amount, 2)}`)
                                        ]),
                                        m('.w-col.w-col-8', [
                Severity: Major
                Found in legacy/src/c/successful-project-tax-modal.js and 1 other location - About 1 hr to fix
                legacy/src/c/successful-project-tax-modal.js on lines 33..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 55.

                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-6.w-col-small-6.w-col-tiny-6', [
                                                            m('label.text.required.field-label.field-label.fontweight-semibold.force-text-dark[for=\'user_bank_account_attributes_account_digit\']',
                                                                'Dígito conta'
                                                            ),
                                                            m('input.string.required.w-input.text-field.positive[id=\'user_bank_account_attributes_account_digit\'][type=\'text\']', {
                Severity: Major
                Found in legacy/src/c/user-billing.js and 1 other location - About 1 hr to fix
                legacy/src/c/user-billing.js on lines 378..387

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

                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