catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Function safeVal has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const safeVal = (value, $target, cardNumberProp) => {
    let currPair,
        cursor,
        digit,
        error,
Severity: Minor
Found in legacy/src/vms/credit-card-vm.js - About 1 hr to fix

    Function compareObjects_ has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) {
      if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) {
        return true;
      }
    
    
    Severity: Minor
    Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                          load = () => {
                              return models.balance
                                  .getRowWithToken(userIdVM.parameters())
                                  .then(collection)
                                  .then(_ => m.redraw());
      Severity: Major
      Found in legacy/src/c/user-balance-main.js and 1 other location - About 1 hr to fix
      legacy/spec/components/user-balance-request-modal-content.spec.js on lines 33..38

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

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

          validate = () => {
              const errorFields = prop([]);
      
              return {
                  submit(fields, fn) {
      Severity: Minor
      Found in legacy/src/h.ts - About 1 hr to fix

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

            view({ attrs, state } : m.Vnode<InputFindLocationAttrs, InputFindLocationState>) {
                const cities = state.cities
                const searchCities = state.searchCities
                const hasCitiesToDisplay = cities && cities.length > 0
                const onSelect = state.onSelect
        Severity: Minor
        Found in legacy/src/c/std/input-find-location.tsx - About 1 hr to fix

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

                                          m('.u-marginbottom-40.u-text-center-small-only', [
                                              m('.fontweight-semibold.lineheight-tight.fontsize-large',
                                                  window.I18n.t('title', state.scope())
                                              ),
                                              m('.fontsize-smaller',
          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 253..256

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

          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('.u-marginbottom-40.u-text-center-small-only', [
                                                      m('.fontweight-semibold.lineheight-tight.fontsize-large', window.I18n.t('title', state.scope())),
                                                      m('.fontsize-smaller', window.I18n.t('required', state.scope())),
                                                  ]),
          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 274..281

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

          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

                          const load = () => {
                              return models.balance
                                  .getRowWithToken(userIdVM.parameters())
                                  .then(collection)
                                  .then(_ => m.redraw());
          legacy/src/c/user-balance-main.js on lines 29..34

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

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

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

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

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

          Refactorings

          Further Reading

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

                                                  m('.u-text-center.u-margintop-30', [
                                                      m('.divider.u-marginbottom-20'),
                                                      m('.fontsize-base', window.I18n.t('want_more', I18nScope())),
                                                      m.trust(window.I18n.t('mode_diff_ebook', I18nScope()))
                                                  ])
          Severity: Major
          Found in legacy/src/c/project-goal-edit.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-goal-edit.js on lines 173..177

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

          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

          jasmine.Spec.prototype.waits = function(timeout) {
            var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this);
            this.addToQueue(waitsFunc);
            return this;
          };
          Severity: Major
          Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
          legacy/spec/lib/jasmine/jasmine.js on lines 1891..1895

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

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

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

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

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

          Refactorings

          Further Reading

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

                                                              m('.u-text-center.u-margintop-30', [
                                                                  m('.divider.u-marginbottom-20'),
                                                                  m('.fontsize-base', window.I18n.t('want_more', I18nScope())),
                                                                  m.trust(window.I18n.t('goal_taxes_watch_video_html', I18nScope()))
                                                              ])
          Severity: Major
          Found in legacy/src/c/project-goal-edit.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-goal-edit.js on lines 118..122

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

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

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

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

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

          Refactorings

          Further Reading

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

                                  m('div', [
                                      m('span.fontcolor-secondary', window.I18n.t('person.label', I18nScope())),
                                      window.I18n.t(`person.${projectAccount.user_type}.label`, I18nScope())
                                  ]),
          Severity: Major
          Found in legacy/src/c/project-successful-onboard-confirm-account.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-contribution-report-content-card.js on lines 259..264

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

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

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

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

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

          Refactorings

          Further Reading

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

                                                  m('.fontsize-smaller', [
                                                      m('span.fontweight-semibold',
                                                          window.I18n.t('delivery', I18nScope())
                                                      ),
                                                      window.I18n.t(`shipping_options.${reward.shipping_options}`, I18nScope())
          Severity: Major
          Found in legacy/src/c/project-contribution-report-content-card.js and 1 other location - About 1 hr to fix
          legacy/src/c/project-successful-onboard-confirm-account.js on lines 48..51

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

          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

          jasmine.Spec.prototype.runs = function (func) {
            var block = new jasmine.Block(this.env, func, this);
            this.addToQueue(block);
            return this;
          };
          Severity: Major
          Found in legacy/spec/lib/jasmine/jasmine.js and 1 other location - About 1 hr to fix
          legacy/spec/lib/jasmine/jasmine.js on lines 1924..1928

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

          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

                  const keysAndValues = reduceSearchString((finalQueryObject, keyValue) => {
                      const [key, value] = keyValue.split('=');
                      if (key) {
                          finalQueryObject[key] = value;
                      }
          Severity: Major
          Found in legacy/src/h.ts and 1 other location - About 1 hr to fix
          legacy/src/h.ts on lines 96..102

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

          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

                  const keysAndValues = reduceSearchString((finalQueryObject, keyValue) => {
                      const [key, value] = keyValue.split('=');
                      if (key) {
                          finalQueryObject[key] = value;
                      }
          Severity: Major
          Found in legacy/src/h.ts and 1 other location - About 1 hr to fix
          legacy/src/h.ts on lines 112..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 59.

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

                      sendNotification = (e) => {
                          e.preventDefault();
                          isLoading(true);
          
                          const notificationData = {
          Severity: Minor
          Found in legacy/src/c/posts-preview.js - About 1 hr to fix

            Function renderComponent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function renderComponent(component, treePath) {
                if (isFunction(component.tag)) {
                  component.instance = component.tag(component)
                } else if (isClass(component.tag)) {
                  const Component = component.tag
            Severity: Minor
            Found in legacy/spec/lib/mithril-query/mithril-query.js - About 1 hr to fix

              Function reportSpecResults has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
                var results = spec.results();
                var status = results.passed() ? 'passed' : 'failed';
                if (results.skipped) {
                  status = 'skipped';
              Severity: Minor
              Found in legacy/spec/lib/jasmine/jasmine-html.js - About 1 hr to fix

                Function checkPermalinkAvailable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        state.checkPermalinkAvailable = async (inputText) => {
                            let lastValidValue = state.currentPermalink
                            state.currentPermalink = inputText
                            try {
                                const projectBySlugRequestConfig = {
                Severity: Minor
                Found in legacy/src/c/projects/publish-by-steps/input-permalink.tsx - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language