catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Function origin has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var origin = (function(request,cookie) {
      try {
        var o = JSON.parse(cookie.get('ctrse_origin')||null) || {createdAt: new Date()};
      } catch(e) {
        o = {createdAt: new Date()};
Severity: Minor
Found in legacy/spec/lib/analytics.js - About 1 hr to fix

    Function parseDate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      I18n.parseDate = function(date) {
        var matches, convertedDate, fraction;
        // we have a date, so just return it.
        if (typeof(date) == "object") {
          return date;
    Severity: Minor
    Found in legacy/spec/lib/i18n/i18n.js - About 1 hr to fix

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

      jasmine.reporting.StyledHtmlReporter.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-species/jasmine-reporting.js - About 1 hr to fix

        Function WhenChangeNationality has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function WhenChangeNationality(user : UserDetails, states: prop<State[]>) : UserAddress {
            const defaultCountryID = 36 // Brasil
            const isInternational = Number(user.address.country_id) !== defaultCountryID
        
            if (!_.isEmpty(states()) && !isInternational) {
        Severity: Minor
        Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 1 hr to fix

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

              view: function({state, attrs}) {
                  const payments = state.payments(),
                      transitions = state.transitions(),
                      notifications = state.notifications(),
                      reward = state.reward(),
          Severity: Minor
          Found in legacy/src/c/admin-subscription-detail.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 11 (exceeds 5 allowed). Consider refactoring.
          Open

              view: function({state, attrs}) {
                  const bankAccount = (_.isUndefined(state.metaBank) ? state.userBankAccount() : state.transitionBankAccount());
          
                  return m('#admin-balance-transfer-item-detail-box', [
                      m('.divider.u-margintop-20.u-marginbottom-20'),
          Severity: Minor
          Found in legacy/src/c/admin-balance-transfer-item-detail.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 safeVal has a Cognitive Complexity of 11 (exceeds 5 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

          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 createDom has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
            var el = document.createElement(type);
          
            for (var i = 2; i < arguments.length; i++) {
              var child = arguments[i];
          Severity: Minor
          Found in legacy/spec/lib/jasmine/jasmine-html.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 reportSpecResults has a Cognitive Complexity of 11 (exceeds 5 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

          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 11 (exceeds 5 allowed). Consider refactoring.
          Open

              oninit: function(vnode) {
                  const vm = vnode.attrs.vm,
                      isSubscriptionEdit = vnode.attrs.isSubscriptionEdit || prop(false),
                      slipPaymentDate = projectVM.isSubscription() ? null : vm.getSlipPaymentDate(vnode.attrs.contribution_id),
                      loading = prop(false),
          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

          Function validateCardExpiry has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          const validateCardExpiry = function (month, year) {
              let currentTime,
                  expiry,
                  ref;
              if (typeof month === 'object' && 'month' in month) {
          Severity: Minor
          Found in legacy/src/vms/credit-card-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 oninit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              oninit: function(vnode) {
                  const displayForm = h.toggleProp(false, true),
                      displayFormWithName = prop(''),
                      sendSuccess = prop(false),
                      submitDisabled = prop(false),
          Severity: Minor
          Found in legacy/src/c/project-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 trySaveUserAttributesAndValidatePublishProject has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private async trySaveUserAttributesAndValidatePublishProject(userAttributes : any) {
                  const saveRequestConfig = {
                      method: 'PUT',
                      url: `/users/${this.user_id}.json`,
                      data: {
          Severity: Minor
          Found in legacy/src/vms/user-info-edit-vm.ts - 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 RedrawScheduler has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function RedrawScheduler() {
              let redrawsRequestCounter = 0;
              const markedCallStack = {};
              const requestAnimationFramePolyfill = (function() {
                  if (window.requestAnimationFrame !== undefined) {
          Severity: Minor
          Found in legacy/src/h.ts - 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 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              oninit: function(vnode) {
          
                  const {
                      ViewContentEvent,
                  } = projectVM;
          Severity: Minor
          Found in legacy/src/root/projects-contribution.js - About 1 hr to fix

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

                oninit: function(vnode) {
                    const stats = prop([]),
                        projects = prop([]),
                        l = prop(),
                        sample3 = _.partial(_.sample, _, 3),
            Severity: Minor
            Found in legacy/src/root/flex.js - About 1 hr to fix

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

                  view({ state, attrs }) {
              
                      /** @type {HomeVM} */
                      const vm = state.vm;
                      const banners = vm.banners;
              Severity: Minor
              Found in legacy/src/root/admin-home-banners.js - About 1 hr to fix

                Function sendAnswer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            sendAnswer = () => {
                                const data = {};
                                _.extend(data, {
                                    survey_address_answers_attributes: {
                                        addresses_attributes: addVM().getFields()
                Severity: Minor
                Found in legacy/src/root/surveys-show.js - About 1 hr to fix

                  Function stateClass has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              stateClass = (state) => {
                                  const classes = {
                                      online: {
                                          paid: 'text-success.fa-circle',
                                          refunded: 'text-error.fa-circle',
                  Severity: Minor
                  Found in legacy/src/c/project-contribution-report-content-card.js - About 1 hr to fix

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

                        oninit: function(vnode) {
                            let l = prop(false);
                            const deleteSuccess = prop(false),
                                confirmed = prop(true),
                                error = prop(''),
                    Severity: Minor
                    Found in legacy/src/c/delete-project-modal-content.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language