catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

Function mapRailsErrors has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const mapRailsErrors = (rails_errors) => {
    let parsedErrors;
    try {
        parsedErrors = JSON.parse(rails_errors);
    } catch (e) {
Severity: Minor
Found in legacy/src/vms/user-settings-vm.js - About 1 hr to fix

    Function AjaxEvent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    getJasmineRequireObj().AjaxEvent = function() {
      function now() {
        return new Date().getTime();
      }
    
    
    Severity: Minor
    Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

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

          view({ attrs }) {
              return (
                  <div class="dashboard-column-tips">
                      <div class="card card-secondary">
                          <div>
      Severity: Minor
      Found in legacy/src/c/projects/publish-by-steps/rewards-edit-tips.tsx - About 1 hr to fix

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

                vnode.state = {
                    contributedProjects,
                    subscribedProjects,
                    mailMarketingLists,
                    showNotifications,
        Severity: Major
        Found in legacy/src/c/user-notifications.js and 2 other locations - About 1 hr to fix
        legacy/src/c/address-form.js on lines 61..72
        legacy/src/c/payment-slip.js on lines 59..70

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

        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

                vnode.state = {
                    vm,
                    buildSlip,
                    slipPaymentDate,
                    loading,
        Severity: Major
        Found in legacy/src/c/payment-slip.js and 2 other locations - About 1 hr to fix
        legacy/src/c/address-form.js on lines 61..72
        legacy/src/c/user-notifications.js on lines 94..105

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

        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

                vnode.state = {
                    lookupZipCode,
                    zipCodeErrorMessage,
                    applyPhoneMask,
                    applyZipcodeMask,
        Severity: Major
        Found in legacy/src/c/address-form.js and 2 other locations - About 1 hr to fix
        legacy/src/c/payment-slip.js on lines 59..70
        legacy/src/c/user-notifications.js on lines 94..105

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

        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

                const successStateInfoRender = [
                    m('span.fa.fa-check-circle', m.trust('&nbsp;')),
                    I18n.t('received_at', I18nScopeTransfer()),
                    h.momentify(vnode.attrs.transfer.transferred_at, 'DD/MM/YYYY'),
                    m('br')
        Severity: Major
        Found in legacy/src/c/user-balance-withdraw-history-item-request.js and 1 other location - About 1 hr to fix
        legacy/src/c/user-balance-withdraw-history-item-request.js on lines 39..44

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

        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

                const initialStateInfoRender = [
                    m('span.fa.fa-clock-o', m.trust('&nbsp;')),
                    I18n.t('funding_estimated_date', I18nScopeTransfer()),
                    h.momentify(vnode.attrs.transfer.funding_estimated_date, 'DD/MM/YYYY'),
                    m('br')
        Severity: Major
        Found in legacy/src/c/user-balance-withdraw-history-item-request.js and 1 other location - About 1 hr to fix
        legacy/src/c/user-balance-withdraw-history-item-request.js on lines 59..64

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

        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

                vnode.state = {
                    lContributionsPerRef,
                    lContributionsPerLocation,
                    lContributionsPerDay,
                    lVisitorsPerDay,
        Severity: Major
        Found in legacy/src/c/project-insights.js and 1 other location - About 1 hr to fix
        legacy/src/c/address-form.js on lines 130..143

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

        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(addressFormNational, {
                            disableInternational,
                            countryName,
                            fields,
                            international,
        Severity: Major
        Found in legacy/src/c/address-form.js and 1 other location - About 1 hr to fix
        legacy/src/c/project-insights.js on lines 133..146

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

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

            oninit: function(vnode) {
                const e = generateErrorInstance();
                const mapErrors = [
                    ['goals', ['goals.size']]
                ];
        Severity: Minor
        Found in legacy/src/c/project-goals-edit.js - About 1 hr to fix

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

            Function equals_ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) {
              mismatchKeys = mismatchKeys || [];
              mismatchValues = mismatchValues || [];
            
              for (var i = 0; i < this.equalityTesters_.length; i++) {
            Severity: Minor
            Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

              Function addViewModel has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function addViewModel() {
              
                          const statesProp = prop<State[]>([])
              
                          const fieldsMap = {
              Severity: Minor
              Found in legacy/src/c/projects/publish-by-steps/user-info-edit-settings.tsx - About 1 hr to fix

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

                    oninit({ state, attrs} : m.Vnode<InputPermalinkAttrs, InputPermalinkState>) {
                        state.class = attrs.class
                        state.currentPermalink = attrs.currentPermalink
                        state.checkPermalinkAvailable = async (inputText) => {
                            let lastValidValue = state.currentPermalink
                Severity: Minor
                Found in legacy/src/c/projects/publish-by-steps/input-permalink.tsx - About 1 hr to fix

                  Function saveFields has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private async saveFields(fields : string[], requiredFields : string[]) {
                          
                          this._isSavingProject = true
                          
                          h.redraw()
                  Severity: Minor
                  Found in legacy/src/vms/project-publish-by-steps-vm.ts - About 1 hr to fix

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

                                            m(surveyPreview, {
                                                confirmAddress: survey.confirm_address,
                                                countryName: countryName(),
                                                stateName: stateName(),
                                                fields: state.addVM().getFields(),
                    Severity: Major
                    Found in legacy/src/root/surveys-show.js and 2 other locations - About 1 hr to fix
                    legacy/src/root/surveys-show.js on lines 244..251
                    legacy/src/root/surveys-show.js on lines 337..344

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

                    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

                            beforeAll(() => {
                                jasmine.Ajax.stubRequest(
                                    `${apiPrefix}/rpc/project_search`
                                ).andReturn({
                                    responseHeaders: {
                    Severity: Major
                    Found in legacy/spec/components/vms/projects-explore-vm.spec.js and 2 other locations - About 1 hr to fix
                    legacy/spec/components/vms/projects-explore-vm.spec.js on lines 6..15
                    legacy/spec/components/vms/projects-explore-vm.spec.js on lines 36..45

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

                    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

                        feature: function(description, specDefinitions) {
                            var suite = jasmine.grammar.getEnv().describe('Feature: ' + description, specDefinitions);
                            suite.tags = ['feature'];
                            return suite;
                        },
                    Severity: Major
                    Found in legacy/spec/lib/jasmine-species/jasmine-grammar.js and 2 other locations - About 1 hr to fix
                    legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 37..41
                    legacy/spec/lib/jasmine-species/jasmine-grammar.js on lines 46..50

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

                    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

                            beforeAll(() => {
                                jasmine.Ajax.stubRequest(
                                    `${apiPrefix}/projects?order=open_for_contributions.desc%2Cstate_order.asc%2Cstate.desc%2Cscore.desc%2Cpledged.desc&state=eq.online&open_for_contributions=eq.true`
                                ).andReturn({
                                    responseHeaders: {
                    Severity: Major
                    Found in legacy/spec/components/vms/projects-explore-vm.spec.js and 2 other locations - About 1 hr to fix
                    legacy/spec/components/vms/projects-explore-vm.spec.js on lines 36..45
                    legacy/spec/components/vms/projects-explore-vm.spec.js on lines 130..139

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

                    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