Showing 33 of 4,835 total issues
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 {
- 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
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
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',
{},
Function createStatusDialog
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStatusDialog(type) {
const statusTitles = {
info: '信息',
success: '成功',
warning: '警告',
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) {
Function showNextModal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const showNextModal = () => {
initInstance();
instance.action = '';
if (!instance.visible && modalQueue.length) {
- 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
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;
- 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
Avoid deeply nested control flow statements. Open
} else if (action === 'cancel' && currentModal.reject) {
currentModal.reject(action);
}
Avoid deeply nested control flow statements. Open
if (instance.showInput) {
currentModal.resolve({ value: instance.inputValue, action });
} else {
currentModal.resolve(action);
}
Function exports
has a Cognitive Complexity of 8 (exceeds 5 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'))) {
- 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
Function init
has a Cognitive Complexity of 7 (exceeds 5 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());
- 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
Function responseErrorInterceptor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const responseErrorInterceptor = error => {
setLoading(false);
if (!has(error, 'response.status') || (error.request.responseType === 'blob' && error.request.status === 404)) {
return Promise.reject(error);
- 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
Avoid too many return
statements within this function. Open
return choicesLength < 4 ? 2 : 3;