Showing 62 of 117 total issues
Function listColumnMixin
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
listColumnMixin = (base) =>
class extends base {
static get properties() {
return {
textProperty: { type: String },
- 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 parseDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
parseDate = value => {
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
Consider simplifying this complex logical expression. Open
if (
!emptyLabel ||
emptyValue === undefined ||
!textProperty ||
!(emptyProperty || valueProperty) ||
Function _valuesChanged
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_valuesChanged(autodetect, currency, values) {
if (!Array.isArray(values) || values.length < 1) {
return;
}
if (!autodetect && currency) {
- 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 useList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const useList = ({
host,
error,
dataIsValid,
processedItems,
- 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 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"