catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

                                m('.w-col.w-col-4', [
                                    m('div', [
                                        m('span.fontsize-smaller.fontcolor-secondary', window.I18n.t('credit', I18nScope())),
                                        m.trust(' '),
                                        m('span.fontsize-base.text-success', `R$ ${h.formatNumber(item.credit, 2, 3)}`)
Severity: Major
Found in legacy/src/c/user-balance-transaction-row.js and 1 other location - About 1 hr to fix
legacy/src/c/user-balance-transaction-row.js on lines 48..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 74.

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('.w-col.w-col-4', [
                                    m('div', [
                                        m('span.fontsize-smaller.fontcolor-secondary', window.I18n.t('totals', I18nScope())),
                                        m.trust(' '),
                                        m('span.fontsize-base', `R$ ${h.formatNumber(item.total_amount, 2, 3)}`)
Severity: Major
Found in legacy/src/c/user-balance-transaction-row.js and 1 other location - About 1 hr to fix
legacy/src/c/user-balance-transaction-row.js on lines 41..47

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 74.

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 oninit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    oninit: function(vnode) {
        const filtersVM = catarse.filtersVM({
                project_id: 'eq'
            }),
            projectDetails = prop([]),
Severity: Minor
Found in legacy/src/root/insights.js - About 1 hr to fix

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

        oninit: function(vnode) {
            let l = prop(false);
            const sendSuccess = prop(false),
                userDetails = vnode.attrs,
                submitDisabled = prop(false),
    Severity: Minor
    Found in legacy/src/c/owner-message-content.js - About 1 hr to fix

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

          oninit: function(vnode) {
              let builder = vnode.attrs.data,
                  complete = prop(false),
                  error = prop(false),
                  fail = prop(false),
      Severity: Minor
      Found in legacy/src/c/admin-reset-password.js - About 1 hr to fix

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

            view({attrs} : m.Vnode<RewardsEditListCardAttrs>) {
                const reward = attrs.reward
                const index = attrs.index
                const error = attrs.error
                const errors = attrs.errors
        Severity: Minor
        Found in legacy/src/c/projects/edit/rewards-edit-list-card.tsx - About 1 hr to fix

          Function AjaxParamParser has 48 lines of code (exceeds 25 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

            Function oninit has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const rewards = prop([]),
                        currentRewardId = prop(),
                        currentReward = prop(),
                        showSuccess = prop(false),
            Severity: Minor
            Found in legacy/src/root/project-edit-welcome.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 15 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const fixedNavClass = 'project-nav-fixed',
                        isFixed = prop(false),
                        originalPosition = prop(-1),
                        project = vnode.attrs.project;
            Severity: Minor
            Found in legacy/src/c/project-tabs.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 15 (exceeds 5 allowed). Consider refactoring.
            Open

                view: function({state, attrs}) {
                    const goal = attrs.goal(),
                        inlineError = message => m('.fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle',
                            m('span',
                                message
            Severity: Minor
            Found in legacy/src/c/project-goal-edit-card.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 15 (exceeds 5 allowed). Consider refactoring.
            Open

                oninit: function(vnode) {
                    const table = prop(vnode.attrs.table),
                        sortIndex = prop(-1);
            
                    const comparator = (a, b) => {
            Severity: Minor
            Found in legacy/src/c/project-data-table.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 AjaxRequestTracker has a Cognitive Complexity of 15 (exceeds 5 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

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

            jasmine.reporting.StyledHtmlReporter.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-species/jasmine-reporting.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

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

                            m.request({
                                method: 'POST',
                                url: '/admin/balance_transfers/batch_reject',
                                data: {
                                    transfer_ids: _.uniq(_.map(selectedItemsIDs(), s => s.id))
            Severity: Major
            Found in legacy/src/root/admin-balance-tranfers.js and 2 other locations - About 1 hr to fix
            legacy/src/root/admin-balance-tranfers.js on lines 187..199
            legacy/src/root/admin-balance-tranfers.js on lines 202..215

            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 73.

            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

                            m.request({
                                method: 'POST',
                                url: '/admin/balance_transfers/batch_manual',
                                data: {
                                    transfer_ids: _.uniq(_.map(selectedItemsIDs(), s => s.id))
            Severity: Major
            Found in legacy/src/root/admin-balance-tranfers.js and 2 other locations - About 1 hr to fix
            legacy/src/root/admin-balance-tranfers.js on lines 202..215
            legacy/src/root/admin-balance-tranfers.js on lines 234..246

            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 73.

            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

                            m.request({
                                method: 'POST',
                                url: '/admin/balance_transfers/batch_approve',
                                data: {
                                    transfer_ids: _.uniq(_.map(selectedItemsIDs(), s => s.id))
            Severity: Major
            Found in legacy/src/root/admin-balance-tranfers.js and 2 other locations - About 1 hr to fix
            legacy/src/root/admin-balance-tranfers.js on lines 187..199
            legacy/src/root/admin-balance-tranfers.js on lines 234..246

            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 73.

            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('.container', [
                            m('.w-row.u-margintop-40', [
                                m('.w-col.w-col-2.w-col-push-5', [
                                    !userBalanceTransactionsList.isLoading() ? 
                                        (
            Severity: Major
            Found in legacy/src/c/user-balance-transactions.js and 1 other location - About 1 hr to fix
            legacy/src/c/project-contribution-report-content.js on lines 164..174

            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 73.

            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('.w-row.u-marginbottom-10', [
                                                    m('.w-col.w-col-5.w-sub-col', [
                                                        m('label.field-label.fontweight-semibold',
                                                            '  Perfil do twitter'
                                                        ),
            Severity: Major
            Found in legacy/src/c/user-about-edit.js and 1 other location - About 1 hr to fix
            legacy/src/c/user-about-edit.js on lines 398..414

            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 73.

            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('.w-row.u-marginbottom-10', [
                                                    m('.w-col.w-col-5.w-sub-col', [
                                                        m('label.field-label.fontweight-semibold',
                                                            '  Perfil do facebook'
                                                        ),
            Severity: Major
            Found in legacy/src/c/user-about-edit.js and 1 other location - About 1 hr to fix
            legacy/src/c/user-about-edit.js on lines 415..431

            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 73.

            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('.w-container', [
                                m('.w-row.u-marginbottom-60', [
                                    m('.w-col.w-col-2.w-col-push-5', [
                                        (!list.isLoading() ?
                                            (list.isLastPage() ? '' : m('button#load-more.btn.btn-medium.btn-terciary', {
            Severity: Major
            Found in legacy/src/c/project-contribution-report-content.js and 1 other location - About 1 hr to fix
            legacy/src/c/user-balance-transactions.js on lines 25..41

            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 73.

            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

            Severity
            Category
            Status
            Source
            Language