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

    const vm1 = {
        collection() {
            return [{data: 1}];
        },
        isLoading() {
Severity: Major
Found in legacy/spec/components/vms/sequence-pagination-vm.spec.js and 1 other location - About 1 hr to fix
legacy/spec/components/vms/sequence-pagination-vm.spec.js on lines 23..38

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

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 vm2 = {
        collection() {
            return [{data: 2}];
        },
        isLoading() {
Severity: Major
Found in legacy/spec/components/vms/sequence-pagination-vm.spec.js and 1 other location - About 1 hr to fix
legacy/spec/components/vms/sequence-pagination-vm.spec.js on lines 6..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 68.

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

        it('should render a flex badge when project mode is flexible', () => {
            let {
                output, projectDetail
            } = generateContextByNewState({
                mode: 'flex'
Severity: Major
Found in legacy/spec/components/project-sidebar.spec.js and 1 other location - About 1 hr to fix
legacy/spec/components/project-sidebar.spec.js on lines 36..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 68.

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

            groupCollection = (collection, groupTotal) => _.map(_.range(Math.ceil(collection.length / groupTotal)), i => collection.slice(i * groupTotal, (i + 1) * groupTotal));
Severity: Major
Found in legacy/src/c/team-members.js and 1 other location - About 1 hr to fix
legacy/spec/components/team-members.spec.js on lines 10..10

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

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

            updateUser = () => {
                const userData = {
                    current_password: fields.current_password(),
                    password: fields.password(),
                    email: fields.email(),
Severity: Minor
Found in legacy/src/c/user-about-edit.js - About 1 hr to fix

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

        oninit: function(vnode) {
            const togglePreview = () => {
                    h.scrollTop();
                    vnode.attrs.showPreview(false);
                },
    Severity: Minor
    Found in legacy/src/c/posts-preview.js - About 1 hr to fix

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

          oninit: function (vnode) {
              const
                  firstValue = prop(0),
                  secondValue = prop(0),
                  clearFieldValues = () => { firstValue(0), secondValue(0) },
      Severity: Minor
      Found in legacy/src/c/filter-dropdown-number-range.js - About 1 hr to fix

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

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

          Function format has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jasmine.PrettyPrinter.prototype.format = function(value) {
            if (this.ppNestLevel_ > 40) {
              throw new Error('jasmine.PrettyPrinter: format() nested too deeply!');
            }
          
          
          Severity: Minor
          Found in legacy/spec/lib/jasmine/jasmine.js - About 1 hr to fix

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

                view({ attrs } : m.Vnode<RewardsEditAttrs>) {
                    const project = attrs.project
            
                    return (
                        <div class="section">
            Severity: Minor
            Found in legacy/src/root/projects/publish-by-steps/rewards-edit.tsx - About 1 hr to fix

              Function projectStateTextClass has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  projectStateTextClass = (state, has_cancelation_request) => {
                      const statusText = {
                          online: {
                              cssClass: 'text-success',
                              text: 'NO AR',
              Severity: Minor
              Found in legacy/src/h.ts - About 1 hr to fix

                Function exports has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = (config) => {
                    config.set({
                        basePath: '',
                        frameworks: ['jasmine'],
                        files: [
                Severity: Minor
                Found in karma.conf.js - About 1 hr to fix

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

                      oninit: function(vnode) {
                          const userIdVM = catarse.filtersVM({ user_id: 'eq' });
                  
                          userIdVM.user_id(vnode.attrs.user_id);
                  
                  
                  Severity: Minor
                  Found in legacy/src/c/user-balance-main.js - About 1 hr to fix

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

                        oninit: function(vnode) {
                            let parentHeight = prop(0),
                                width = prop(vnode.attrs.width || 280),
                                top = prop(0),
                                left = prop(0),
                    Severity: Minor
                    Found in legacy/src/c/tooltip.js - About 1 hr to fix

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

                          oninit: function (vnode) {
                              const parsedErrors = vnode.attrs.parsedErrors;
                              const userBankAccount = vnode.attrs.userBankAccount;
                              const banks = vnode.attrs.banks;
                              const showOtherBanks = h.toggleProp(false, true);
                      Severity: Minor
                      Found in legacy/src/c/user-bank-form.js - About 1 hr to fix

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

                            oninit: function(vnode) {
                                const hash = prop(window.location.hash),
                                    displayTabContent = (project) => {
                                        const c_opts = {
                                                project,
                        Severity: Minor
                        Found in legacy/src/c/project-main.js - About 1 hr to fix

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

                              m('.w-col.w-col-11', [
                                  m('div', [
                                      m('span.fontsize-smallest.fontcolor-secondary', '9/9'),
                                      ' ',
                                      m('span', {
                          Severity: Major
                          Found in legacy/src/vms/publish-vm.js and 1 other location - About 1 hr to fix
                          legacy/src/vms/publish-vm.js on lines 120..131

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

                          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 = {
                                      showSuccess,
                                      selectAll,
                                      unselectAll,
                                      deliveryMessage,
                          Severity: Major
                          Found in legacy/src/c/project-contribution-report-content.js and 2 other locations - About 1 hr to fix
                          legacy/src/root/admin-notifications.js on lines 58..70
                          legacy/src/root/survey-create.js on lines 131..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 67.

                          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 = {
                                      reward,
                                      showError,
                                      showPreview,
                                      toggleShowPreview,
                          Severity: Major
                          Found in legacy/src/root/survey-create.js and 2 other locations - About 1 hr to fix
                          legacy/src/c/project-contribution-report-content.js on lines 59..71
                          legacy/src/root/admin-notifications.js on lines 58..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 67.

                          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 = {
                                      templates,
                                      selectedItem,
                                      selectedItemTemplate,
                                      renderedTemplate,
                          Severity: Major
                          Found in legacy/src/root/admin-notifications.js and 2 other locations - About 1 hr to fix
                          legacy/src/c/project-contribution-report-content.js on lines 59..71
                          legacy/src/root/survey-create.js on lines 131..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 67.

                          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