catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Avoid too many return statements within this function.
Open

    return b.matches(a);
Severity: Major
Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return (a === b);
    Severity: Major
    Found in legacy/spec/lib/jasmine/jasmine.js - About 30 mins to fix

      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

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

                            m(`input.text-field.w-input[type="text"][id="subtitle${entry_id_suffix}"]`, {
                                oninput: (event) => subtitle(event.target.value),
                                value: subtitle()
                            }),
        Severity: Major
        Found in legacy/src/c/admin-home-banners-entry.js and 4 other locations - About 30 mins to fix
        legacy/src/c/admin-home-banners-entry.js on lines 25..28
        legacy/src/c/admin-home-banners-entry.js on lines 39..42
        legacy/src/c/admin-home-banners-entry.js on lines 46..49
        legacy/src/c/admin-home-banners-entry.js on lines 53..56

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

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

                            m(`input.text-field.w-input[type="text"][id="cta${entry_id_suffix}"]`, {
                                oninput: (event) => cta(event.target.value),
                                value: cta()
                            }),
        Severity: Major
        Found in legacy/src/c/admin-home-banners-entry.js and 4 other locations - About 30 mins to fix
        legacy/src/c/admin-home-banners-entry.js on lines 25..28
        legacy/src/c/admin-home-banners-entry.js on lines 32..35
        legacy/src/c/admin-home-banners-entry.js on lines 39..42
        legacy/src/c/admin-home-banners-entry.js on lines 53..56

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

        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

        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

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

                                  m('.w-container', [
                                      m('.fontsize-large.fontweight-semibold.u-marginbottom-30.u-text-center',
                                          window.I18n.t('thank_you.project_recommendations', I18nScope())
                                      ),
                                      m(projectRow, {
          Severity: Minor
          Found in legacy/src/root/projects-subscription-thank-you.js and 1 other location - About 30 mins to fix
          legacy/src/root/thank-you.js on lines 160..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 45.

          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('.fontsize-large.fontweight-semibold.u-marginbottom-30.u-text-center',
                                               window.I18n.t('thank_you.project_recommendations', I18nScope())
                                              ),
                                             m(projectRow, {
          Severity: Minor
          Found in legacy/src/root/thank-you.js and 1 other location - About 30 mins to fix
          legacy/src/root/projects-subscription-thank-you.js on lines 174..182

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

          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

          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

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

                                m(`input.text-field.w-input[type="text"][id="title${entry_id_suffix}"]`, {
                                    oninput: (event) => title(event.target.value),
                                    value: title()
                                }),
            Severity: Major
            Found in legacy/src/c/admin-home-banners-entry.js and 4 other locations - About 30 mins to fix
            legacy/src/c/admin-home-banners-entry.js on lines 32..35
            legacy/src/c/admin-home-banners-entry.js on lines 39..42
            legacy/src/c/admin-home-banners-entry.js on lines 46..49
            legacy/src/c/admin-home-banners-entry.js on lines 53..56

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

            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

            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

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

                                    m(`input.text-field.w-input[type="text"][id="link${entry_id_suffix}"]`, {
                                        oninput: (event) => link(event.target.value),
                                        value: link()
                                    }),
                Severity: Major
                Found in legacy/src/c/admin-home-banners-entry.js and 4 other locations - About 30 mins to fix
                legacy/src/c/admin-home-banners-entry.js on lines 25..28
                legacy/src/c/admin-home-banners-entry.js on lines 32..35
                legacy/src/c/admin-home-banners-entry.js on lines 46..49
                legacy/src/c/admin-home-banners-entry.js on lines 53..56

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

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

                const updateProject = (project_id) => {
                    const projectData = {
                        video_url: fields.video_url()
                    };
                
                
                Severity: Major
                Found in legacy/src/vms/project-video-vm.js and 3 other locations - About 30 mins to fix
                legacy/src/vms/project-budget-vm.js on lines 16..22
                legacy/src/vms/project-card-vm.js on lines 65..71
                legacy/src/vms/project-description-vm.js on lines 17..23

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

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

                const updateProject = (project_id) => {
                    const projectData = {
                        about_html: fields.about_html()
                    };
                
                
                Severity: Major
                Found in legacy/src/vms/project-description-vm.js and 3 other locations - About 30 mins to fix
                legacy/src/vms/project-budget-vm.js on lines 16..22
                legacy/src/vms/project-card-vm.js on lines 65..71
                legacy/src/vms/project-video-vm.js on lines 16..22

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

                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

                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

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

                          it('should set the submission error flag to true when parameter is true', () => {
                              e.submissionError(true);
                              expect(e.hasSubmissionError()).toBeTrue();
                          });
                  Severity: Minor
                  Found in legacy/spec/helpers/error.spec.js and 2 other locations - About 30 mins to fix
                  legacy/spec/helpers/error.spec.js on lines 89..92
                  legacy/spec/helpers/error.spec.js on lines 93..96

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

                  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

                  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

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

                      const updateProject = (project_id) => {
                          const projectData = {
                              headline: fields.headline()
                          };
                      
                      
                      Severity: Major
                      Found in legacy/src/vms/project-card-vm.js and 3 other locations - About 30 mins to fix
                      legacy/src/vms/project-budget-vm.js on lines 16..22
                      legacy/src/vms/project-description-vm.js on lines 17..23
                      legacy/src/vms/project-video-vm.js on lines 16..22

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

                      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