catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

File jasmine.js has 1511 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
 *
 * @namespace
 */
Severity: Major
Found in legacy/spec/lib/jasmine/jasmine.js - About 4 days to fix

    File h.ts has 1299 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import _ from 'underscore';
    import moment from 'moment';
    import * as Sentry from '@sentry/browser';
    import m from 'mithril';
    import prop from 'mithril/stream';
    Severity: Major
    Found in legacy/src/h.ts - About 3 days to fix

      Function CatarseAnalytics has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
      Open

      window.CatarseAnalytics = window.CatarseAnalytics || (function(){
          /*!
         * cookie-monster - a simple cookie library
         * v0.3.0
         * https://github.com/jgallen23/cookie-monster
      Severity: Minor
      Found in legacy/spec/lib/analytics.js - About 3 days 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      describe('ProjectRowWithHeader', () => {
          let $output;
      
          describe('view', () => {
              let collection = {
      Severity: Major
      Found in legacy/spec/components/project-row-with-header.spec.js and 1 other location - About 2 days to fix
      legacy/spec/components/project-row.spec.js on lines 6..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 404.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      describe('ProjectRow', () => {
          var $output;
      
          describe('view', () => {
              let collection = {
      Severity: Major
      Found in legacy/spec/components/project-row.spec.js and 1 other location - About 2 days to fix
      legacy/spec/components/project-row-with-header.spec.js on lines 6..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 404.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                              m('.back-payment-info-reward', [
                                  m('.fontsize-smaller.fontweight-semibold.u-marginbottom-10',
                                      window.I18n.t('selected_reward.reward', state.scope())
                                  ),
                                  m('.fontsize-smallest.fontweight-semibold',
      Severity: Major
      Found in legacy/src/root/projects-subscription-checkout.js and 1 other location - About 2 days to fix
      legacy/src/root/projects-payment.js on lines 194..243

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 403.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                                  m('.back-payment-info-reward', [
                                      m('.fontsize-smaller.fontweight-semibold.u-marginbottom-10', window.I18n.t('selected_reward.reward', state.scope())),
                                      m('.fontsize-smallest.fontweight-semibold', state.reward().title),
                                      m(
                                          '.fontsize-smallest.reward-description.opened.fontcolor-secondary',
      Severity: Major
      Found in legacy/src/root/projects-payment.js and 1 other location - About 2 days to fix
      legacy/src/root/projects-subscription-checkout.js on lines 219..265

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 403.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          oninit: function(vnode) {
              const vm = projectBudgetVM,
                  mapErrors = [
                        ['budget', ['budget']]
                  ],
      Severity: Major
      Found in legacy/src/c/project-budget-edit.js and 2 other locations - About 2 days to fix
      legacy/src/c/project-description-edit.js on lines 14..54
      legacy/src/c/project-video-edit.js on lines 14..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 393.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          oninit: function(vnode) {
              const vm = projectVideoVM,
                  mapErrors = [
                        ['video_url', ['video_url']]
                  ],
      Severity: Major
      Found in legacy/src/c/project-video-edit.js and 2 other locations - About 2 days to fix
      legacy/src/c/project-budget-edit.js on lines 14..54
      legacy/src/c/project-description-edit.js on lines 14..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 393.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          oninit: function(vnode) {
              const vm = projectDescriptionVM,
                  mapErrors = [
                        ['about_html', ['about_html']]
                  ],
      Severity: Major
      Found in legacy/src/c/project-description-edit.js and 2 other locations - About 2 days to fix
      legacy/src/c/project-budget-edit.js on lines 14..54
      legacy/src/c/project-video-edit.js on lines 14..54

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 393.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function AjaxFakeRequest has a Cognitive Complexity of 101 (exceeds 5 allowed). Consider refactoring.
      Open

      getJasmineRequireObj().AjaxFakeRequest = function(eventBusFactory) {
        function extend(destination, source, propertiesToSkip) {
          propertiesToSkip = propertiesToSkip || [];
          for (var property in source) {
            if (!arrayContains(propertiesToSkip, property)) {
      Severity: Minor
      Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 2 days 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 paymentVM has 372 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const paymentVM = () => {
          const pagarme = prop({}),
              defaultCountryID = addressVM.defaultCountryID,
              submissionError = prop(false),
              isLoading = prop(false);
      Severity: Major
      Found in legacy/src/vms/payment-vm.js - About 1 day to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                                        (state.showOtherBanks() ?
                                            m('.w-row[id=\'bank_search_list\']',
                                                m('.w-col.w-col-12',
                                                    m('.select-bank-list[data-ix=\'height-0-on-load\']', {
                                                        style: {
        Severity: Major
        Found in legacy/src/c/user-billing.js and 1 other location - About 1 day to fix
        legacy/src/c/user-bank-form.js on lines 126..176

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 311.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        (state.showOtherBanks()
                            ? m('.w-row[id=\'bank_search_list\']',
                                m('.w-col.w-col-12',
                                    m('.select-bank-list[data-ix=\'height-0-on-load\']', {
                                        style: {
        Severity: Major
        Found in legacy/src/c/user-bank-form.js and 1 other location - About 1 day to fix
        legacy/src/c/user-billing.js on lines 289..341

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 311.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            view: function({state}) {
                const user = state.user(),
                    project_id = state.project_id,
                    project = state.project(),
                    formatedValue = h.formatNumber(state.value, 2, 3),
        Severity: Minor
        Found in legacy/src/root/projects-subscription-checkout.js - About 1 day 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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                                                user.name && user.owner_document
                                                    ? ''
                                                    : m('.card.card-terciary.u-radius.u-marginbottom-40', [
                                                        m('.w-row', [
                                                            m('.w-col.w-col-7.w-sub-col', [
        Severity: Major
        Found in legacy/src/root/projects-payment.js and 1 other location - About 1 day to fix
        legacy/src/root/projects-subscription-checkout.js on lines 304..335

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 302.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                                        (user.name && user.owner_document) ? '' : m('.card.card-terciary.u-radius.u-marginbottom-40', [
                                            (m('.w-row', [
                                                m('.w-col.w-col-7.w-sub-col', [
                                                    m('label.field-label.fontweight-semibold[for=\'complete-name\']',
                                                        window.I18n.t('fields.complete_name', state.scope())
        Severity: Major
        Found in legacy/src/root/projects-subscription-checkout.js and 1 other location - About 1 day to fix
        legacy/src/root/projects-payment.js on lines 295..335

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 302.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
              this.createDom('div', { className: 'banner' },
                this.createDom('div', { className: 'logo' },
                    this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
                    this.createDom('span', { className: 'version' }, runner.env.versionString())),
        Severity: Major
        Found in legacy/spec/lib/jasmine-species/jasmine-reporting.js and 1 other location - About 1 day to fix
        legacy/spec/lib/jasmine/jasmine-html.js on lines 34..52

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 300.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
              this.createDom('div', { className: 'banner' },
                this.createDom('div', { className: 'logo' },
                    this.createDom('a', { href: 'http://pivotal.github.com/jasmine/', target: "_blank" }, "Jasmine"),
                    this.createDom('span', { className: 'version' }, runner.env.versionString())),
        Severity: Major
        Found in legacy/spec/lib/jasmine/jasmine-html.js and 1 other location - About 1 day to fix
        legacy/spec/lib/jasmine-species/jasmine-reporting.js on lines 33..51

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 300.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

            view: function ({ state }) {
                const user = state.user(),
                    project = state.project(),
                    formatedValue = h.formatNumber(Number(state.value), 2, 3),
                    anonymousCheckbox = m('.w-row', [
        Severity: Minor
        Found in legacy/src/root/projects-payment.js - About 1 day 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