catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    oninit: function(vnode) {
        const clientId = document.getElementById('google_oauth_client'),
            modalToggle = h.toggleProp(false, true),
            feedPageUrl = 'https://www.google.com/m8/feeds/contacts/default/full?alt=json&max-results=1000',
            dataEmails = prop([]),
Severity: Major
Found in legacy/src/c/project-google-contact-import.js - About 2 hrs to fix

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

        view: function({attrs})
        {
            const 
                disableFields = attrs.disableFields,
                fields = attrs.fields(),
    Severity: Minor
    Found in legacy/src/c/user-settings-responsible.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 oninit has a Cognitive Complexity of 16 (exceeds 5 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 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 oninit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const vm = projectDescriptionVideoVM,
                mapErrors = [
                      ['about_html', ['about_html']],
                      ['video_url', ['video_url']]
    Severity: Minor
    Found in legacy/src/c/project-description-video-edit.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 oninit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const vm = projectVideoVM,
                mapErrors = [
                      ['video_url', ['video_url']]
                ],
    Severity: Minor
    Found in legacy/src/c/project-video-edit.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 oninit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const vm = projectBudgetVM,
                mapErrors = [
                      ['budget', ['budget']]
                ],
    Severity: Minor
    Found in legacy/src/c/project-budget-edit.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 oninit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        oninit: function(vnode) {
            const vm = projectDescriptionVM,
                mapErrors = [
                      ['about_html', ['about_html']]
                ],
    Severity: Minor
    Found in legacy/src/c/project-description-edit.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 chargebackConfirmationModalContentWrapper has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                chargebackConfirmationModalContentWrapper = (customAttrs) => {
                    const wrapper = {
                        view({state, attrs}) {
                            return m('', [
                                m('.modal-dialog-header', [
    Severity: Major
    Found in legacy/src/root/admin-subscriptions.js - About 2 hrs to fix

      Function chargebackConfirmationModalContentWrapper has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  chargebackConfirmationModalContentWrapper = (customAttrs) => {
                      const wrapper = {
                          view: function({state, attrs}) {
                              return m('', [
                                  m('.modal-dialog-header', [
      Severity: Major
      Found in legacy/src/root/admin-contributions.js - About 2 hrs to fix

        Function trySaveUserAttributesAndValidatePublishProject has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private async trySaveUserAttributesAndValidatePublishProject(userAttributes : any) {
                const saveRequestConfig = {
                    method: 'PUT',
                    url: `/users/${this.user_id}.json`,
                    data: {
        Severity: Major
        Found in legacy/src/vms/user-info-edit-vm.ts - About 2 hrs to fix

          Function strftime has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            I18n.strftime = function(date, format) {
              var options = this.lookup("date")
                , meridianOptions = I18n.meridian()
              ;
          
          
          Severity: Major
          Found in legacy/spec/lib/i18n/i18n.js - About 2 hrs to fix

            Function validateCnpj has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                validateCnpj = cnpjStr => {
                    let tamanho, numeros, digitos, soma, pos, resultado;
                    const cnpj = cnpjStr.replace(/[^\d]+/g, '');
            
                    if (cnpj == '') {
            Severity: Major
            Found in legacy/src/h.ts - About 2 hrs to fix

              Function generateWrapperModal has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          generateWrapperModal = (customAttrs) => {
                              const wrapper = {
                                  view: function({state, attrs}) {
                                      actionMenuToggle(false);
                                      return m('', [
              Severity: Major
              Found in legacy/src/root/admin-balance-tranfers.js - About 2 hrs to fix

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

                    view({attrs}) {
                        
                        const {
                            position,
                            title,
                Severity: Major
                Found in legacy/src/c/admin-home-banners-entry.js - About 2 hrs to fix

                  Function project has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      get project() : ProjectDetails {
                          const self = this
                          return {
                              ...this._project,
                              get project_id() {
                  Severity: Major
                  Found in legacy/src/vms/project-publish-by-steps-vm.ts - About 2 hrs to fix

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

                        oninit: function(vnode) {
                            const listVM = userListVM,
                                filterVM = userFilterVM,
                                error = prop(''),
                                itemBuilder = [{
                    Severity: Minor
                    Found in legacy/src/root/admin-users.js - About 2 hrs to fix

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

                          oninit: function(vnode) {
                              const loader = catarse.loaderWithToken,
                                  filterVM = catarse.filtersVM({
                                      project_id: 'eq'
                                  }),
                      Severity: Minor
                      Found in legacy/src/root/surveys.js - About 2 hrs to fix

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

                            oninit: function(vnode) {
                                const vm = projectCardVM,
                                    mapErrors = [
                                        ['uploaded_image', ['uploaded_image']],
                                        ['cover_image', ['cover_image']],
                        Severity: Minor
                        Found in legacy/src/c/project-card-edit.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (
                                      cnpj == '00000000000000' ||
                                      cnpj == '11111111111111' ||
                                      cnpj == '22222222222222' ||
                                      cnpj == '33333333333333' ||
                          Severity: Critical
                          Found in legacy/src/h.ts - About 2 hrs to fix

                            Function reportRunnerStarting has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
                              var showPassed, showSkipped;
                            
                              this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
                                  this.createDom('div', { className: 'banner' },
                            Severity: Minor
                            Found in legacy/spec/lib/jasmine/jasmine-html.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language