Showing 1,820 of 4,015 total issues
Avoid too many return
statements within this function. Open
return t(`One week ago`);
Avoid too many return
statements within this function. Open
return t('{{amount}} years ago', {amount: Math.floor(diff)});
Avoid too many return
statements within this function. Open
return t('{{amount}} weeks ago', {amount: Math.floor(diff)});
Avoid too many return
statements within this function. Open
return t(`One day ago`);
Avoid too many return
statements within this function. Open
return t(`One hour ago`);
Avoid too many return
statements within this function. Open
return {save: parsedUrl.toString(), display: parsedUrl.toString()};
Avoid too many return
statements within this function. Open
return t('Yesterday');
Avoid too many return
statements within this function. Open
return t('{{amount}} hrs ago', {amount: Math.floor(diff)});
Avoid too many return
statements within this function. Open
return {
isExternal: true,
route: `offers/${action.resource.id}`,
models: [action.resource.id]
};
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return {
isExternal: true,
route: 'tag',
models: [action.resource.slug]
};
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return {route: `staff/${action.resource.slug}`};
Avoid too many return
statements within this function. Open
return {route: `staff/${action.actor.slug}`};
Function import
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async import(quantity) {
if (quantity === 0) {
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 getScrollParent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function getScrollParent(node) {
const isElement = node instanceof HTMLElement;
const overflowY = isElement && window.getComputedStyle(node).overflowY;
const isScrollable = overflowY !== 'visible' && overflowY !== 'hidden';
- 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 ghPriceAmount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ghPriceAmount(amount, {cents = true} = {}) {
if (amount) {
let price = cents ? amount / 100 : Math.round(amount / 100);
if (price % 1 === 0) {
return formatNumber(price);
- 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"