catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function(vnode) {
        const contributedProjects = prop(),
            latestProjects = prop([]),
            userDetails = prop({}),
            user_id = vnode.attrs.user.user_id,
Severity: Minor
Found in legacy/src/c/menu-profile.js - About 1 hr to fix

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

        oninit: function(vnode) {
            const resource = _.first(vnode.attrs.collection()),
                limitDataset = vnode.attrs.limitDataset,
                source = !_.isUndefined(resource)
                    ? _.isNumber(limitDataset)
    Severity: Minor
    Found in legacy/src/c/project-data-chart.js - About 1 hr to fix

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

          oninit: function(vnode) {
              const user_id = vnode.attrs.userId,
                  showDraft = vnode.attrs.showDraft || false,
                  error = prop(false);
      
      
      Severity: Minor
      Found in legacy/src/c/user-created.js - About 1 hr to fix

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

            oninit: function(vnode) {
                const userFriendVM = catarse.filtersVM({ user_id: 'eq' }),
                    user = vnode.attrs.user,
                    friendListVM = getFriendsListVM(),
                    allLoading = prop(false),
        Severity: Minor
        Found in legacy/src/c/user-friends.js - About 1 hr to fix

          Function renderNode has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            return function renderNode(parent, node, treePath) {
              if (!node) {
                return ''
              }
              if (isArray(node)) {
          Severity: Minor
          Found in legacy/spec/lib/mithril-query/mithril-query.js - About 1 hr to fix

            Function closeModal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                closeModal = () => {
                    // Temp for rails unstyled close links
                    const close = (elm, selector) => {
                        const all = document.getElementsByClassName(selector);
                        let cur = elm.parentNode;
            Severity: Minor
            Found in legacy/src/h.ts - About 1 hr to fix

              Function submitNotes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          submitNotes = () => {
                              loadingNotes(true);
                              m.request({
                                  method: 'PUT',
                                  url: `/admin/balance_transfers/${vnode.attrs.item.id}`,
              Severity: Minor
              Found in legacy/src/c/admin-balance-transfer-item-detail.js - About 1 hr to fix

                Function saveGoal has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        const saveGoal = () => {
                            validate();
                            if (vnode.attrs.error()) {
                                return false;
                            }
                Severity: Minor
                Found in legacy/src/c/project-goal-edit-card.js - About 1 hr to fix

                  Function submitInvite has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              submitInvite = () => {
                                  if (_.isEmpty(emailText()) || loading() === true) {
                                  } else {
                                      loading(true);
                                      const emailList = _.reduce(emailText().split('\n'), (memo, text) => {
                  Severity: Minor
                  Found in legacy/src/c/project-email-invite.js - About 1 hr to fix

                    Function execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jasmine.WaitsForBlock.prototype.execute = function(onComplete) {
                      this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen'));
                      var latchFunctionResult;
                      try {
                        latchFunctionResult = this.latchFunction.apply(this.spec);
                    Severity: Minor
                    Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                          oninit({ attrs, state } : m.Vnode<InputFindLocationAttrs, InputFindLocationState>) {
                      
                              if (attrs.city_id) {
                                  getCityById(attrs.city_id).then(city => {
                                      state.selectedCity = city
                      Severity: Minor
                      Found in legacy/src/c/std/input-find-location.tsx - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                            if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) {
                              return ["Expected function " + not + "to throw", expected ? expected.message || expected : " an exception", ", but it threw", exception.message || exception].join(' ');
                            } else {
                              return "Expected function to throw an exception.";
                            }
                        Severity: Major
                        Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if(project&&(project.id||project.project_id)) {
                                    data.project={
                                      id: project.id||project.project_id,
                                      user_id: project.user_id||project.project_user_id,
                                      category_id: project.category_id,
                          Severity: Major
                          Found in legacy/spec/lib/analytics.js - About 1 hr to fix

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

                                oninit: function(vnode) {
                                    const listVM = projectContributionsListVM(),
                                        filterVM = projectsContributionReportVM,
                                        project = prop([{}]),
                                        rewards = prop([]),
                            Severity: Minor
                            Found in legacy/src/root/projects-contribution-report.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                view: function({ state }) {
                                    const user = state.userDetails();
                                    return state.error()
                                        ? m(inlineError, { message: 'Erro ao carregar dados.' })
                                        : state.loader()
                            Severity: Minor
                            Found in legacy/src/c/user-about.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                view: function({state, attrs}) {
                                    const project = _.first(state.projectDetails()) || {
                                            user: {
                                                name: 'Realizador'
                                            }
                            Severity: Minor
                            Found in legacy/src/root/insights.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                oninit: function(vnode) {
                                    const contributionsPerDay = prop([]),
                                        listVM = projectVM.isSubscription(vnode.attrs.project()) ? getProjectSubscribersListVM() : getProjectContributorsListVM(),
                                        filterStats = catarse.filtersVM({
                                            project_id: 'eq'
                            Severity: Minor
                            Found in legacy/src/c/project-contributions.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                oninit: function(vnode) {
                                    let parsedErrors = userSettingsVM.mapRailsErrors(railsErrorsVM.railsErrors());
                                    let deleteFormSubmit;
                                    const user = vnode.attrs.user();
                                    const userAddress = user.address || {};
                            Severity: Minor
                            Found in legacy/src/c/user-settings.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                view: function({state, attrs}) {
                                    const mainClass = (attrs.type === 'button') ? '' : '.u-text-center.u-marginbottom-30',
                                        buttonClass = (attrs.type === 'button') ? 'w-button btn btn-terciary btn-no-border' : 'btn-link link-hidden fontsize-large',
                                        hideTextOnMobile = attrs.hideTextOnMobile || false,
                                        project = attrs.project,
                            Severity: Minor
                            Found in legacy/src/c/project-reminder.js - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                view: function({ state, attrs }) {
                                    const projects_collection = state.projects.collection();
                                    const isLoadingProjects = state.projects.isLoading();
                                    const hasError = state.error();
                            
                            
                            Severity: Minor
                            Found in legacy/src/c/user-created.js - About 55 mins 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