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;
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;
- Read upRead up
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
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '_internal/Dashboard/services/dashboard.service'
with "_internal/Dashboard/services/dashboard.service"
Open
import DashboardService from '_internal/Dashboard/services/dashboard.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····timezone:·moment.tz.guess(),
with ··timezone:·moment.tz.guess()
Open
timezone: moment.tz.guess(),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
if (!projects[event.project_id]) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················
with ··········
Open
projects[event.project_id] = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················
with ··········
Open
};
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················projects[event.project_id].tasks[event.task_id].duration·+=
with ··········projects[event.project_id].tasks[event.task_id].duration·+=⏎···········
Open
projects[event.project_id].tasks[event.task_id].duration += event.duration;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
getters,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'moment-timezone'
with "moment-timezone"
Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················
with ··········
Open
};
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··········
Open
projects[event.project_id].duration += event.duration;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················projects[event.project_id].tasks[event.task_id
with ··········projects[event.project_id].tasks[⏎············event.task_id⏎··········
Open
projects[event.project_id].tasks[event.task_id].durationAtSelectedPeriod +=
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
return projects;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
const userEvents = getters.intervals[userID];
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
...result,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
};
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····},
with ··}
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
} else {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
service: null,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
if (!userEvents) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
const userTimePerDay = userEvents.reduce((result, event) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
state.users = users;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace },
with );⏎··}
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
state,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
mutations,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
service: state => state.service,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
tasks: state => state.tasks,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
return result;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
return {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················[userID]:·userTimePerDay,
with ········[userID]:·userTimePerDay
Open
[userID]: userTimePerDay,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
state.service = service;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
state.intervals = intervals;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················projects[event.project_id].durationAtSelectedPeriod·+=
with ··········projects[event.project_id].durationAtSelectedPeriod·+=⏎···········
Open
projects[event.project_id].durationAtSelectedPeriod += event.durationAtSelectedPeriod;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
}, {});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
if (!userEvents) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
init(context) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '@/services/resource/task.service'
with "@/services/resource/task.service"
Open
import TasksService from '@/services/resource/task.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
return Object.keys(getters.intervals).reduce((result, userID) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
if (!projects[event.project_id].tasks[event.task_id]) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
...result,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
state.tasks = tasks;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
tasks: {},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
intervals: state => state.intervals,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ············
Open
duration: event.duration,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················
with ··········
Open
projects[event.project_id].tasks[event.task_id] = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························
with ············
Open
name: event.task_name,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························
with ············
Open
duration: event.duration,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························durationAtSelectedPeriod:·event.durationAtSelectedPeriod,
with ············durationAtSelectedPeriod:·event.durationAtSelectedPeriod
Open
durationAtSelectedPeriod: event.durationAtSelectedPeriod,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
} else {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
return _.mergeWith({}, result, event.durationByDay, _.add);
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
setService(state, service) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
state.timezone = timezone;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
timePerProject: (state, getters) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
};
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········context.commit('setService',·new·DashboardService(context,·new·TasksService(),·new·UserService()));
with ····context.commit(⏎······"setService",⏎······new·DashboardService(context,·new·TasksService(),·new·UserService())
Open
context.commit('setService', new DashboardService(context, new TasksService(), new UserService()));
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························
with ············
Open
id: event.task_id,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
return Object.keys(getters.intervals).reduce((result, userID) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
return {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '@/services/resource/user.service'
with "@/services/resource/user.service"
Open
import UserService from '@/services/resource/user.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
}, {});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
intervals: {},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
users: state => state.users,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
const projects = userEvents.reduce((projects, event) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Definition for rule 'vue/attributes-order' was not found Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
users: [],
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ············
Open
event.durationAtSelectedPeriod;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
return result;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··actions,
with actions
Open
actions,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························
with ············
Open
name: event.project_name,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ············
Open
tasks: {},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························durationAtSelectedPeriod:·event.durationAtSelectedPeriod,
with ············durationAtSelectedPeriod:·event.durationAtSelectedPeriod
Open
durationAtSelectedPeriod: event.durationAtSelectedPeriod,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
setIntervals(state, intervals) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
setUsers(state, users) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
const userEvents = getters.intervals[userID];
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················[userID]:·projects,
with ········[userID]:·projects
Open
[userID]: projects,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
}, {});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····timezone:·state·=>·state.timezone,
with ··timezone:·state·=>·state.timezone
Open
timezone: state => state.timezone,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
setTasks(state, tasks) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
setTimezone(state, timezone) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
import moment from 'moment-timezone';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'lodash'
with "lodash"
Open
import _ from 'lodash';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ············
Open
id: event.project_id,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
timePerDay: (state, getters) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
}, {});
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/