catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function(vnode) {
        let builder = vnode.attrs.data,
            complete = prop(false),
            error = prop(false),
            fail = prop(false),
Severity: Minor
Found in legacy/src/c/admin-external-action.js - About 1 hr to fix

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

        view({ attrs } : m.Vnode<AskAboutRewardAttrs>) {
    
            const project = attrs.project
            const userName = attrs.project.user?.public_name
            const askTo = userName || project.name
    Severity: Minor
    Found in legacy/src/root/projects/publish-by-steps/ask-about-reward.tsx - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          if (eventObj) {
            try {
              var project = eventObj.project||_getProject(),
                  user = eventObj.user||_getUser();
              var ga = window.ga;//o ga tem q ser verificado aqui pq pode não existir na criaçaõ do DOM
      Severity: Critical
      Found in legacy/spec/lib/analytics.js - About 1 hr to fix

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

            oninit: function(vnode) {
                const togglePreview = () => {
                        h.scrollTop();
                        vnode.attrs.showPreview(false);
                    },
        Severity: Minor
        Found in legacy/src/c/posts-preview.js - About 1 hr to fix

          Function updateUser has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      updateUser = () => {
                          const userData = {
                              current_password: fields.current_password(),
                              password: fields.password(),
                              email: fields.email(),
          Severity: Minor
          Found in legacy/src/c/user-about-edit.js - About 1 hr to fix

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

                oninit: function (vnode) {
                    const
                        firstValue = prop(0),
                        secondValue = prop(0),
                        clearFieldValues = () => { firstValue(0), secondValue(0) },
            Severity: Minor
            Found in legacy/src/c/filter-dropdown-number-range.js - About 1 hr to fix

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

                  oninit: function(vnode) {
                      const builder = vnode.attrs.data,
                          complete = prop(false),
                          error = prop(false),
                          fail = prop(false),
              Severity: Minor
              Found in legacy/src/c/admin-input-action.js - About 1 hr to fix

                Function format has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                jasmine.PrettyPrinter.prototype.format = function(value) {
                  if (this.ppNestLevel_ > 40) {
                    throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
                  }
                
                
                Severity: Minor
                Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                      view({ attrs } : m.Vnode<RewardsEditAttrs>) {
                          const project = attrs.project
                  
                          return (
                              <div class="section">
                  Severity: Minor
                  Found in legacy/src/root/projects/publish-by-steps/rewards-edit.tsx - About 1 hr to fix

                    Function projectStateTextClass has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        projectStateTextClass = (state, has_cancelation_request) => {
                            const statusText = {
                                online: {
                                    cssClass: 'text-success',
                                    text: 'NO AR',
                    Severity: Minor
                    Found in legacy/src/h.ts - About 1 hr to fix

                      Function exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = (config) => {
                          config.set({
                              basePath: '',
                              frameworks: ['jasmine'],
                              files: [
                      Severity: Minor
                      Found in karma.conf.js - About 1 hr to fix

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

                            oninit: function(vnode) {
                                const userIdVM = catarse.filtersVM({ user_id: 'eq' });
                        
                                userIdVM.user_id(vnode.attrs.user_id);
                        
                        
                        Severity: Minor
                        Found in legacy/src/c/user-balance-main.js - About 1 hr to fix

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

                              oninit: function(vnode) {
                                  let parentHeight = prop(0),
                                      width = prop(vnode.attrs.width || 280),
                                      top = prop(0),
                                      left = prop(0),
                          Severity: Minor
                          Found in legacy/src/c/tooltip.js - About 1 hr to fix

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

                                oninit: function (vnode) {
                                    const parsedErrors = vnode.attrs.parsedErrors;
                                    const userBankAccount = vnode.attrs.userBankAccount;
                                    const banks = vnode.attrs.banks;
                                    const showOtherBanks = h.toggleProp(false, true);
                            Severity: Minor
                            Found in legacy/src/c/user-bank-form.js - About 1 hr to fix

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

                                  oninit: function(vnode) {
                                      const hash = prop(window.location.hash),
                                          displayTabContent = (project) => {
                                              const c_opts = {
                                                      project,
                              Severity: Minor
                              Found in legacy/src/c/project-main.js - About 1 hr to fix

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

                                    view: function({state, attrs}) {
                                        const balance = _.first(state.userBalances()) || { user_id: attrs.user_id, amount: 0 },
                                            positiveValue = balance.amount >= 0,
                                            balanceRequestModalC = [
                                                userBalanceRequestModalContent,
                                Severity: Minor
                                Found in legacy/src/c/user-balance.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 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    view: function({attrs}) {
                                        const project = attrs.project,
                                            isSub = projectVM.isSubscription(project);
                                
                                        return !_.isUndefined(project()) ? m(`.w-section.page-header${isSub ? '.transparent-background' : ''}`, [
                                Severity: Minor
                                Found in legacy/src/c/project-header-title.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 13 (exceeds 5 allowed). Consider refactoring.
                                Open

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

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

                                    oninit: function(vnode) {
                                        let listVM = contributionListVM,
                                            filterVM = contributionFilterVM,
                                            error = prop(''),
                                            filterBuilder = [{ // full_text_index
                                Severity: Minor
                                Found in legacy/src/root/admin-contributions.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

                                Severity
                                Category
                                Status
                                Source
                                Language