cattr-app/frontend-application

View on GitHub

Showing 4,835 of 4,835 total issues

Function timePerProject has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    timePerProject: (state, getters) => {
        return Object.keys(getters.intervals).reduce((result, userID) => {
            const userEvents = getters.intervals[userID];
            if (!userEvents) {
                return result;
Severity: Minor
Found in app/core/modules/Dashboard/storeModule.js - About 1 hr to fix

    Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                render: (h, props) => {
                    const data = [];
                    Object.keys(props.currentValue).forEach(k => {
                        props.currentValue[k].time = formatDurationString(+props.currentValue[k].duration);
                        data.push(props.currentValue[k]);
    Severity: Minor
    Found in app/core/modules/Tasks/module.init.js - About 1 hr to fix

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

          grid.addPageControls([
              {
                  label: 'control.create',
                  type: 'primary',
                  icon: 'icon-edit',
      Severity: Major
      Found in app/core/modules/Statuses/sections/statuses.js and 2 other locations - About 1 hr to fix
      app/core/modules/Invitations/sections/invitations.js on lines 103..112
      app/core/modules/Priorities/sections/priorities.js on lines 120..129

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

          grid.addPageControls([
              {
                  label: 'control.create',
                  type: 'primary',
                  icon: 'icon-edit',
      Severity: Major
      Found in app/core/modules/Invitations/sections/invitations.js and 2 other locations - About 1 hr to fix
      app/core/modules/Priorities/sections/priorities.js on lines 120..129
      app/core/modules/Statuses/sections/statuses.js on lines 146..155

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

          grid.addPageControls([
              {
                  label: 'control.create',
                  type: 'primary',
                  icon: 'icon-edit',
      Severity: Major
      Found in app/core/modules/Priorities/sections/priorities.js and 2 other locations - About 1 hr to fix
      app/core/modules/Invitations/sections/invitations.js on lines 103..112
      app/core/modules/Statuses/sections/statuses.js on lines 146..155

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

      module.exports = (api, options) => {
          api.registerCommand('modules:compile', () => {
              console.log('Reading modules config file...');
              const p = api.resolve('app/etc/modules.config.json');
              if (!fs.existsSync(api.resolve('app/generated'))) {
      Severity: Minor
      Found in app/compiler/index.js - About 1 hr to fix

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

                    this.navEntriesMenuDropdown.push(
                        new NavbarEntry({
                            label: a.label,
                            to: a.to,
                            displayCondition: a.hasOwnProperty('displayCondition') ? a.displayCondition : () => true,
        Severity: Major
        Found in app/core/arch/module.js and 1 other location - About 1 hr to fix
        app/core/arch/module.js on lines 126..133

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

        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

                    moduleInitQueue.push({
                        module: md,
                        order: moduleInitData.hasOwnProperty('loadOrder') ? moduleInitData.loadOrder : 999,
                        moduleInitData,
                        fullModuleName,
        Severity: Major
        Found in app/core/moduleLoader.js and 1 other location - About 1 hr to fix
        app/core/moduleLoader.js on lines 132..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 60.

        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

                {
                    label: 'field.active',
                    key: 'active',
                    render: (h, { currentValue }) => {
                        return h('span', currentValue ? i18n.t('control.yes') : i18n.t('control.no'));
        Severity: Major
        Found in app/core/modules/Users/sections/users.js and 1 other location - About 1 hr to fix
        app/core/modules/Users/sections/users.js on lines 252..258

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

        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

                {
                    label: 'field.screenshots_active',
                    key: 'screenshots_active',
                    render: (h, { currentValue }) => {
                        return h('span', currentValue ? i18n.t('control.yes') : i18n.t('control.no'));
        Severity: Major
        Found in app/core/modules/Users/sections/users.js and 1 other location - About 1 hr to fix
        app/core/modules/Users/sections/users.js on lines 245..251

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

        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

                moduleInitQueue.push({
                    module: md,
                    order: moduleInitData.hasOwnProperty('loadOrder') ? moduleInitData.loadOrder : 999,
                    moduleInitData,
                    fullModuleName,
        Severity: Major
        Found in app/core/moduleLoader.js and 1 other location - About 1 hr to fix
        app/core/moduleLoader.js on lines 68..75

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

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

        export function serialize(data, prefix) {
            let str = [],
                p;
            for (p in data) {
                if (data.hasOwnProperty(p)) {
        Severity: Minor
        Found in app/core/utils/url.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 2 locations. Consider refactoring.
        Open

                    this.navEntriesDropdown[p.section].push(
                        new NavbarEntry({
                            label: p.label,
                            to: p.to,
                            displayCondition: p.hasOwnProperty('displayCondition') ? p.displayCondition : () => true,
        Severity: Major
        Found in app/core/arch/module.js and 1 other location - About 1 hr to fix
        app/core/arch/module.js on lines 142..149

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

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

            timePerProject: (state, getters) => {
                return Object.keys(getters.intervals).reduce((result, userID) => {
                    const userEvents = getters.intervals[userID];
                    if (!userEvents) {
                        return result;
        Severity: Minor
        Found in app/core/modules/Dashboard/storeModule.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 setLoading has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        const setLoading = value => {
            if (value) {
                if (pendingRequests === 0) Vue.prototype.$Loading.start();
                pendingRequests++;
            } else {
        Severity: Minor
        Found in app/core/helpers/httpInterceptor.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 render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    render: (h, data) => {
                        if (!router.app.$store.getters['user/user'].is_admin) {
                            return h(
                                'ul',
                                {},
        Severity: Minor
        Found in app/core/modules/Tasks/module.init.js - About 1 hr to fix

          Function defultCallback has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const defultCallback = action => {
              if (currentModal) {
                  const callback = currentModal.callback;
                  if (typeof callback === 'function') {
                      if (instance.showInput) {
          Severity: Minor
          Found in app/core/components/global/CustomModal/dialog.js - About 1 hr to fix

            Function createStatusDialog has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function createStatusDialog(type) {
                const statusTitles = {
                    info: '信息',
                    success: '成功',
                    warning: '警告',
            Severity: Minor
            Found in app/core/components/global/CustomModal/dialog.js - About 1 hr to fix

              Function ru has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  ru: function (choice, choicesLength) {
                      // this === VueI18n instance, so the locale property also exists here
              
                      if (choice === 0) {
                          return 0;
              Severity: Minor
              Found in app/core/i18n/pluralizationRules.js - About 55 mins 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 showNextModal has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              const showNextModal = () => {
                  initInstance();
                  instance.action = '';
              
                  if (!instance.visible && modalQueue.length) {
              Severity: Minor
              Found in app/core/components/global/CustomModal/dialog.js - About 55 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language