catarse/catarse.js

View on GitHub

Showing 570 of 1,380 total issues

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) {
        let listVM = subscriptionListVM,
            filterVM = subscriptionFilterVM,
            error = prop(''),
            filterBuilder = [{ // name
Severity: Minor
Found in legacy/src/root/admin-subscriptions.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 vm = projectBasicsVM,
            mapErrors = [
                ['name', ['name']],
                ['public_tags', ['public_tags']],
Severity: Minor
Found in legacy/src/c/project-basics-edit.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({state}) {
        const deleted = state.deleted,
            othersCount = _.filter(state.fees(), fee => fee.destination !== 'others' && fee.destination !== 'international').length,
            states = state.states;

Severity: Minor
Found in legacy/src/c/shipping-fee-input.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 user = attrs.user,
            hideDetails = attrs.hideDetails,
            profileImage = userVM.displayImage(user),
            coverImage = userVM.displayCover(user),
Severity: Minor
Found in legacy/src/c/user-header.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 checkedList = prop([]),
            loading = prop(false),
            filterTerm = prop(''),
            filteredData = prop(vnode.attrs.dataEmails()),
Severity: Minor
Found in legacy/src/c/invite-emails-from-import.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({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 oninit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    oninit: function(vnode) {
        const EXPERIMENT_CASE_CURRENT = 'EXPERIMENT_CASE_CURRENT',
            EXPERIMENT_CASE_6SUBHOM = 'EXPERIMENT_CASE_6SUBHOM',
            EXPERIMENT_CASE_3SUBHOM = 'EXPERIMENT_CASE_3SUBHOM';

Severity: Minor
Found in legacy/src/c/projects-display.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 renderBody has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private renderBody({ projectPublishByStepsVM, userInfoEditVM, showPopError } : ProjectsPublishByStepsState) {

        if (projectPublishByStepsVM.isLoadingProject || userInfoEditVM.isLoading) {
            return h.loader()
        } else {

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 validateCnpj has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    validateCnpj = cnpjStr => {
        let tamanho, numeros, digitos, soma, pos, resultado;
        const cnpj = cnpjStr.replace(/[^\d]+/g, '');

        if (cnpj == '') {
Severity: Minor
Found in legacy/src/h.ts - 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({attrs, state} : m.Vnode<UserInfoEditSettingsAttrs, UserInfoEditSettingsState>) {
        const hasErrorOn = attrs.hasErrorOn
        const getErrorsOn = attrs.getErrorsOn
        const user = attrs.user
        user.address = user.address || {
Severity: Minor
Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - 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 AjaxParamParser has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

getJasmineRequireObj().AjaxParamParser = function() {
  function ParamParser() {
    var defaults = [
      {
        test: function(xhr) {
Severity: Minor
Found in legacy/spec/lib/jasmine-ajax/mock-ajax.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 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    oninit: function(vnode) {
        const vm = rewardVM,
            selectedReward = vm.selectedReward,
            selectReward = vm.selectReward,
            rewards = vm.rewards(),
Severity: Minor
Found in legacy/src/root/projects-reward.js - About 1 hr to fix

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

        oninit: function(vnode) {
            let l = prop(false);
            const project = vnode.attrs.project,
                filterVM = catarse.filtersVM({
                    project_id: 'eq'
    Severity: Minor
    Found in legacy/src/c/project-reminder.js - About 1 hr to fix

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

          oninit: function(vnode) {
              const translate = path => window.I18n.t(path, I18nScope());
      
              vnode.state = {
                  stages: {
      Severity: Minor
      Found in legacy/src/c/project-contribution-state-legend-modal.js - About 1 hr to fix

        Function homeVM has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const homeVM = () => {
            const _isUpdating = h.RedrawStream(false);
            const _banners =  h.RedrawStream([]);
        
            async function getBanners() {
        Severity: Minor
        Found in legacy/src/vms/home-vm.js - About 1 hr to fix

          Function toNumber has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            I18n.toNumber = function(number, options) {
              options = this.prepareOptions(
                  options
                , this.lookup("number.format")
                , NUMBER_FORMAT
          Severity: Minor
          Found in legacy/spec/lib/i18n/i18n.js - About 1 hr to fix

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

                view({ attrs } : m.Vnode<ShareReminderAttrs> ) {
                    const project = attrs.project
                    const projectUrl = `/projects/${project.id}/insights`
            
                    return (
            Severity: Minor
            Found in legacy/src/root/projects/publish-by-steps/share-reminder.tsx - About 1 hr to fix

              Function AjaxRequestTracker has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              getJasmineRequireObj().AjaxRequestTracker = function() {
                function RequestTracker() {
                  var requests = [];
              
                  this.track = function(request) {
              Severity: Minor
              Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

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

                    view({ attrs } : m.Vnode<DescriptionEditTipsAttrs>) {
                
                        const show = attrs.show
                
                        return (
                Severity: Minor
                Found in legacy/src/c/projects/publish-by-steps/description-edit-tips.tsx - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language