Showing 1,756 of 3,886 total issues
Avoid too many return
statements within this function. Open
return {route: `staff/${action.actor.slug}`};
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 {save: url, display: url};
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 {save: url, display: url};
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 {save: url, display: url};
Avoid too many return
statements within this function. Open
return {
isExternal: true,
route: `offers/${action.resource.id}`,
models: [action.resource.id]
};
Function btnStyles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function btnStyles(options = {}) {
let button = 'dib midgrey btn-base br3 ba b--lightgrey-l1 pointer glow';
let span = 'f8 fw5 tracked-2 dib pt0 pb0 tc';
// Set style
- 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 willTransition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
willTransition(transition) {
if (this.get('upgradeStatus.isRequired')) {
transition.abort();
this.upgradeStatus.requireUpgrade();
return 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 topologicalSort
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function topologicalSort(objects) {
// Create an empty result array to store the ordered objects
const result = [];
// Create a set to track visited objects during the DFS
const visited = new Set();
- 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 generate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
generate() {
const id = this.fastFakeObjectId();
let newsletter;
if (this.newsletters.length === 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 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 getRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getRoute(event) {
if (['comment_event', 'click_event', 'feedback_event'].includes(event.type)) {
if (event.data.post) {
return {
name: 'posts.analytics',
- 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 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 getActorLinkTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getActorLinkTarget(ev) {
const actor = getActor(ev);
if (!actor) {
return null;
}
- 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"