Showing 6,140 of 6,140 total issues
Function breadcrumb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
breadcrumb() {
const currentCategory = this.props.currentCategory || {
title: '',
firstTopic: { title: '' }
};
- 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 loginMiddleware
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const loginMiddleware = async (req, res) => {
const MAIN_APP_DOMAIN = getEnv({ name: 'MAIN_APP_DOMAIN' });
debugRequest(debugGmail, req);
- 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 TicketEditForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function TicketEditForm(props: Props) {
const item = props.item;
const [source, setSource] = useState(item.source);
const [refresh, setRefresh] = useState(false);
- 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 renderLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
renderLinks() {
const msg = this.props.message;
const pause = this.renderLink('Pause', 'pause-circle', this.props.setPause);
const live = this.renderLink('Set live', 'play-circle', this.props.setLive);
- 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 subscribeUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const subscribeUser = async (email: string) => {
debugGmail(`Executing subscribeUser with ${email}`);
try {
const { GOOGLE_PROJECT_ID, GOOGLE_GMAIL_TOPIC } = await getGoogleConfigs();
- 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 saveEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const saveEvent = async (args: ISaveEventArgs) => {
const { type, name, attributes, additionalQuery } = args;
if (!type) {
throw new Error('Type is required');
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
export const init = async () => {
const TWITTER_CONSUMER_KEY = await getConfig('TWITTER_CONSUMER_KEY');
if (TWITTER_CONSUMER_KEY) {
try {
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loadClass = () => {
class InternalNote {
public static async getInternalNote(_id: string) {
const internalNote = await InternalNotes.findOne({ _id });
- 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 fieldFactory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const fieldFactory = async (params: IFieldFactoryInput) => {
const groupObj = await fieldGroupFactory({});
if (!groupObj) {
throw new Error('Failed to create fieldGroup');
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loadClass = () => {
class Webhook {
/*
* Get a Webhook
*/
- 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 loadItemClass
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const loadItemClass = () => {
class ChecklistItem {
public static async getChecklistItem(_id: string) {
const checklistItem = await ChecklistItems.findOne({ _id });
- 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 importFromWebhook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const importFromWebhook = async (content: any) => {
const { data, type } = content;
const useElkSyncer = ELK_SYNCER === 'false' ? false : true;
- 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 getIndexByContentType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getIndexByContentType = (contentType: string) => {
let index = 'customers';
if (contentType === 'company') {
index = 'companies';
- 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 generateConditionStageIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const generateConditionStageIds = async ({
boardId,
pipelineId,
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
Function uploadFile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const uploadFile = async (
apiUrl: string,
file,
fromEditor = false
): Promise<any> => {
- 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 getCompanyNames
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getCompanyNames = async _id => {
const conformities = await Conformities.find({ mainTypeId: _id });
const companyNames = [] as any;
for (const conf of conformities) {
- 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 generateFieldsFromSchema
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const generateFieldsFromSchema = async (queSchema: any, namePrefix: string) => {
const fields: any = [];
// field definitions
const paths = queSchema.paths;
- 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 clearEmptyValues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const clearEmptyValues = (obj: any) => {
Object.keys(obj).forEach(key => {
if (obj[key] === '' || obj[key] === 'unknown') {
delete obj[key];
}
- 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 onboardingGetAvailableFeatures
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async onboardingGetAvailableFeatures(_root, _args, { user }: IContext) {
const results: Array<{
name: string;
isComplete: boolean;
settings?: string[];
- 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 integrationSendMail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async integrationSendMail(_root, args: any, { dataSources, user }: IContext) {
const { erxesApiId, body, customerId, ...doc } = args;
let kind = doc.kind;
- 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"