catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    view({ state, attrs }) {

        const GATrackingID = state.GATrackingID;
        const FBPixelTrackingID = state.FBPixelTrackingID;
        const save = state.save;
Severity: Major
Found in legacy/src/root/project-edit-integrations.js - About 2 hrs to fix

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

        oninit: function(vnode) {
            const storeKey = 'selectedReward',
                MINIMUM_VALUE = 10,
                reward = vnode.attrs.reward,
                vm = rewardVM,
    Severity: Major
    Found in legacy/src/c/project-reward-card.js - About 2 hrs to fix

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

          oninit: function(vnode) {
              const MINIMUM_VALUE = 10;
              const queryRewardValue = h.getParams('value');
              const setInput = localVnode => localVnode.dom.focus();
              const isSelected = currentReward => (currentReward.id == null && !rewardVM.selectedReward() && queryRewardValue) || (rewardVM.selectedReward() && currentReward.id === rewardVM.selectedReward().id);
      Severity: Major
      Found in legacy/src/c/reward-select-card.js - About 2 hrs to fix

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

            view: function({ state, attrs }) {
        
                if (state.parsedErrors) {
                    const parsedErrors = state.parsedErrors;
                    state.fields.errors = {
        Severity: Minor
        Found in legacy/src/c/address-form.js - About 2 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
        Open

            oninit: function(vnode) {
                let parsedErrors = userAboutVM.mapRailsErrors(railsErrorsVM.railsErrors());
                let deleteUser;
                const user = vnode.attrs.user || {},
                    fields = {
        Severity: Minor
        Found in legacy/src/c/user-about-edit.js - About 2 hrs 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 availableAction has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                const availableAction = (reward) => {
                    if (canBeCreated(reward)) {
                        return m('.w-col.w-col-3.w-col-small-small-stack.w-col-tiny-tiny-stack',
                            m('a.btn.btn-small.w-button', {
                                onclick: () => m.route.set(`/projects/${state.project_id}/rewards/${reward.id}/surveys/new`)
        Severity: Major
        Found in legacy/src/root/surveys.js - About 2 hrs to fix

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

              oninit: function(vnode) {
                  const project = vnode.attrs.project,
                      progress = project.progress.toFixed(2),
                      remainingTextObj = h.translatedTime(project.remaining_time),
                      elapsedTextObj = h.translatedTime(project.elapsed_time),
          Severity: Major
          Found in legacy/src/c/project-card.js - About 2 hrs to fix

            File project-report-infringes-intellectual-property.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * window.c.projectReportInfringesIntellectulaProperty component
             * Render project report form
             *
             */
            Severity: Minor
            Found in legacy/src/c/project-report-infringes-intellectual-property.js - About 2 hrs to fix

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

                  oninit: function(vnode) {
                      const userBankAccount = prop(null),
                          showPopNotification = prop(false),
                          popNotificationAttributes = prop({}),
                          metadata = vnode.attrs.item.last_transition_metadata || { transfer_data: {} },
              Severity: Major
              Found in legacy/src/c/admin-balance-transfer-item-detail.js - About 2 hrs to fix

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

                    view: function({state, attrs}) {
                        const vm = state.vm;
                        const serviceFee = (vm.fields.service_fee() * 100).toFixed(2).replace(/(\.|,)?0+$/g, '');
                        
                        return m('#goal-tab', [
                Severity: Minor
                Found in legacy/src/c/project-goal-edit.js - About 2 hrs 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 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    oninit({ attrs, state }: m.Vnode<RewardsEditListAttrs, RewardsEditListState>) {
                        const rewards = prop<StreamType<RewardDetailsStream>[]>([])
                        const loading = attrs.loading
                        const error = attrs.error
                        const errors = attrs.errors
                Severity: Minor
                Found in legacy/src/c/projects/edit/rewards-edit-list.tsx - About 2 hrs 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 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    oninit: function(vnode) {
                        const contributionsPerDay = prop([]),
                            listVM = projectVM.isSubscription(vnode.attrs.project()) ? getProjectSubscribersListVM() : getProjectContributorsListVM(),
                            filterStats = catarse.filtersVM({
                                project_id: 'eq'
                Severity: Major
                Found in legacy/src/c/project-contributions.js - About 2 hrs to fix

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

                      oninit: function(vnode) {
                          const {
                              ViewContentEvent,
                          } = projectVM;
                          
                  Severity: Major
                  Found in legacy/src/root/projects-show.js - About 2 hrs to fix

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

                        oninit: function(vnode) {
                            const payment = vnode.attrs.item;
                            let card = null,
                                displayPaymentMethod,
                                paymentMethodClass,
                    Severity: Major
                    Found in legacy/src/c/payment-status.js - About 2 hrs to fix

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

                          oninit: function(vnode) {
                              const rewards = prop([]),
                                  currentRewardId = prop(),
                                  currentReward = prop(),
                                  showSuccess = prop(false),
                      Severity: Major
                      Found in legacy/src/root/project-edit-welcome.js - About 2 hrs to fix

                        Function _event has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function _event(eventObj, fn, ignoreGA) {
                            if (eventObj) {
                              try {
                                var project = eventObj.project||_getProject(),
                                    user = eventObj.user||_getUser();
                        Severity: Major
                        Found in legacy/spec/lib/analytics.js - About 2 hrs to fix

                          Function oninit has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                              oninit: function (vnode) {
                                  
                                  const {
                                      ViewContentEvent,
                                      AddToCartEvent
                          Severity: Minor
                          Found in legacy/src/root/projects-payment.js - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                              view: function({attrs}) {
                                  const collection = attrs.collection,
                                      title = attrs.title || collection.title,
                                      ref = attrs.ref,
                                      showFriends = attrs.showFriends,
                          Severity: Minor
                          Found in legacy/src/c/project-row.js - About 2 hrs 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 compareObjects_ has a Cognitive Complexity of 19 (exceeds 5 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 2 hrs 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 format has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                          jasmine.PrettyPrinter.prototype.format = function(value) {
                            if (this.ppNestLevel_ > 40) {
                              throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
                            }
                          
                          
                          Severity: Minor
                          Found in legacy/spec/lib/jasmine/jasmine.js - About 2 hrs 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