catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function(vnode) {
        const goal = vnode.attrs.goal(),
            project = vnode.attrs.project,
            descriptionError = prop(false),
            titleError = prop(false),
Severity: Major
Found in legacy/src/c/project-goal-edit-card.js - About 3 hrs to fix

    Function saveReward has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                saveReward = () => {
                    isSavingReward(true);
                    validate();
                    if (vnode.attrs.error()) {
                        isSavingReward(false);
    Severity: Major
    Found in legacy/src/c/edit-reward-card.js - About 3 hrs to fix

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

          oninit: function(vnode) {
              const contributedProjects = h.RedrawStream();
              const subscribedProjects = h.RedrawStream();
              const projectReminders = h.RedrawStream();
              const mailMarketingLists = h.RedrawStream();
      Severity: Major
      Found in legacy/src/c/user-notifications.js - About 3 hrs to fix

        File admin-project-detail.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import m from 'mithril';
        import prop from 'mithril/stream';
        import _ from 'underscore';
        import {
            catarse,
        Severity: Minor
        Found in legacy/src/c/admin-project-detail.js - About 3 hrs to fix

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

              view({ state, attrs }) {
          
                  const onSend = attrs.onSend;
                  const onClose = attrs.onClose;
                  const isSending = attrs.isSending();
          Severity: Major
          Found in legacy/src/c/select-subscription-reports.js - About 3 hrs to fix

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

                view: function({state, attrs}) {
                    const user = attrs.user || {},
                        fields = state.fields;
            
                    return m('#about-tab.content', [
            Severity: Minor
            Found in legacy/src/c/user-about-edit.js - About 3 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 23 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    const project = state.project();
                    const user = h.getUser();
                    const projectUser = state.projectUser();
            
            
            Severity: Minor
            Found in legacy/src/root/projects-subscription-thank-you.js - About 3 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 AjaxRequestStub has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            getJasmineRequireObj().AjaxRequestStub = function() {
              var RETURN = 0,
                  ERROR = 1,
                  TIMEOUT = 2;
            
            
            Severity: Minor
            Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 3 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

            File projects-contribution-report.js has 299 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import m from 'mithril';
            import prop from 'mithril/stream';
            import _ from 'underscore';
            import { catarse } from '../api';
            import models from '../models';
            Severity: Minor
            Found in legacy/src/root/projects-contribution-report.js - About 3 hrs to fix

              File project-insights.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import m from 'mithril';
              import prop from 'mithril/stream';
              import { catarse } from '../api';
              import _ from 'underscore';
              import h from '../h';
              Severity: Minor
              Found in legacy/src/c/project-insights.js - About 3 hrs to fix

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

                    view: function({state, attrs}) {
                        const vmIsLoading = attrs.vm.isLoading;
                        const newSubscription = attrs.attrs;
                        const oldSubscription = attrs.attrs.oldSubscription;
                
                
                Severity: Minor
                Found in legacy/src/c/subscription-edit-modal.js - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function ({ state, attrs }) {
                        const vm = state.vm;
                        
                        return m('#basics-tab', [
                            state.showSuccess()
                Severity: Minor
                Found in legacy/src/c/project-basics-edit.js - About 3 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 sendCreditCardPayment has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const sendCreditCardPayment = (selectedCreditCard, fields, commonData, addVM) => {
                
                    if (!fields) {
                        return false;
                    }
                Severity: Major
                Found in legacy/src/vms/common-payment-vm.js - About 3 hrs to fix

                  File admin-contributions.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import m from 'mithril';
                  import prop from 'mithril/stream';
                  import h from '../h';
                  import models from '../models';
                  import { catarse } from '../api';
                  Severity: Minor
                  Found in legacy/src/root/admin-contributions.js - About 3 hrs to fix

                    File surveys.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import m from 'mithril';
                    import prop from 'mithril/stream';
                    import { catarse } from '../api';
                    import _ from 'underscore';
                    import moment from 'moment';
                    Severity: Minor
                    Found in legacy/src/root/surveys.js - About 3 hrs to fix

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

                          oninit: function(vnode) {
                              const user_id = vnode.attrs.userId,
                                  userCommonId = vnode.attrs.user && vnode.attrs.user.common_id,
                                  subscriptions = getUserPrivateSubscriptionsListVM(userCommonId),
                                  onlinePages = contributionVM.getUserContributionsListWithFilter(),
                      Severity: Major
                      Found in legacy/src/c/user-private-contributed.js - About 3 hrs to fix

                        File user-info-edit-settings.tsx has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import m from 'mithril';
                        import prop from 'mithril/stream';
                        import _ from 'underscore';
                        import { StreamType } from '../../../@types/reward-details-stream';
                        import { UserDetails } from '../../../@types/user-details';
                        Severity: Minor
                        Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 3 hrs to fix

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

                              view({ state, attrs }) {
                                  const project_id = attrs.project_id;
                                  const user_id = attrs.user_id;
                                  const error = state.error;
                                  const errors = state.errors;
                          Severity: Major
                          Found in legacy/src/root/project-edit-reward.js - About 2 hrs to fix

                            File user-subscription-box.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import m from 'mithril';
                            import prop from 'mithril/stream';
                            import _ from 'underscore';
                            import h from '../h';
                            import moment from 'moment';
                            Severity: Minor
                            Found in legacy/src/c/user-subscription-box.js - About 2 hrs to fix

                              Function hasError has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          hasError: (field : string) => {
                                              switch(field) {
                                                  case 'address_zip_code': {
                                                      errors.addressZipCode(hasErrorOn(field))
                                                      break;
                              Severity: Major
                              Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language