catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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

    view: function({state, attrs}) {
        const project = attrs.project;

        return m('div', [
            m('.modal-dialog-header', [
Severity: Minor
Found in legacy/src/c/invite-emails-from-import.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) {
        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 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-reset-password.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 ({ attrs }) {
        const collection = attrs.collection,
            title = attrs.title || collection.title,
            ref = attrs.ref,
            showFriends = attrs.showFriends,
Severity: Minor
Found in legacy/src/c/project-row-with-header.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 subsCollection = state.subscriptions.collection(),
            onlineCollection = state.onlinePages.collection(),
            successfulCollection = state.successfulPages.collection(),
            failedCollection = state.failedPages.collection();
Severity: Minor
Found in legacy/src/c/user-private-contributed.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 getContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function getContent(thing) {
  if (!thing) {
    return ''
  }
  if (isString(thing)) {
Severity: Minor
Found in legacy/spec/lib/mithril-query/mithril-query.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 getPaymentInfoUntilNoError has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getPaymentInfoUntilNoError = (paymentMethod, isEdit) => ({ id, catalog_payment_id }) => {
    const p = new Promise((resolve, reject) => {
        const paymentId = isEdit ? catalog_payment_id : id;

        if (paymentId) {
Severity: Minor
Found in legacy/src/vms/common-payment-vm.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 locationOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const locationOptions = (reward, destination) => {
    const options = prop([]),
        mapStates = _.map(states(), state => {
            let fee;
            const feeState = _.findWhere(fees(), {
Severity: Minor
Found in legacy/src/vms/reward-vm.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 formatException has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.util.formatException = function(e) {
  var lineNumber;
  if (e.line) {
    lineNumber = e.line;
  }
Severity: Minor
Found in legacy/spec/lib/jasmine/jasmine.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 summarizeResult_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){
  var summaryMessages = [];
  var messagesLength = result.messages.length;
  for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
    var resultMessage = result.messages[messageIndex];
Severity: Minor
Found in legacy/spec/lib/jasmine/jasmine.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 getUserRecommendedProjects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getUserRecommendedProjects = contribution => {
    const sample3 = _.partial(_.sample, _, 3),
        loaders = prop([]),
        collection = prop([]),
        { user_id } = h.getUser();
Severity: Minor
Found in legacy/src/vms/user-vm.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 analyticsWindowScroll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    analyticsWindowScroll = eventObj => {
        if (eventObj) {
            setTimeout(() => {
                const u = window.location.href;
                let fired = false;
Severity: Minor
Found in legacy/src/h.ts - 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 validateCpf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    validateCpf = strCPF => {
        let sum = 0,
            remainder;

        if (strCPF == '00000000000') return false;
Severity: Minor
Found in legacy/src/h.ts - 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({ attrs, state } : m.Vnode<ShareAttrs, ShareState>) {
        
        const project = attrs.project
        const projectUrl = `${window.location.origin}/${project.permalink}`
        const copyToClipboard = (copyText : HTMLInputElement) => {
Severity: Minor
Found in legacy/src/root/projects/publish-by-steps/share.tsx - 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 AjaxStubTracker has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

getJasmineRequireObj().AjaxStubTracker = function() {
  function StubTracker() {
    var stubs = [];

    this.addStub = function(stub) {
Severity: Minor
Found in legacy/spec/lib/jasmine-ajax/mock-ajax.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 analyticsEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    analyticsEvent = (eventObj, fn = Function.prototype) => {
        // https://developers.google.com/analytics/devguides/collection/analyticsjs/command-queue-reference#send
        if (!eventObj) {
            return fn;
        }
Severity: Minor
Found in legacy/src/h.ts - 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

Avoid too many return statements within this function.
Open

            return '';
Severity: Major
Found in legacy/src/c/user-subscription-box-control.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return m('.u-radius.fontsize-smaller.u-marginbottom-10.fontweight-semibold.card-error',
                    m('div', [
                        m('span.fa.fa-exclamation-triangle', ' '),
                        ` Sua assinatura será cancelada no dia ${
                            h.momentify(subscription.next_charge_at, 'DD/MM/YYYY')
    Severity: Major
    Found in legacy/src/c/user-subscription-box-control.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return [
                          m('.card-alert.fontsize-smaller.fontweight-semibold.u-marginbottom-10.u-radius', [
                              m('span.fa.fa-exclamation-triangle'),
                              ` O boleto de sua assinatura vence dia ${h.momentify(subscription.boleto_expiration_date)}`,
                          ]),
      Severity: Major
      Found in legacy/src/c/user-subscription-box-control.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return '';
        Severity: Major
        Found in legacy/src/c/user-subscription-box-control.js - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language