catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

File jasmine.js has 1511 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
 *
 * @namespace
 */
Severity: Major
Found in legacy/spec/lib/jasmine/jasmine.js - About 4 days to fix

    File h.ts has 1299 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import _ from 'underscore';
    import moment from 'moment';
    import * as Sentry from '@sentry/browser';
    import m from 'mithril';
    import prop from 'mithril/stream';
    Severity: Major
    Found in legacy/src/h.ts - About 3 days to fix

      Function CatarseAnalytics has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
      Open

      window.CatarseAnalytics = window.CatarseAnalytics || (function(){
          /*!
         * cookie-monster - a simple cookie library
         * v0.3.0
         * https://github.com/jgallen23/cookie-monster
      Severity: Minor
      Found in legacy/spec/lib/analytics.js - About 3 days 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 AjaxFakeRequest has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
      Open

      getJasmineRequireObj().AjaxFakeRequest = function(eventBusFactory) {
        function extend(destination, source, propertiesToSkip) {
          propertiesToSkip = propertiesToSkip || [];
          for (var property in source) {
            if (!arrayContains(propertiesToSkip, property)) {
      Severity: Minor
      Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 2 days 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 paymentVM has 372 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const paymentVM = () => {
          const pagarme = prop({}),
              defaultCountryID = addressVM.defaultCountryID,
              submissionError = prop(false),
              isLoading = prop(false);
      Severity: Major
      Found in legacy/src/vms/payment-vm.js - About 1 day to fix

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

            view: function({state}) {
                const user = state.user(),
                    project_id = state.project_id,
                    project = state.project(),
                    formatedValue = h.formatNumber(state.value, 2, 3),
        Severity: Minor
        Found in legacy/src/root/projects-subscription-checkout.js - About 1 day 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 80 (exceeds 5 allowed). Consider refactoring.
        Open

            view: function ({ state }) {
                const user = state.user(),
                    project = state.project(),
                    formatedValue = h.formatNumber(Number(state.value), 2, 3),
                    anonymousCheckbox = m('.w-row', [
        Severity: Minor
        Found in legacy/src/root/projects-payment.js - About 1 day 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 71 (exceeds 5 allowed). Consider refactoring.
        Open

            view: function({state, attrs}) {
                const project = attrs.project(),
                    projectRoute = `/projects/${project.project_id}`,
                    editRoute = `${projectRoute}/edit`,
                    editLinkClass = hash => `dashboard-nav-link-left ${project.is_published ? 'indent' : ''} ${h.hashMatch(hash) ? 'selected' : ''}`;
        Severity: Minor
        Found in legacy/src/c/project-dashboard-menu.js - About 1 day 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 280 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            oninit: function(vnode) {
                const listVM = balanceTransferListVM,
                    filterVM = balanceTransferFilterVM(),
                    authorizedListVM = balanceTransferListVM,
                    authorizedFilterVM = balanceTransferFilterVM(),
        Severity: Major
        Found in legacy/src/root/admin-balance-tranfers.js - About 1 day to fix

          Function CatarseAnalytics has 263 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          window.CatarseAnalytics = window.CatarseAnalytics || (function(){
              /*!
             * cookie-monster - a simple cookie library
             * v0.3.0
             * https://github.com/jgallen23/cookie-monster
          Severity: Major
          Found in legacy/spec/lib/analytics.js - About 1 day to fix

            Function AjaxFakeRequest has 257 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            getJasmineRequireObj().AjaxFakeRequest = function(eventBusFactory) {
              function extend(destination, source, propertiesToSkip) {
                propertiesToSkip = propertiesToSkip || [];
                for (var property in source) {
                  if (!arrayContains(propertiesToSkip, property)) {
            Severity: Major
            Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 day to fix

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

                  oninit: function (vnode) {
                      const filterVM = projectsSubscriptionReportVM,
                          catarseVM = projectsContributionReportVM,
                          dropdownNumber = prop(0),
                          error = prop(false),
              Severity: Major
              Found in legacy/src/root/projects-subscription-report.js - About 1 day to fix

                File mock-ajax.js has 579 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*
                
                Jasmine-Ajax - v3.1.1: a set of helpers for testing AJAX requests under the Jasmine
                BDD framework for JavaScript.
                
                
                Severity: Major
                Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 day to fix

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

                      oninit: function(vnode) {
                          let listVM = contributionListVM,
                              filterVM = contributionFilterVM,
                              error = prop(''),
                              filterBuilder = [{ // full_text_index
                  Severity: Major
                  Found in legacy/src/root/admin-contributions.js - About 1 day to fix

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

                        oninit: function(vnode) {
                            const listVM = projectContributionsListVM(),
                                filterVM = projectsContributionReportVM,
                                project = prop([{}]),
                                rewards = prop([]),
                    Severity: Major
                    Found in legacy/src/root/projects-contribution-report.js - About 1 day to fix

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

                          oninit: function(vnode) {
                              const project = projectVM.getCurrentProject(),
                                  reward = vnode.attrs.reward(),
                                  imageFileToUpload = prop(null),
                                  minimumValue = projectVM.isSubscription(project) ? 5 : 10,
                      Severity: Major
                      Found in legacy/src/c/edit-reward-card.js - About 1 day to fix

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

                            view: function({state, attrs}) {
                                const project = attrs.project,
                                    isSolidarityProject = state.isSolidarityProject,
                                    buildTooltip = el => m(tooltip, {
                                        el,
                        Severity: Minor
                        Found in legacy/src/c/project-insights.js - About 1 day 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 userInteraction has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                        Open

                            userInteraction(attrs) {
                                const {
                                    subscription,
                                    displayCancelModal,
                                    isGeneratingSecondSlip,
                        Severity: Minor
                        Found in legacy/src/c/user-subscription-box-control.js - About 1 day 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 i18n.js has 536 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // I18n.js
                        // =======
                        //
                        // This small library provides the Rails I18n API on the Javascript.
                        // You don't actually have to use Rails (or even Ruby) to use I18n.js.
                        Severity: Major
                        Found in legacy/spec/lib/i18n/i18n.js - About 1 day to fix

                          File user-about-edit.js has 531 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 userVM from '../vms/user-vm';
                          Severity: Major
                          Found in legacy/src/c/user-about-edit.js - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language