Showing 1,820 of 4,015 total issues
Consider simplifying this complex logical expression. Open
if (isNaN(hour) || hour < 0 || hour > 23 || isNaN(minute) || minute < 0 || minute > 59) {
event.target.value = oldTime;
return;
}
Consider simplifying this complex logical expression. Open
if (
!this.get('lexical') &&
(
this.hasChanged('mobiledoc')
|| options.force_rerender
Consider simplifying this complex logical expression. Open
if (options.newsletter
&& !this.get('newsletter_id')
&& this.hasChanged('status')
&& (newStatus === 'published' || newStatus === 'scheduled' || newStatus === 'sent')) {
// Map the passed slug to the id + validate the passed newsletter
Consider simplifying this complex logical expression. Open
if (
!this.get('mobiledoc') &&
(
this.hasChanged('lexical')
|| options.force_rerender
Consider simplifying this complex logical expression. Open
if (!referrerSource && url.hash && url.hash.includes('#/portal')) {
const hashUrl = new URL(window.location.href.replace('/#/portal', ''));
refParam = hashUrl.searchParams.get('ref');
sourceParam = hashUrl.searchParams.get('source');
utmSourceParam = hashUrl.searchParams.get('utm_source');
Consider simplifying this complex logical expression. Open
if (!options.property && _.includes(context, 'paged')) {
description = '';
} else {
description = data.tag[`${options.property}_description`]
|| data.tag.meta_description
Consider simplifying this complex logical expression. Open
if (path && linkRegex.test(path)) {
const [,pagePath] = path.match(linkRegex);
const {page, pageQuery, pageData} = this.getPageFromLinkPath(pagePath, site) || {};
const lastPage = ['accountPlan', 'accountProfile'].includes(page) ? 'accountHome' : null;
const showPopup = (
Consider simplifying this complex logical expression. Open
if (!checkVisible(Object.values(generalSearchKeywords).flat()) &&
!checkVisible(Object.values(siteSearchKeywords).flat()) &&
!checkVisible(Object.values(membershipSearchKeywords).flat()) &&
!checkVisible(Object.values(growthSearchKeywords).flat()) &&
!checkVisible(Object.values(emailSearchKeywords).flat()) &&
Consider simplifying this complex logical expression. Open
if (imageURL) {
let image = (
<div className={imageContainerClassName} style={{
width: (unstyled ? '' : width),
height: (unstyled ? '' : height)
Consider simplifying this complex logical expression. Open
if (!unstyled) {
imageContainerClassName = clsx(
'group relative flex justify-center',
imageContainerClassName
);
Function isBetween
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function isBetween(date, start, end, unit, inclusivity) {
Function output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
output(response, apiUtils, apiConfig, apiImpl, frame) {
Function attach
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const attach = function attach(Model, effectedModelId, relation, modelsToAttach, options) {
Function detach
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const detach = function detach(Model, effectedModelId, relation, modelsToAttach, options) {
Function createPublicFileMiddleware
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createPublicFileMiddleware(location, file, mime, maxAge, options = {}) {
Function servePublicFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function servePublicFile(location, file, type, maxAge, options = {}) {
Function getProduct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getProduct() {
if (this.products.length > 1) {
return luck(10) ? this.products[2]
: luck(50) ? this.products[1]
: this.products[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
Function handleStripe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function handleStripe() {
if (DASH_DASH_ARGS.includes('stripe') || DASH_DASH_ARGS.includes('all')) {
if (DASH_DASH_ARGS.includes('offline') || DASH_DASH_ARGS.includes('browser-tests')) {
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 getResourceById
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async getResourceById(id, type) {
switch (type) {
case 'post':
case 'page': {
const post = await this.models.Post.findOne({id}, {require: 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 getEventAttribution
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getEventAttribution(eventModel) {
const _attribution = this.attributionBuilder.build({
id: eventModel.get('attribution_id'),
url: eventModel.get('attribution_url'),
type: eventModel.get('attribution_type'),
- 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"