catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Avoid too many return statements within this function.
Open

    return thing.map(getContent).join('')
Severity: Major
Found in legacy/spec/lib/mithril-query/mithril-query.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                            return hasErrorOn('address_city')
    Severity: Major
    Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return (
                              <UserInfoEdit 
                                  user={userInfoEditVM.user}
                                  isSaving={userInfoEditVM.isSaving || projectPublishByStepsVM.isSaving}
                                  hasErrorOn={(field : string) => userInfoEditVM.hasErrorOn(field)}
      Severity: Major
      Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          var monster={set:function(name,value,days,path,secure,domain){var date=new Date(),expires='',type=typeof(value),valueToUse='',secureFlag='';path=path||"/";if(days){date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toUTCString();}if(type==="object"&&type!=="undefined"){if(!("JSON"in window))throw"Bummer, your browser doesn't support JSON parsing.";valueToUse=encodeURIComponent(JSON.stringify({v:value}));}else{valueToUse=encodeURIComponent(value);}if(secure){secureFlag="; secure";}domain=domain?"; domain="+encodeURIComponent(domain):"";document.cookie=name+"="+valueToUse+expires+"; path="+path+secureFlag+domain;},get:function(name){var nameEQ=name+"=",ca=document.cookie.split(';'),value='',firstChar='',parsed={};for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)===0){value=decodeURIComponent(c.substring(nameEQ.length,c.length));firstChar=value.substring(0,1);if(firstChar=="{"){try{parsed=JSON.parse(value);if("v"in parsed)return parsed.v;}catch(e){return value;}}if(value=="undefined")return undefined;return value;}}return null;},remove:function(name){this.set(name,"",-1);},increment:function(name,days){var value=this.get(name)||0;this.set(name,(parseInt(value,10)+1),days);},decrement:function(name,days){var value=this.get(name)||0;this.set(name,(parseInt(value,10)-1),days);}};
        Severity: Major
        Found in legacy/spec/lib/analytics.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return hasErrorOn('phone_number')
          Severity: Major
          Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return hasErrorOn(field)
            Severity: Major
            Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return (
                                      <RewardsEdit project={projectPublishByStepsVM.project} />
                                  )
              Severity: Major
              Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return (
                                        <ShareReminder project={project} />
                                    )
                Severity: Major
                Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return (
                                          <Todo />
                                      )
                  Severity: Major
                  Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return (
                                            <Share project={project} />
                                        )
                    Severity: Major
                    Found in legacy/src/root/projects/publish-by-steps/projects-publish-by-steps.tsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return false;
                      Severity: Major
                      Found in legacy/src/h.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return hasErrorOn('address_neighbourhood')
                        Severity: Major
                        Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                  return hasErrorOn('address_zip_code')
                          Severity: Major
                          Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return true;
                            Severity: Major
                            Found in legacy/src/h.ts - About 30 mins to fix

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

                                  view: function({attrs}) {
                                      const project = attrs.project(),
                                          paymentState = project.state === 'failed' ? 'paid,refunded' : 'paid',
                                          isFailed = project.state === 'failed',
                                          isSuccessful = project.state === 'successful',
                              Severity: Minor
                              Found in legacy/src/c/download-reports.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  view: function({state, attrs}) {
                                      const stats = _.first(state.stats());
                                      const testimonials = () => _.map(state.testimonials, (testimonial) => {
                                          const content = m('.card.u-radius.card-big.card-terciary', [
                                              m('.u-text-center.u-marginbottom-20', [
                              Severity: Minor
                              Found in legacy/src/root/start.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  view: function({state, attrs}) {
                                      const reward = attrs.reward(),
                                          contribution = attrs.contribution,
                                          available = parseInt(reward.paid_count) + parseInt(reward.waiting_payment_count),
                                          shippingFee = state.shippingFee();
                              Severity: Minor
                              Found in legacy/src/c/admin-reward.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  view: function({state, attrs}) {
                                      const 
                                          captalize = (str) => str.charAt(0).toUpperCase() + str.slice(1),
                                          paymentStatus = attrs.payment.status,
                                          paymentAmount = attrs.payment.amount,
                              Severity: Minor
                              Found in legacy/src/c/dashboard-subscription-card-detail-payment-history-entry.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  oninit: function(vnode) {
                                      const templates = commonNotification.paginationVM(
                                          models.notificationTemplates, 'label.asc'),
                                          loaderTemp = prop(true),
                                          loaderSubmit = prop(false),
                              Severity: Minor
                              Found in legacy/src/root/admin-notifications.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  view: function({state, attrs}) {
                                      const project = state.projectVM.currentProject;
                                      const projectVM = state.projectVM;
                                      const projectOwner = state.projectOwner;
                                      const displayAdultContentPopup = state.displayAdultContentPopup;
                              Severity: Minor
                              Found in legacy/src/root/projects-show.js - About 25 mins 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