Showing 117 of 117 total issues
Function toAmount
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
toAmount(value, limit, limitFunc) {
// eslint-disable-line max-statements
if (value == null || value === '') {
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
Avoid too many return
statements within this function. Open
return new Date(
getRandomInt(2014, 2017),
getRandomInt(1, 12),
getRandomInt(1, 28),
getRandomInt(0, 23),
Avoid too many return
statements within this function. Open
return a < b ? -1 : 1;
Avoid too many return
statements within this function. Open
return limitedValue === comparableDate ? date : lDate;
Avoid too many return
statements within this function. Open
return a - b;
Avoid too many return
statements within this function. Open
return lNumber === valAmount ? amount : lAmount;
Avoid too many return
statements within this function. Open
return lNumber === valAmount ? amount : lAmount;
Avoid too many return
statements within this function. Open
return amount;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return limitFunc(number, lNumber);
Avoid too many return
statements within this function. Open
return a ? -1 : 1;
Avoid too many return
statements within this function. Open
return amount;
Avoid too many return
statements within this function. Open
return limitFunc(number, lNumber);
Function computeLayout
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const computeLayout = (_columnConfigs, canvasWidth, numColumns) => {
const columnConfigs = _columnConfigs.filter((c) => !c.hidden),
totalWidths = columnConfigs.reduce((sum, { width }) => sum + width, 0);
if (columnConfigs.length > 1 && totalWidths > canvasWidth) {
- 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 generateTableDemoData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const generateTableDemoData = (min, max, maxRandomString) => {
const groupsCount = getRandomInt(min, max),
data = [],
descriptions = [
'Lorem ipsum dolor sit amet',
- 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 toDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toDate = (value, limit, limitFunc) => { // eslint-disable-line max-statements
const date = parseDate(value);
if (date == null) {
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 columnMixin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
columnMixin = (base) =>
class extends base {
static get properties() {
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"