cattr-app/frontend-application

View on GitHub

Showing 33 of 4,835 total issues

Function init has 590 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function init(context, router) {
    let routes = {};

    ModuleLoaderInterceptor.on('Core', m => {
        m.routes.forEach(route => {
Severity: Major
Found in app/core/modules/Tasks/module.init.js - About 2 days to fix

    File time.js has 713 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import moment from 'moment-timezone';
    import i18n from '@/i18n';
    
    export function formatDate(date, format = 'YYYY-MM-DD h:mm:ss') {
        return moment(date).format(format);
    Severity: Major
    Found in app/core/utils/time.js - About 1 day to fix

      File module.init.js has 611 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import cloneDeep from 'lodash/cloneDeep';
      import TasksService from '@/services/resource/task.service';
      import ProjectsService from '@/services/resource/project.service';
      import StatusService from '@/services/resource/status.service';
      import { ModuleLoaderInterceptor } from '@/moduleLoader';
      Severity: Major
      Found in app/core/modules/Tasks/module.init.js - About 1 day to fix

        Function fieldsToFillProvider has 184 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function fieldsToFillProvider() {
            return [
                {
                    key: 'id',
                    displayable: () => false,
        Severity: Major
        Found in app/core/modules/Users/sections/users.js - About 7 hrs to fix

          File users.js has 473 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import cloneDeep from 'lodash/cloneDeep';
          import TimezonePicker from '@/components/TimezonePicker';
          import CoreUsersService from '@/services/resource/user.service';
          import RoleSelect from '@/components/RoleSelect';
          import Users from '../views/Users';
          Severity: Minor
          Found in app/core/modules/Users/sections/users.js - About 7 hrs to fix

            Function init has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
            Open

            export function init(context, router) {
                let routes = {};
            
                ModuleLoaderInterceptor.on('Core', m => {
                    m.routes.forEach(route => {
            Severity: Minor
            Found in app/core/modules/Tasks/module.init.js - About 6 hrs 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 localModuleLoader has 131 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function localModuleLoader(router) {
                const requireModule = require.context('_modules', true, /module.init.js$/);
                let moduleInitQueue = [];
            
                requireModule.keys().forEach(fn => {
            Severity: Major
            Found in app/core/moduleLoader.js - About 5 hrs to fix

              Function init has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function init(context, router) {
                  const crud = context.createCrud('time_intervals.crud_title', 'time-intervals', TimeIntervalService);
                  const crudNewRoute = crud.new.getNewRouteName();
              
                  crud.new.addToMetaProperties('permissions', 'time-intervals/create', crud.new.getRouterConfig());
              Severity: Major
              Found in app/core/modules/TimeIntervals/module.init.js - About 4 hrs to fix

                Function defultCallback has a Cognitive Complexity of 26 (exceeds 5 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 3 hrs 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

                Module has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export default class Module {
                    routes = [];
                    navEntries = [];
                    navEntriesDropdown = {};
                    navEntriesMenuDropdown = [];
                Severity: Minor
                Found in app/core/arch/module.js - About 3 hrs to fix

                  Function load has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      load(userIDs, projectIDs, startAt, endAt, userTimezone) {
                          this.getReport(startAt, endAt, userIDs, projectIDs, userTimezone)
                              .then(response => {
                                  if (!response) {
                                      return;
                  Severity: Major
                  Found in app/core/modules/Dashboard/services/dashboard.service.js - About 2 hrs to fix

                    Function fieldsProvider has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function fieldsProvider() {
                        return [
                            {
                                key: 'id',
                                displayable: () => false,
                    Severity: Major
                    Found in app/core/modules/Users/sections/account.js - About 2 hrs to fix

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

                                          render(h, props) {
                                              const defaultConfig = [
                                                  {
                                                      start: 0,
                                                      end: 0.75,
                      Severity: Major
                      Found in app/core/modules/Settings/sections/general.js - About 2 hrs to fix

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

                                    render: (h, props) => {
                                        return h(VueEditor, {
                                            props: {
                                                useMarkdownShortcuts: true,
                                                editorToolbar: [
                        Severity: Minor
                        Found in app/core/modules/Tasks/module.init.js - About 1 hr to fix

                          Function fieldsToFillProvider has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function fieldsToFillProvider() {
                              return [
                                  {
                                      key: 'id',
                                      displayable: () => false,
                          Severity: Minor
                          Found in app/core/modules/Users/sections/users.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 apply has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              apply(compiler) {
                                  compiler.hooks.done.tap('CattrWebpackPlugin', stats => {
                                      // Finding plugins config
                                      let plugins = require('../app/etc/modules.config.json');
                          
                          
                          Severity: Minor
                          Found in webpack/CattrWebpackPlugin.js - About 1 hr to fix

                            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

                                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

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language