catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    view({attrs}) {

        /** @type {Report} */
        const {
            id,
Severity: Major
Found in legacy/src/c/project-subscription-report-download-entry.js - About 2 hrs to fix

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

        oninit: function(vnode) {
            const project = vnode.attrs.project(),
                showDetail = h.toggleProp(false, true),
                currentTab = prop('info'),
                checked = contribution => _.contains(vnode.attrs.selectedContributions(), contribution.id),
    Severity: Major
    Found in legacy/src/c/project-contribution-report-content-card.js - About 2 hrs to fix

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

          oninit: function(vnode) {
              let l;
              const loadReward = () => {
                  const model = models.rewardDetail,
                      reward_id = vnode.attrs.item.reward_id,
      Severity: Major
      Found in legacy/src/c/admin-contribution-detail.js - About 2 hrs to fix

        Function getUserRecommendedProjects has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const getUserRecommendedProjects = contribution => {
            const sample3 = _.partial(_.sample, _, 3),
                loaders = prop([]),
                collection = prop([]),
                { user_id } = h.getUser();
        Severity: Major
        Found in legacy/src/vms/user-vm.js - About 2 hrs to fix

          File reward-vm.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { catarse, commonProject } from '../api';
          import _ from 'underscore';
          import m from 'mithril';
          import prop from 'mithril/stream';
          import models from '../models';
          Severity: Minor
          Found in legacy/src/vms/reward-vm.js - About 2 hrs to fix

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

            /*
             * Copyright © 2013 Jamie Mason, @fold_left,
             * https://github.com/JamieMason
             *
             * Permission is hereby granted, free of charge, to any person
            Severity: Minor
            Found in legacy/spec/lib/jasmine-matchers.js - About 2 hrs to fix

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

                  oninit: function (vnode) {
                      const documentMask = _.partial(h.mask, '999.999.999-99');
                      const documentCompanyMask = _.partial(h.mask, '99.999.999/9999-99');
              
                      const cardStatusClassMap = {
              Severity: Major
              Found in legacy/src/c/user-balance-withdraw-history-item-request.js - About 2 hrs to fix

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

                    oninit: function(vnode) {
                        const EXPERIMENT_CASE_CURRENT = 'EXPERIMENT_CASE_CURRENT',
                            EXPERIMENT_CASE_6SUBHOM = 'EXPERIMENT_CASE_6SUBHOM',
                            EXPERIMENT_CASE_3SUBHOM = 'EXPERIMENT_CASE_3SUBHOM';
                
                
                Severity: Major
                Found in legacy/src/c/projects-display.js - About 2 hrs to fix

                  Function AjaxRequestStub has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  getJasmineRequireObj().AjaxRequestStub = function() {
                    var RETURN = 0,
                        ERROR = 1,
                        TIMEOUT = 2;
                  
                  
                  Severity: Major
                  Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 2 hrs to fix

                    Function generateErrorInstance has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const generateErrorInstance = () => {
                        const fields = prop([]);
                        const submissionError = prop(false);
                        const submissionErrorMsg = prop('');
                        const fieldIdxValue = (fieldName, idx, initialValue) => _.reduce(fields(), (memo, field) => field[0] === fieldName ? field[idx] : memo, initialValue);
                    Severity: Minor
                    Found in legacy/src/error.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 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        view: function({state, attrs}) {
                            const list = state.listVM,
                                stats = projectVM.isSubscription(attrs.project()) ? attrs.subscriptionData() : state.contributionsStats(),
                                groupedCollection = state.groupedCollection(list.collection());
                    
                    
                    Severity: Minor
                    Found in legacy/src/c/project-contributions.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 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        view: function({ state, attrs }) {
                            const user = attrs.user,
                                reminders = state.projectReminders(),
                                projects_collection = (state.contributedProjects() || []).concat(
                                    state.subscribedProjects() || []
                    Severity: Minor
                    Found in legacy/src/c/user-notifications.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 AjaxEventBus has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                    getJasmineRequireObj().AjaxEventBus = function(eventFactory) {
                      function EventBus(source) {
                        this.eventList = {};
                        this.source = source;
                      }
                    Severity: Minor
                    Found in legacy/spec/lib/jasmine-ajax/mock-ajax.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 renderComponents has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function renderComponents(states, onremovers) {
                      function renderComponent(component, treePath) {
                        if (isFunction(component.tag)) {
                          component.instance = component.tag(component)
                        } else if (isClass(component.tag)) {
                    Severity: Major
                    Found in legacy/spec/lib/mithril-query/mithril-query.js - About 2 hrs to fix

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

                          view({ attrs }) {
                              return (
                                  <div class="section">
                                      <div class="w-container">
                                          <div class="w-row">
                      Severity: Major
                      Found in legacy/src/root/projects/publish-by-steps/todo.tsx - About 2 hrs to fix

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

                            view({ attrs: { goalDetails: goalsDetails, subscriptionData, style }, state } : m.Vnode<ProjectGoalsBoxAttrs, ProjectGoalsBoxState>) {
                        
                                const goalsDetailsOrEmpty = () : GoalDetails[] => {
                                    const hasGoalsDetails = goalsDetails() && goalsDetails().length > 0
                                    if (hasGoalsDetails) {
                        Severity: Major
                        Found in legacy/src/c/project-goals-box.tsx - About 2 hrs to fix

                          File user-bank-form.js has 266 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';
                          
                          
                          Severity: Minor
                          Found in legacy/src/c/user-bank-form.js - About 2 hrs to fix

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

                            import m from 'mithril';
                            import prop from 'mithril/stream';
                            import moment, { min } from 'moment';
                            import _ from 'underscore';
                            import { catarse, catarseMoments, commonAnalytics } from '../api';
                            Severity: Minor
                            Found in legacy/src/c/project-insights-sub.js - About 2 hrs to fix

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

                                  oninit(/** @type {VNode} */vnode) {
                                       
                                      /**
                                       * @param {string} name
                                       * @param {ProjectIntegration[]} integrations
                              Severity: Major
                              Found in legacy/src/root/project-edit-integrations.js - About 2 hrs to fix

                                File analytics.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                //evitamos criar duas vezes...
                                //tem q ser não dependente de outros codigos
                                window.CatarseAnalytics = window.CatarseAnalytics || (function(){
                                    /*!
                                   * cookie-monster - a simple cookie library
                                Severity: Minor
                                Found in legacy/spec/lib/analytics.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language