catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Function onSubmit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            onSubmit = () => {
                loading(true);
                m.redraw();
                vm.uploadImage(vnode.attrs.projectId).then(() => {
                    vm.updateProject(vnode.attrs.projectId).then(() => {
Severity: Minor
Found in legacy/src/c/project-card-edit.js - About 1 hr to fix

    Function validate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                validate = () => {
                    vnode.attrs.error(false);
                    vnode.attrs.errors('Erro ao salvar informações. Confira os dados informados.');
                    descriptionError(false);
                    minimumValueError(false);
    Severity: Minor
    Found in legacy/src/c/edit-reward-card.js - About 1 hr to fix

      Function animateProgress has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  animateProgress = localVnode => {
                      let animation,
                          progress = 0,
                          pledged = 0,
                          contributors = 0;
      Severity: Minor
      Found in legacy/src/c/project-sidebar.js - About 1 hr to fix

        Function sendReport has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    sendReport = (validateFunction) => {
                        if (!validateFunction()) {
                            return false;
                        }
                        submitDisabled(true);
        Severity: Minor
        Found in legacy/src/c/project-report.js - About 1 hr to fix

          Function lookup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            I18n.lookup = function(scope, options) {
              options = this.prepareOptions(options);
          
              var locales = this.locales.get(options.locale).slice()
                , requestedLocale = locales[0]
          Severity: Minor
          Found in legacy/spec/lib/i18n/i18n.js - About 1 hr to fix

            Function loadRewards has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    async function loadRewards() {
            
                        await rewardVM.fetchRewards(attrs.project_id)
            
                        rewards([]);
            Severity: Minor
            Found in legacy/src/c/projects/edit/rewards-edit-list.tsx - About 1 hr to fix

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

                  view: function({state, attrs}) {
                      const project = state.projectDetail();
                      const projectFiscalData = state.projectFiscalData();
                      const loading = state.l() || state.l2();
                      const hasData = !loading && projectFiscalData && (!_.isEmpty(projectFiscalData.debit_notes) || !_.isEmpty(projectFiscalData.informs));
              Severity: Minor
              Found in legacy/src/root/projects-fiscal.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view({ state, attrs }) {
              
                      const GATrackingID = state.GATrackingID;
                      const FBPixelTrackingID = state.FBPixelTrackingID;
                      const save = state.save;
              Severity: Minor
              Found in legacy/src/root/project-edit-integrations.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  oninit: function (vnode) {
                      const filterVM = projectsSubscriptionReportVM,
                          catarseVM = projectsContributionReportVM,
                          dropdownNumber = prop(0),
                          error = prop(false),
              Severity: Minor
              Found in legacy/src/root/projects-subscription-report.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  oninit: function(vnode) {
                      const {
                          ViewContentEvent,
                          PurchaseEvent
                      } = projectVM;
              Severity: Minor
              Found in legacy/src/root/thank-you.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const project = state.project;
                      if (_.isEmpty(project())) {
                          return h.loader();
                      }
              Severity: Minor
              Found in legacy/src/root/projects-subscription-contribution.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const list = attrs.vm.list,
                          error = attrs.vm.error,
                          label = attrs.label || '',
                          itemComponent = attrs.itemComponent || adminItem;
              Severity: Minor
              Found in legacy/src/c/admin-list.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  oninit: function (vnode) {
                      const
                          firstValue = prop(0),
                          secondValue = prop(0),
                          clearFieldValues = () => { firstValue(0), secondValue(0) },
              Severity: Minor
              Found in legacy/src/c/filter-dropdown-number-range.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const data = attrs.data,
                          btnValue = (state.l()) ? 'por favor, aguarde...' : data.callToAction;
              
                      return m('.w-col.w-col-2', [
              Severity: Minor
              Found in legacy/src/c/admin-input-action.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      let user = attrs.user,
                          fields = state.fields,
                          bankAccount = state.bankAccount();
              
              
              Severity: Minor
              Found in legacy/src/c/user-billing.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const project = attrs.project;
                      const projectOwnerName = project.user ? (project.user.public_name || project.user.name) : (project.owner_public_name || project.owner_name);
                      
                      const projectLocalizationObject = {
              Severity: Minor
              Found in legacy/src/c/project-card.js - About 1 hr 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 trialsToGetPaymentInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              const trialsToGetPaymentInfo = (p, catalog_payment_id, retries) => {
                  if (retries > 0) {
                      paymentInfo(catalog_payment_id).then((infoR) => {
                          if (_.isNull(infoR.gateway_payment_method) || _.isUndefined(infoR.gateway_payment_method)) {
                              if (!_.isNull(infoR.gateway_errors)) {
              Severity: Minor
              Found in legacy/src/vms/common-payment-vm.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const data = attrs.data,
                          item = attrs.item(),
                          btnValue = (state.setLoader() || state.getLoader()) ? 'por favor, aguarde...' : data.callToAction;
              
              
              Severity: Minor
              Found in legacy/src/c/admin-radio-action.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({ state, attrs }) {
                      if (h.userSignedIn() && h.getUserID() != attrs.follow_id) {
                          let disableClass = attrs.disabledClass || '.w-button.btn.btn-medium.btn-terciary.u-margintop-20',
                              enabledClass = attrs.enabledClass || '.w-button.btn.btn-medium.u-margintop-20';
                          if (state.loading()) {
              Severity: Minor
              Found in legacy/src/c/user-follow-btn.js - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const buttonLabel = state.isSubscriptionEdit() && !attrs.isReactivation() ? window.I18n.t('subscription_edit', I18nScope()) : window.I18n.t('pay_slip', I18nScope());
              
                      return m('.w-row',
                                  m('.w-col.w-col-12',
              Severity: Minor
              Found in legacy/src/c/payment-slip.js - About 1 hr 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

              Severity
              Category
              Status
              Source
              Language