Showing 686 of 3,397 total issues
File index.js
has 3873 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import pickBy from 'lodash/pickBy';
import defaults from 'lodash/defaults';
import find from 'lodash/find';
import upperFirst from 'lodash/upperFirst';
Function getLoginIncentives
has a Cognitive Complexity of 314 (exceeds 5 allowed). Consider refactoring. Open
export default function getLoginIncentives (api) {
const loginIncentives = {
1: {
rewardKey: ['armor_special_bardRobes'],
reward: [api.gear.flat.armor_special_bardRobes],
- 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
File group.test.js
has 1992 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import { v4 as generateUUID } from 'uuid';
import validator from 'validator';
import { sleep, translationCheck } from '../../../helpers/api-unit.helper';
import {
Function getLoginIncentives
has 1076 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getLoginIncentives (api) {
const loginIncentives = {
1: {
rewardKey: ['armor_special_bardRobes'],
reward: [api.gear.flat.armor_special_bardRobes],
File cron.test.js
has 1902 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable global-require */
import moment from 'moment';
import nconf from 'nconf';
import requireAgain from 'require-again';
import { recoverCron, cron } from '../../../../website/server/libs/cron';
File armoire.js
has 1855 lines of code (exceeds 250 allowed). Consider refactoring. Open
import defaults from 'lodash/defaults';
import find from 'lodash/find';
import forEach from 'lodash/forEach';
import moment from 'moment';
import upperFirst from 'lodash/upperFirst';
File pets.js
has 1650 lines of code (exceeds 250 allowed). Consider refactoring. Open
import t from '../translation';
const QUEST_PETS = {
alligator: {
text: t('questAlligatorText'),
Function scoreTask
has a Cognitive Complexity of 187 (exceeds 5 allowed). Consider refactoring. Open
export default function scoreTask (options = {}, req = {}, analytics) {
const {
user, task, direction, times = 1, cron = false,
} = options;
let delta = 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
File group.js
has 1283 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import mongoose from 'mongoose';
import _ from 'lodash';
import validator from 'validator';
import nconf from 'nconf';
File payments.test.js
has 1278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import * as sender from '../../../../../website/server/libs/email';
import common from '../../../../../website/common';
import api from '../../../../../website/server/libs/payments/payments';
File loginIncentives.js
has 1080 lines of code (exceeds 250 allowed). Consider refactoring. Open
import range from 'lodash/range';
import { MAX_INCENTIVES } from '../constants';
// NOTE do not import this file alone but only access it through common.content
// so that it's already compiled
File shouldDo.test.js
has 1020 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import { shouldDo, DAY_MAPPING } from '../../website/common/script/cron';
import 'moment-recur';
describe('shouldDo', () => {
Function shouldDo
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
export function shouldDo (day, dailyTask, options = {}) {
if (dailyTask.type !== 'daily' || dailyTask.startDate === null || dailyTask.everyX < 1 || dailyTask.everyX > 9999) {
return false;
}
const o = sanitizeOptions(options);
- 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
File groups.js
has 796 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import nconf from 'nconf';
import moment from 'moment';
import { authWithHeaders } from '../../middlewares/auth';
import {
File group-payments-create.test.js
has 768 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import stripeModule from 'stripe';
import nconf from 'nconf';
import * as sender from '../../../../../../website/server/libs/email';
File masterclasser.js
has 728 lines of code (exceeds 250 allowed). Consider refactoring. Open
import t from '../translation';
const QUEST_MASTERCLASSER = {
dilatoryDistress1: {
text: t('questDilatoryDistress1Text'),
File POST-register_local.test.js
has 718 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { v4 as uuid } from 'uuid';
import { each } from 'lodash';
import {
generateUser,
requester,
File POST-tasks_user.test.js
has 716 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { v4 as generateUUID } from 'uuid';
import {
generateUser,
sleep,
translate as t,
File user.test.js
has 704 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import { model as User } from '../../../../website/server/models/user';
import { model as NewsPost } from '../../../../website/server/models/newsPost';
import { model as Group } from '../../../../website/server/models/group';
import common from '../../../../website/common';
Function getItemInfo
has 322 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function getItemInfo (user, type, item, officialPinnedItems, language = 'en') {
if (officialPinnedItems === undefined) {
officialPinnedItems = getOfficialPinnedItems(user); // eslint-disable-line no-param-reassign
}