Showing 62 of 117 total issues
Function genericSorter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const genericSorter = (a, b) => {
if (a === b) {
return 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 layout
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
layout = (columns, container) => {
const result = [];
// eslint-disable-next-line one-var
let [widthSum, lots] = columns.reduce(
Function useTweenArray
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
useTweenArray = (target, speedFactor = 1.9) => {
const state = useRef({
request: undefined,
target,
running: false,
Function template
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get template() {
return html`
<style>
:host {
display: block;
Function _getTranslations
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getTranslations(locale) {
if (locale === 'sv') {
return {
Amount: 'Belopp',
Ascending: 'stigande',
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return html`
<style>
paper-dropdown-menu {
--iron-icon-width: 0;
Function layout
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
layout = (columns, container) => {
const result = [];
// eslint-disable-next-line one-var
let [widthSum, lots] = columns.reduce(
- 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 mkNapi
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const mkNapi = (host) => {
const /**
* Helper method to remove an item from `data`.
* @param {Object} item Item to remove
* @return {Object} item removed
- 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 normalizeColumns
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const normalizeColumns = (
columns = [],
settings = [],
savedSettings = []
) => {
Function current
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSettings((settings) => {
const config = settings.columns,
{
detail: { newWidth, column },
} = ev,
Function toAmount
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
toAmount(value, limit, limitFunc) {
// eslint-disable-line max-statements
if (value == null || value === '') {
return;
}
Function properties
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get properties() {
return {
/**
* Used to indicate that an element using this behavior is a column definition that can be used
* in cosmoz-omnitable
Function unique
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const unique = (values, valueProperty) => {
if (!Array.isArray(values)) {
return;
}
const used = [];
Function ResizeNub
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ResizeNub = host => {
useEffect(() => {
let initial = 0,
initialWidth = 0;
const
Function renderHeader
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderHeader(column, { filter, query }, setState, source) {
return html`<cosmoz-autocomplete-ui
class="external-values-${column.externalValues}"
?keep-opened=${column.keepOpened}
?keep-query=${column.keepQuery}
Function verifyColumnSetup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
verifyColumnSetup = (columns) => {
let ok = true;
const columnNames = columns.map((c) => c.name);
// Check if column names are set
columns.forEach((column) => {
Function renderHeader
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderHeader(column, { filter, query }, setState, source) {
return html`<cosmoz-autocomplete-ui
class="external-values-${column.externalValues}"
?keep-opened=${column.keepOpened}
?keep-query=${column.keepQuery}
Function toAmount
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
toAmount = (rates = {}, value, limit, limitFunc) => { // eslint-disable-line max-statements
if (value == null || value === '') {
return;
}
Function toAmount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
toAmount = (rates = {}, 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
Function toNumber
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
toNumber = (value, limit, limitFunc) => {
if (value == null || value === '') {
return;
}
const number = typeof value === 'number' ? value : Number(value);
- 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"