catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

Function kondutoExecute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const kondutoExecute = function () {
    const customerID = h.getUserCommonID();

    if (customerID) {
        var period = 300;
Severity: Minor
Found in legacy/src/vms/common-payment-vm.js - About 45 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 requestInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const requestInfo = (promise, paymentId, defaultPaymentMethod, isEdit) => {
    if (retries <= 0) {
        return promise.resolve(resolvePayment(defaultPaymentMethod, false, paymentId, isEdit));
    }

Severity: Minor
Found in legacy/src/vms/common-payment-vm.js - About 45 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 formatCardInputNumber has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const formatCardInputNumber = (e, cardNumberProp) => {
    let $target,
        card,
        digit,
        length,
Severity: Minor
Found in legacy/src/vms/credit-card-vm.js - About 45 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 addResult has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.NestedResults.prototype.addResult = function(result) {
  if (result.type != 'log') {
    if (result.items_) {
      this.rollupCounts(result);
    } else {
Severity: Minor
Found in legacy/spec/lib/jasmine/jasmine.js - About 45 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

Avoid deeply nested control flow statements.
Open

            if (i > 0) message += ",";
Severity: Major
Found in legacy/spec/lib/jasmine/jasmine.js - About 45 mins to fix

    Function columnSplit has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function columnSplit(itemToString : (item : any) => string, values : any[], start : number, finish : number, onSelect : (item : any) => void, isSelected : (item : any) => boolean) {
    Severity: Minor
    Found in legacy/src/c/explore/explore-filter-select.ts - About 45 mins to fix

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

          view({ attrs, state } : m.Vnode<UserInfoEditPublicProfileAttrs, UserInfoEditPublicProfileState>) {
              const user = attrs.user
              const hasErrorOn = attrs.hasErrorOn
              const getErrorsOn = attrs.getErrorsOn
              const onSelectProfileImage = attrs.onSelectProfileImage
      Severity: Minor
      Found in legacy/src/c/projects/publish-by-steps/user-info-edit-public-profile.tsx - About 45 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 isCharAllowed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          isCharAllowed = maskCharDefinitions => maskDefinition => (position, newChar) => {
              if (position >= maskDefinition.length) {
                  return false;
              }
      
      
      Severity: Minor
      Found in legacy/src/h.ts - About 45 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

      Consider simplifying this complex logical expression.
      Open

                      if (!relationWithViolatedPropertyError() &&
                          !fullNameError() &&
                          !fullAddressError() &&
                          !projectInfringesError() &&
                          !detailsError() &&
      Severity: Major
      Found in legacy/src/c/project-report-infringes-intellectual-property.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

              } else if(/*!fromCatarse && */ request.referrer || (!o._time || new Date().getTime()-o._time>10*60*1000/*10min*/)) {
                var m=request.referrer && request.referrer.match(/https?:\/\/([^\/\?#]+)/);
                var refDomain=(m && m[1]) || undefined;
                var query=request.query;
                //se, e somente se, tem algum utm na query...
        Severity: Major
        Found in legacy/spec/lib/analytics.js - About 40 mins to fix

          Function WaitsForBlock has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) {
          Severity: Minor
          Found in legacy/spec/lib/jasmine/jasmine.js - About 35 mins to fix

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

                view: function({state, attrs}) {
                    
                    const user = attrs.user();
                    const fields = state.fields;
                    const addVM = state.addVM;
            Severity: Minor
            Found in legacy/src/c/user-settings.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const
                        showError = prop(false),
                        loader = catarse.loaderWithToken,
                        showPreview = h.toggleProp(false, true),
            Severity: Minor
            Found in legacy/src/root/survey-create.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    const error = state.error,
                        project = attrs.project;
                    return m("[id='dashboard-welcome-tab']",
                        (project() ? [
            Severity: Minor
            Found in legacy/src/root/project-edit-welcome.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const exploreButtonBehavoir = h.RedrawStream((/** @type {Event} */ event) => {
                        event.preventDefault();
                        m.route.set('/explore?ref=ctrse_header&filter=all');
                    });
            Severity: Minor
            Found in legacy/src/root/menu.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    return m('#catarse_pagarme_form', [
                        m('.u-text-center-small-only.u-marginbottom-30', [
                            m('.fontsize-large.fontweight-semibold',
                                window.I18n.t('payment_info', state.scope())
            Severity: Minor
            Found in legacy/src/c/payment-form.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    const data = attrs.data,
                        btnValue = (state.l()) ? 'por favor, aguarde...' : data.callToAction;
            
                    return m('.w-col.w-col-2', [
            Severity: Minor
            Found in legacy/src/c/admin-external-action.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const body = document.getElementsByTagName('body')[0],
                        editLinksToggle = h.toggleProp(true, false),
                        validating = prop(false),
                        showPublish = h.toggleProp(true, false),
            Severity: Minor
            Found in legacy/src/c/project-dashboard-menu.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    const user = state.userDetails();
            
                    return m('div', [
                        m(userHeader, { user }),
            Severity: Minor
            Found in legacy/src/root/users-show.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state}) {
                    let project = state.project,
                        progress = project.progress.toFixed(2),
                        statusTextObj = h.projectStateTextClass(project.state, project.has_cancelation_request),
                        remainingTextObj = state.remainingTextObj,
            Severity: Minor
            Found in legacy/src/c/admin-project-details-card.js - About 35 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