catarse/catarse.js

View on GitHub

Showing 1,380 of 1,380 total issues

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

    oninit: function(vnode) {
        let player;
        const showLightbox = h.toggleProp(false, true),
            setYoutube = () => {
                const tag = document.createElement('script'),
Severity: Minor
Found in legacy/src/c/youtube-lightbox.js - About 1 hr to fix

    Function validateCardExpiry has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const validateCardExpiry = function (month, year) {
        let currentTime,
            expiry,
            ref;
        if (typeof month === 'object' && 'month' in month) {
    Severity: Minor
    Found in legacy/src/vms/credit-card-vm.js - About 1 hr to fix

      Function MockAjax has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function MockAjax(global) {
          var requestTracker = new $ajax.RequestTracker(),
            stubTracker = new $ajax.StubTracker(),
            paramParser = new $ajax.ParamParser(),
            realAjaxFunction = global.XMLHttpRequest,
      Severity: Minor
      Found in legacy/spec/lib/jasmine-ajax/mock-ajax.js - About 1 hr to fix

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

                    if (document.length > 14) {
                        isValid = h.validateCnpj(document);
                        errorMessage = 'CNPJ inválido.';
                    } else {
                        isValid = h.validateCpf(striped);
        Severity: Major
        Found in legacy/src/c/payment-credit-card.js and 1 other location - About 1 hr to fix
        legacy/src/vms/payment-vm.js on lines 121..127

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

        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

          describe("full_text_index.toFilter", function() {
            it("should remove all diacritics to send filter", function() {
              vm.full_text_index('rémoção dos acêntüs');
              expect(vm.full_text_index.toFilter()).toEqual('remocao dos acentus');
            });
        Severity: Major
        Found in legacy/spec/components/vms/contribution-filter-vm.spec.js and 1 other location - About 1 hr to fix
        legacy/spec/components/vms/user-filter-vm.spec.js on lines 14..19

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

        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

                if (document.length > 14) {
                    isValid = h.validateCnpj(document);
                    errorMessage = 'CNPJ inválido.';
                } else {
                    isValid = h.validateCpf(striped);
        Severity: Major
        Found in legacy/src/vms/payment-vm.js and 1 other location - About 1 hr to fix
        legacy/src/c/payment-credit-card.js on lines 92..98

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

        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

          describe("full_text_index.toFilter", function() {
            it("should remove all diacritics to send filter", function() {
              vm.full_text_index('rémoção dos acêntüs');
              expect(vm.full_text_index.toFilter()).toEqual('remocao dos acentus');
            });
        Severity: Major
        Found in legacy/spec/components/vms/user-filter-vm.spec.js and 1 other location - About 1 hr to fix
        legacy/spec/components/vms/contribution-filter-vm.spec.js on lines 16..21

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

        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

          I18n.toPercentage = function(number, options) {
            options = this.prepareOptions(
                options
              , this.lookup("number.percentage.format")
              , this.lookup("number.format")
        Severity: Major
        Found in legacy/spec/lib/i18n/i18n.js and 1 other location - About 1 hr to fix
        legacy/spec/lib/i18n/i18n.js on lines 590..599

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

        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

          I18n.toCurrency = function(number, options) {
            options = this.prepareOptions(
                options
              , this.lookup("number.currency.format")
              , this.lookup("number.format")
        Severity: Major
        Found in legacy/spec/lib/i18n/i18n.js and 1 other location - About 1 hr to fix
        legacy/spec/lib/i18n/i18n.js on lines 802..811

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

        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 4 locations. Consider refactoring.
        Open

                                    <div class="_w-sub-col w-col w-col-5">
                                        <label for="name-11" class="fontweight-semibold fontsize-base">
                                            Nome público
                                        </label>
                                        <label for="name-11" class="field-label fontsize-smallest fontcolor-secondary">
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 48..55
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 88..95
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 109..116

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

        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 4 locations. Consider refactoring.
        Open

                                                <div class="_w-sub-col w-col w-col-5">
                                                    <label for="name" class="field-label fontweight-semibold">
                                                        Imagem do projeto
                                                    </label>
                                                    <label for="name" class="field-label fontsize-smallest fontcolor-secondary">
        Severity: Major
        Found in legacy/src/root/projects/publish-by-steps/card-edit.tsx and 3 other locations - About 1 hr to fix
        legacy/src/c/projects/publish-by-steps/user-info-edit-public-profile.tsx on lines 49..56
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 88..95
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 109..116

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

        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 4 locations. Consider refactoring.
        Open

                                                <div class="_w-sub-col w-col w-col-5">
                                                    <label for="name" class="field-label fontweight-semibold">
                                                        Vídeo do youtube (opcional)
                                                    </label>
                                                    <label for="name" class="field-label fontsize-smallest fontcolor-secondary">
        Severity: Major
        Found in legacy/src/root/projects/publish-by-steps/card-edit.tsx and 3 other locations - About 1 hr to fix
        legacy/src/c/projects/publish-by-steps/user-info-edit-public-profile.tsx on lines 49..56
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 48..55
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 88..95

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

        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 4 locations. Consider refactoring.
        Open

                                                <div class="_w-sub-col w-col w-col-5">
                                                    <label for="name" class="field-label fontweight-semibold">
                                                        Frase de efeito
                                                    </label>
                                                    <label for="name" class="field-label fontsize-smallest fontcolor-secondary">
        Severity: Major
        Found in legacy/src/root/projects/publish-by-steps/card-edit.tsx and 3 other locations - About 1 hr to fix
        legacy/src/c/projects/publish-by-steps/user-info-edit-public-profile.tsx on lines 49..56
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 48..55
        legacy/src/root/projects/publish-by-steps/card-edit.tsx on lines 109..116

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

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

                    uploadImage = () => {
                        const userUploadedImageEl = window.document.getElementById('user_uploaded_image'),
                            userCoverImageEl = window.document.getElementById('user_cover_image'),
                            formData = new FormData();
        
        
        Severity: Minor
        Found in legacy/src/c/user-about-edit.js - About 1 hr to fix

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

                      displayTabContent = (user) => {
                          const tabs = {
                              '#projects': m(userCreated, {
                                  userId,
                                  showDraft: true
          Severity: Minor
          Found in legacy/src/root/users-edit.js - About 1 hr to fix

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

                oninit: function(vnode) {
                    const contribution = vnode.attrs.contribution,
                        mapEvents = _.reduce([{
                            date: contribution.paid_at,
                            name: 'Apoio confirmado'
            Severity: Minor
            Found in legacy/src/c/admin-transaction-history.js - About 1 hr to fix

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

                  view({ state, attrs }) {
              
                      /** @type {string} */
                      const reportsExportingUrl = attrs.reportsExportingUrl;
              
              
              Severity: Minor
              Found in legacy/src/root/requested-subscription-reports-modal.js - About 1 hr to fix

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

                    view({attrs}) {
                
                        const projects = attrs.projects;
                        const isSearch = attrs.isSearch;
                        const filterKeyName = attrs.filterKeyName;
                Severity: Minor
                Found in legacy/src/c/explore/explore-projects-list.js - About 1 hr to fix

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

                  const startVM = (I18n) => {
                      const i18nStart = I18n.translations[I18n.currentLocale()].pages.start,
                          testimonials = i18nStart.testimonials,
                          categoryProjects = i18nStart.categoryProjects,
                          panes = i18nStart.panes,
                  Severity: Minor
                  Found in legacy/src/vms/start-vm.js - About 1 hr to fix

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

                        const payWithNewCard = (contribution_id, installment) => {
                            const p = new Promise((resolve, reject) => {
                                m.request({
                                    method: 'GET',
                                    url: `/payment/pagarme/${contribution_id}/get_encryption_key`,
                    Severity: Minor
                    Found in legacy/src/vms/payment-vm.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language