Showing 2,055 of 6,140 total issues
File conversationQueries.test.ts
has 2025 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as moment from 'moment';
import * as sinon from 'sinon';
import { IntegrationsAPI } from '../data/dataSources';
import { graphqlRequest } from '../db/connection';
import {
File factories.ts
has 1745 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { dateType } from 'aws-sdk/clients/sts'; // tslint:disable-line
import * as faker from 'faker';
import * as Random from 'meteor-random';
import * as momentTz from 'moment-timezone';
import { FIELDS_GROUPS_CONTENT_TYPES } from '../data/constants';
Function init
has 930 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (editor) {
var rootPath = this.path,
defaultConfig = {
autoCloseBrackets: true,
autoCloseTags: true,
File widgetMutations.test.ts
has 1603 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as Random from 'meteor-random';
import * as sinon from 'sinon';
import { MESSAGE_KINDS } from '../data/constants';
import { IntegrationsAPI } from '../data/dataSources';
File permission.ts
has 1459 lines of code (exceeds 250 allowed). Consider refactoring. Open
export const moduleObjects = {
brands: {
name: 'brands',
description: 'Brands',
actions: [
File logUtils.ts
has 1310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
putCreateLog as putCreateLogC,
putDeleteLog as putDeleteLogC,
putUpdateLog as putUpdateLogC
} from 'erxes-api-utils';
File nylasController.test.ts
has 1102 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as sinon from 'sinon';
import {
accountFactory,
integrationFactory,
nylasCalendarFactory,
File plugin.js
has 1099 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* The "codemirror" plugin. It's indented to enhance the
* "sourcearea" editing mode, which displays the xhtml source code with
* syntax highlight and line numbers.
* Licensed under the MIT license
Function loadClass
has a Cognitive Complexity of 137 (exceeds 5 allowed). Consider refactoring. Open
export const loadClass = () => {
class Customer {
/**
* Checking if customer has duplicated unique properties
*/
- 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 create
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
const create = async ({
docs,
user,
contentType,
model,
- 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 loadClass
has 537 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadClass = () => {
class Customer {
/**
* Checking if customer has duplicated unique properties
*/
File integrationDb.test.ts
has 1059 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as momentTz from 'moment-timezone';
import {
brandFactory,
conversationFactory,
File engageMessageDb.test.ts
has 1023 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as sinon from 'sinon';
import { MESSAGE_KINDS } from '../data/constants';
import * as utils from '../data/utils';
import {
File segments.test.ts
has 1017 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
elkConvertConditionToQuery,
fetchSegment,
generateNestedQuery,
generateQueryBySegment,
Function checkLogicFulfilled
has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring. Open
export const checkLogicFulfilled = (logics: LogicParams[]) => {
const values: { [key: string]: boolean } = {};
for (const logic of logics) {
const { fieldId, operator, logicValue, fieldValue, validation, type } = logic;
- 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 global-styles.ts
has 971 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { injectGlobal } from 'styled-components';
import { robotAnimation } from '../utils/animations';
import { colors, typography } from './';
const style = `
File conversationMutations.test.ts
has 963 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as sinon from 'sinon';
import { AUTO_BOT_MESSAGES } from '../data/constants';
import { IntegrationsAPI } from '../data/dataSources';
import utils from '../data/utils';
File nylas.test.ts
has 951 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Nylas from 'nylas';
import * as sinon from 'sinon';
import {
configFactory,
integrationFactory,
Function main
has 470 lines of code (exceeds 25 allowed). Consider refactoring. Open
const main = async () => {
const MONGO_URL = getEnv({ name: 'MONGO_URL' });
await shelljs.exec(`mongo "${MONGO_URL}" --eval 'db.killOp()'`, {
silent: true
File loadTestData.ts
has 947 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as dotenv from 'dotenv';
import * as faker from 'faker';
import * as fs from 'fs';
import { disconnect } from 'mongoose';
import * as shelljs from 'shelljs';