catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function(vnode) {
        const vm = projectGoalVM,
            mapErrors = [
                  ['mode', ['mode']],
                  ['goal', ['goal']],
Severity: Minor
Found in legacy/src/c/project-goal-edit.js - About 1 hr to fix

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

        view({state} : m.Vnode<HeaderMenuSearchAttrs, HeaderMenuSearchState>) {
            
            const searchParam = state.searchParam
    
            return m('span#menu-search', [
    Severity: Minor
    Found in legacy/src/c/header-menu-search.ts - About 1 hr to fix

      Function AjaxEventBus has 45 lines of code (exceeds 25 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 1 hr to fix

        Function ParamParser has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function ParamParser() {
            var defaults = [
              {
                test: function(xhr) {
                  return (/^application\/json/).test(xhr.contentType());
        Severity: Minor
        Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

          Function createBasicPaginationVMWithAutoRedraw has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              createBasicPaginationVMWithAutoRedraw = vmInstance => {
                  const error = prop(false);
                  const errorMessage = prop('');
          
                  return {
          Severity: Minor
          Found in legacy/src/h.ts - About 1 hr to fix

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

                oninit: function(vnode) {
                    const {
                        ViewContentEvent,
                        PurchaseEvent
                    } = projectVM;
            Severity: Minor
            Found in legacy/src/root/thank-you.js - About 1 hr to fix

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

                  oninit: function(vnode) {
                      const project = vnode.attrs.project,
                          animateProgress = localVnode => {
                              let animation,
                                  progress = 0,
              Severity: Minor
              Found in legacy/src/c/project-sidebar.js - About 1 hr to fix

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

                    oninit: function (vnode) {
                
                        const explitInArraysOf3 = (collection) => {
                            const array = [];
                            let partArray = []; 
                Severity: Minor
                Found in legacy/src/c/user-balance-withdraw-history.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function({state}) {
                
                        const project = _.first(state.projectDetails());
                        const canBeCreated = reward => !reward.survey_sent_at && ((reward.maximum_contributions && (reward.paid_count >= reward.maximum_contributions)) || project.state !== 'online');
                        const cannotBeCreated = reward => !reward.survey_sent_at && project.state === 'online' && (!reward.maximum_contributions || (reward.paid_count < reward.maximum_contributions));
                Severity: Minor
                Found in legacy/src/root/surveys.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function({state, attrs}) {
                        
                        const user = state.user();
                
                        if (user) {
                Severity: Minor
                Found in legacy/src/root/check-email.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function ({ state, attrs }) {
                        const fields = attrs.fields;
                        const userBankAccount = state.userBankAccount();
                        
                        return m('div', [
                Severity: Minor
                Found in legacy/src/c/user-bank-form.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function({attrs}) {
                        const project = attrs.project() || {},
                            onlineDays = () => {
                                const diff = moment(project.zone_online_date).diff(moment(project.zone_expires_at)),
                                    duration = moment.duration(diff);
                Severity: Minor
                Found in legacy/src/c/project-about.js - About 1 hr 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 selectReward has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                const selectReward = reward => () => {
                    if (selectedReward() !== reward) {
                        error('');
                        selectedReward(reward);
                        if (reward.id) {
                Severity: Minor
                Found in legacy/src/vms/reward-vm.js - About 1 hr 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 runFunctionsWithinRange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
                  var scheduledFunc;
                  var funcsToRun = [];
                  for (var timeoutKey in this.scheduledFunctions) {
                    scheduledFunc = this.scheduledFunctions[timeoutKey];
                Severity: Minor
                Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr 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 equals_ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
                  mismatchKeys = mismatchKeys || [];
                  mismatchValues = mismatchValues || [];
                
                  for (var i = 0; i < this.equalityTesters_.length; i++) {
                Severity: Minor
                Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    view: function({attrs}) {
                        const project = attrs.project(),
                            mode = project.mode,
                            modeImgSrc = (mode === 'aon')
                                ? '/assets/aon-badge.png'
                Severity: Minor
                Found in legacy/src/c/project-mode.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    oninit({ state, attrs} : m.Vnode<InputPermalinkAttrs, InputPermalinkState>) {
                        state.class = attrs.class
                        state.currentPermalink = attrs.currentPermalink
                        state.checkPermalinkAvailable = async (inputText) => {
                            let lastValidValue = state.currentPermalink
                Severity: Minor
                Found in legacy/src/c/projects/publish-by-steps/input-permalink.tsx - About 1 hr 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 updateUserData has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            updateUserData = () => {
                                const userData = {
                                    cpf: fields().owner_document(),
                                    name: fields().name(),
                                    address_attributes: addVM().getFields(),
                Severity: Minor
                Found in legacy/src/c/user-settings.js - About 1 hr to fix

                  Function next_ has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jasmine.Queue.prototype.next_ = function() {
                    var self = this;
                    var goAgain = true;
                  
                    while (goAgain) {
                  Severity: Minor
                  Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                        oninit: function(vnode) {
                            let interval;
                            const selectedSlideIdx = prop(0),
                                translationSize = prop(1600),
                                sliderTime = vnode.attrs.sliderTime || 6500,
                    Severity: Minor
                    Found in legacy/src/c/slider.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language