Showing 10 of 10 total issues
Function transformNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
transformNode(node) {
if (node.path.type === 'PathExpression' && node.path.original === 'get-errors-for') {
if (!node.params[0] || node.params[0].type !== 'PathExpression') {
throw new Error(
'the (get-errors-for) helper requires a path to be passed in as its first parameter, received: ' +
- 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 transformNode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
transformNode(node) {
if (node.path.type === 'PathExpression' && node.path.original === 'has-error-for') {
if (!node.params[0] || node.params[0].type !== 'PathExpression') {
throw new Error(
'the (has-error-for) helper requires a path to be passed in as its first parameter, received: ' +
- 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 validatable
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function validatable(target) {
return class extends target {
@tracked _evdVisibleErrors = [];
@tracked _evdShowAllErrors = 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 extractQueryParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const extractQueryParams = function (request) {
const params = Object.keys(request.queryParams);
const rhett = {
filterParams: [],
queryTerms: [],
- 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 validateField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@action
validateField(fieldName) {
switch (fieldName) {
case 'name':
this.errors.name = this.isNameValid
- 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 moveFocus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@action
moveFocus(event) {
const { key, target } = event;
switch (key) {
case 'ArrowDown':
- 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
Avoid too many return
statements within this function. Open
return spaceship(v.localeCompare(w), 0);
Avoid too many return
statements within this function. Open
return spaceship(v.getTime(), w.getTime());
Function sortBy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function sortBy(arr, sortKeys) {
if (arr !== null && typeof arr === 'object') {
if ('slice' in arr) {
arr = arr.slice();
}
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (environment) {
const ENV = {
modulePrefix: 'frontend',
environment,
rootURL: '/',
- 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"