Showing 1,820 of 4,015 total issues
Function setupAdminApp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function setupAdminApp() {
debug('Admin setup start');
const adminApp = express('admin');
// Admin assets
- 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 up
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function up(knex) {
// This uses the default settings from core/server/data/schema/default-settings/default-settings.json
const newsletter = {
id: (new ObjectId()).toHexString(),
uuid: crypto.randomUUID(),
- 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 dropForeign
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async function dropForeign({fromTable, fromColumn, toTable, toColumn, constraintName, transaction = db.knex}) {
if (DatabaseInfo.isSQLite(transaction)) {
const foreignKeyExists = await hasForeignSQLite({fromTable, fromColumn, toTable, toColumn, transaction});
if (!foreignKeyExists) {
logging.warn(`Skipped dropping foreign key from ${fromTable}.${fromColumn} to ${toTable}.${toColumn} - does not exist`);
- 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 addFixturesForModel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async addFixturesForModel(modelFixture, options = {}) {
// Clone the fixtures as they get changed in this function.
// The initial blog posts will be added a `published_at` property, which
// would change the fixturesHash.
modelFixture = _.cloneDeep(modelFixture);
- 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 SessionFromToken
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function SessionFromToken({
getTokenFromRequest,
getLookupFromToken,
findUserByLookup,
createSession,
- 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 channelController
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function channelController(req, res, next) {
debug('channelController', req.params, res.routerOptions);
const pathOptions = {
page: req.params.page !== undefined ? req.params.page : 1,
- 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 formSubmitHandler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function formSubmitHandler({event, form, errorEl, siteUrl, submitHandler},
t = (str) => {
return str;
}) {
form.removeEventListener('submit', submitHandler);
- 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 usePinturaEditor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export default function usePinturaEditor() {
const {config: globalConfig, settings} = useGlobalData() as { config: Config, settings: Setting[] };
const [pintura] = getSettingValues<boolean>(settings, ['pintura']);
const [scriptLoaded, setScriptLoaded] = useState<boolean>(false);
const [cssLoaded, setCssLoaded] = useState<boolean>(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 getOfferLabel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function getOfferLabel({offer, price, subscriptionStartDate, t}) {
let offerLabel = '';
if (offer?.type === 'trial') {
return '';
- 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 useDefaultRecipientsOptions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const useDefaultRecipientsOptions = (selectedOption: string, defaultEmailRecipientsFilter?: string | null) => {
const tiers = useFilterableApi<Tier, 'tiers', 'name'>({path: '/tiers/', filterKey: 'name', responseKey: 'tiers'});
const labels = useFilterableApi<Label, 'labels', 'name'>({path: '/labels/', filterKey: 'name', responseKey: 'labels'});
const offers = useFilterableApi<Offer, 'offers', 'name'>({path: '/offers/', filterKey: 'name', responseKey: 'offers'});
- 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 Newsletters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const Newsletters: React.FC<{ keywords: string[] }> = ({keywords}) => {
const {updateRoute} = useRouting();
const openNewsletterModal = () => {
updateRoute('newsletters/new');
};
- 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 CustomIntegrationModalContent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const CustomIntegrationModalContent: React.FC<{integration: Integration}> = ({integration}) => {
const modal = useModal();
const {updateRoute} = useRouting();
const {mutateAsync: editIntegration} = useEditIntegration();
- 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 Toggle
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const Toggle: React.FC<ToggleProps> = ({
size,
direction,
label,
labelStyle = 'value',
- 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 PageHeader
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const PageHeader: React.FC<PageHeaderProps> = ({
left,
center,
right,
sticky = 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 APReplyBox
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const APReplyBox: React.FC<APTextAreaProps> = ({
title,
value,
rows = 1,
maxLength,
- 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 useHandleError
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const useHandleError = () => {
const {sentryDSN} = useFramework();
/**
* @param error Thrown 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
Function _fetchEmailData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _fetchEmailData() {
let {html, subject} = this;
// Fetch newsletter
if (!this.newsletter && this.args.data.newsletter) {
Function setDate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@action
setDate(dateStr) {
this.error = null;
if (!dateStr.match(/^\d\d\d\d-\d\d-\d\d$/)) {
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor({
Member,
MemberNewsletter,
MemberCancelEvent,
MemberSubscribeEventModel,
Function getMRR
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMRR({interval, amount, status = null, canceled = false, discount = null}) {
if (status === 'trialing') {
return 0;
}
if (status === 'incomplete') {