catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function (vnode) {
        
        const {
            ViewContentEvent,
            AddToCartEvent
Severity: Major
Found in legacy/src/root/projects-payment.js - About 4 hrs to fix

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

        oninit: function(vnode) {
            const filtersVM = vnode.attrs.filtersVM,
                displayModal = h.toggleProp(false, true),
                contributionsPerDay = prop([]),
                visitorsTotal = prop(0),
    Severity: Major
    Found in legacy/src/c/project-insights.js - About 4 hrs to fix

      Function renderBody has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private renderBody({ projectPublishByStepsVM, userInfoEditVM, showPopError } : ProjectsPublishByStepsState) {
      
              if (projectPublishByStepsVM.isLoadingProject || userInfoEditVM.isLoading) {
                  return h.loader()
              } else {

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

            oninit: function(vnode) {
                const filtersVM = vnode.attrs.filtersVM,
                    displayModal = h.toggleProp(false, true),
                    contributionsPerDay = prop([]),
                    visitorsTotal = prop(0),
        Severity: Minor
        Found in legacy/src/c/project-insights.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 project-contribution-report-content-card.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Function displayTabContent has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  const displayTabContent = () => {
          
                      hash(window.location.hash);
                      const isUnpublishedAdmin = !project().is_published || project().is_admin_role;
                      const isEmptyHash = _.isEmpty(hash()) || hash() === '#_=_';
          Severity: Major
          Found in legacy/src/root/project-edit.js - About 3 hrs to fix

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

                oninit: function(vnode) {
                    let bankl;
                    const currentItem = prop(vnode.attrs.item);
                    const project_id = vnode.attrs.item.project_id;
                    const loadBank = () => {
            Severity: Major
            Found in legacy/src/c/admin-project-detail.js - About 3 hrs to fix

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

                  view: function({state, attrs}) {
                      const list = attrs.list;
                      const isFailed = attrs.project().state === 'failed';
              
                      return m('.w-section.bg-gray.before-footer.section', state.loading() ? h.loader() : [
              Severity: Minor
              Found in legacy/src/c/project-contribution-report-content.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 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const actions = state.actions,
                          item = state.currentItem(),
                          user = state.user(),
                          bankAccount = state.bankAccount(),
              Severity: Minor
              Found in legacy/src/c/admin-project-detail.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 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const project = _.first(state.projectDetails());
                      const acceptedIndex = state.acceptedIndex;
                      const account = _.first(state.projectAccount());
              
              
              Severity: Minor
              Found in legacy/src/root/publish.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 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  view: function({state, attrs}) {
                      const project = attrs.project,
                          subscribersDetails = attrs.subscribersDetails,
                          balanceData = (state.balanceData() && !_.isNull(_.first(state.balanceData())) ? _.first(state.balanceData()) : null);
                      
              Severity: Minor
              Found in legacy/src/c/project-insights-sub.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 oninit has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  oninit: function(vnode) {
                      const displayForm = h.toggleProp(false, true),
                          displayFormWithName = prop(''),
                          sendSuccess = prop(false),
                          submitDisabled = prop(false),
              Severity: Major
              Found in legacy/src/c/project-report.js - About 3 hrs to fix

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

                    oninit: function(vnode) {
                        const builder = vnode.attrs.data,
                            complete = prop(false),
                            data = {},
                            error = prop(false),
                Severity: Major
                Found in legacy/src/c/admin-radio-action.js - About 3 hrs to fix

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

                      view({ state, attrs }) {
                  
                          const onSearch = attrs.onSearch;
                          const onSelect = attrs.onSelect;
                          const isLoading = attrs.isLoading;
                  Severity: Major
                  Found in legacy/src/c/explore/explore-search-filter-select.js - About 3 hrs to fix

                    Function wrap has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function wrap(component, customAttr) {
                        if (!app) {
                            app = document.getElementById('application');
                        }
                    
                    
                    Severity: Major
                    Found in legacy/src/wrap.js - About 3 hrs to fix

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

                          view({attrs}) {
                              const onClose = attrs.onClose;
                              const categories = attrs.categories;
                              const closePreventRedirect = (/** @type {Event} */ event) => {
                                  event.preventDefault();
                      Severity: Major
                      Found in legacy/src/experiments/c/explore-light-box.js - About 3 hrs to fix

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

                            oninit: function(vnode) {
                                const {
                                    ViewContentEvent,
                                    AddToCartEvent
                                } = projectVM;
                        Severity: Minor
                        Found in legacy/src/root/projects-subscription-checkout.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 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            view: function({state, attrs}) {
                                const project = attrs.project,
                                    rewardDetails = attrs.rewardDetails,
                                    activeSubscriptions = _.filter(state.userProjectSubscriptions(), sub => sub.status === 'active'),
                                    sortedSubscriptions = _.sortBy(state.userProjectSubscriptions(), sub => _.indexOf(['active', 'started', 'canceling', 'inactive', 'canceled'], sub.status));
                        Severity: Minor
                        Found in legacy/src/c/project-header.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 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            view: function ({ attrs }) {
                                const disableInternational = attrs.disableInternational;
                                const countryName = attrs.countryName;
                                const fields = attrs.fields;
                                const international = attrs.international;
                        Severity: Minor
                        Found in legacy/src/c/address-form-national.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 oninit has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            oninit: function(vnode) {
                                const storeKey = 'selectedReward',
                                    MINIMUM_VALUE = 10,
                                    reward = vnode.attrs.reward,
                                    vm = rewardVM,
                        Severity: Minor
                        Found in legacy/src/c/project-reward-card.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

                        Severity
                        Category
                        Status
                        Source
                        Language