catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Function generateWrapperModal has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            generateWrapperModal = (customAttrs) => {
                const wrapper = {
                    view: function({state, attrs}) {
                        actionMenuToggle(false);
                        return m('', [
Severity: Major
Found in legacy/src/root/admin-balance-tranfers.js - About 2 hrs to fix

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

        view({attrs}) {
            
            const {
                position,
                title,
    Severity: Major
    Found in legacy/src/c/admin-home-banners-entry.js - About 2 hrs to fix

      Function project has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          get project() : ProjectDetails {
              const self = this
              return {
                  ...this._project,
                  get project_id() {
      Severity: Major
      Found in legacy/src/vms/project-publish-by-steps-vm.ts - About 2 hrs to fix

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

            oninit: function(vnode) {
                const loader = catarse.loaderWithToken,
                    filterVM = catarse.filtersVM({
                        project_id: 'eq'
                    }),
        Severity: Minor
        Found in legacy/src/root/surveys.js - About 2 hrs to fix

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

              oninit: function(vnode) {
                  const listVM = userListVM,
                      filterVM = userFilterVM,
                      error = prop(''),
                      itemBuilder = [{
          Severity: Minor
          Found in legacy/src/root/admin-users.js - About 2 hrs to fix

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

                oninit: function(vnode) {
                    const vm = projectCardVM,
                        mapErrors = [
                            ['uploaded_image', ['uploaded_image']],
                            ['cover_image', ['cover_image']],
            Severity: Minor
            Found in legacy/src/c/project-card-edit.js - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                      if (
                          cnpj == '00000000000000' ||
                          cnpj == '11111111111111' ||
                          cnpj == '22222222222222' ||
                          cnpj == '33333333333333' ||
              Severity: Critical
              Found in legacy/src/h.ts - About 2 hrs to fix

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

                                case '#welcome_message':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('welcome', I18nScope()),
                                        subtitle: window.I18n.t('welcome_subtitle', I18nScope()),
                                        content: m(projectEditWelcomeMessage, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 113..118

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

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

                                case '#announce_expiration':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('announce_expiration', I18nScope()),
                                        subtitle: window.I18n.t('announce_expiration_subtitle', I18nScope()),
                                        content: m(projectAnnounceExpiration, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97

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

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

                                case '#budget':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('budget', I18nScope()),
                                        subtitle: window.I18n.t('budget_subtitle', I18nScope()),
                                        content: m(projectEditBudget, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

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

                                case '#user_about':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('user_about', I18nScope()),
                                        subtitle: window.I18n.t('user_about_subtitle', I18nScope()),
                                        content: m(projectEditUserAbout, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

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

                                case '#description':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('description', I18nScope()),
                                        subtitle: window.I18n.t('description_subtitle', I18nScope()),
                                        content: m(projectEditDescription, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

                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 sendSubscriptionUpgrade = data => commonSubscriptionUpgrade.postWithToken(
                    { data },
                    null,
                    (h.isDevEnv() ? { 'X-forwarded-For': '127.0.0.1' } : {})
                )
                Severity: Major
                Found in legacy/src/vms/common-payment-vm.js and 1 other location - About 2 hrs to fix
                legacy/src/vms/common-payment-vm.js on lines 78..83

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

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

                                case '#reward':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('reward_html', I18nScope()),
                                        subtitle: window.I18n.t('reward_subtitle', I18nScope()),
                                        content: m(projectEditReward, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

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

                                case '#integrations':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('integrations_html', I18nScope()),
                                        subtitle: window.I18n.t('integrations_subtitle', I18nScope()),
                                        content: m(ProjectEditIntegrations, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 78..83
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

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

                                case '#user_settings':
                                    return m(projectEditTab, {
                                        title: window.I18n.t('user_settings', I18nScope()),
                                        subtitle: window.I18n.t('user_settings_subtitle', I18nScope()),
                                        content: m(projectEditUserSettings, _.extend({}, c_opts))
                Severity: Major
                Found in legacy/src/root/project-edit.js and 7 other locations - About 2 hrs to fix
                legacy/src/root/project-edit.js on lines 50..55
                legacy/src/root/project-edit.js on lines 57..62
                legacy/src/root/project-edit.js on lines 64..69
                legacy/src/root/project-edit.js on lines 71..76
                legacy/src/root/project-edit.js on lines 85..90
                legacy/src/root/project-edit.js on lines 92..97
                legacy/src/root/project-edit.js on lines 113..118

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

                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 paymentInfo = paymentId => commonPaymentInfo
                    .postWithToken({ id: paymentId }, null, (h.isDevEnv() ? { 'X-forwarded-For': '127.0.0.1' } : {}))
                    .catch((error) => {
                        h.captureException(error);
                        throw error;
                Severity: Major
                Found in legacy/src/vms/common-payment-vm.js and 1 other location - About 2 hrs to fix
                legacy/src/vms/common-payment-vm.js on lines 22..30

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

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

                jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
                  var showPassed, showSkipped;
                
                  this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
                      this.createDom('div', { className: 'banner' },
                Severity: Minor
                Found in legacy/spec/lib/jasmine/jasmine-html.js - About 1 hr to fix

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

                                                          m('.card.card-terciary.u-radius.u-marginbottom-40',
                                                              m(addressForm, {
                                                                  addVM: state.vm.fields.address(),
                                                                  addressFields: state.vm.fields.address().fields,
                                                                  international: state.vm.isInternational,
                  Severity: Major
                  Found in legacy/src/root/projects-payment.js and 1 other location - About 1 hr to fix
                  legacy/src/root/projects-subscription-checkout.js on lines 337..344

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

                  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

                                                  m('.card.card-terciary.u-radius.u-marginbottom-40',
                                                      m(addressForm, {
                                                          addVM: state.vm.fields.address(),
                                                          addressFields: state.vm.fields.address().fields,
                                                          international: state.vm.isInternational,
                  Severity: Major
                  Found in legacy/src/root/projects-subscription-checkout.js and 1 other location - About 1 hr to fix
                  legacy/src/root/projects-payment.js on lines 337..344

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

                  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