Function getModeStyles
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
getModeStyles(mode, display) {
const modeStyles = {}
// simulate a segment w/ the specified style
const segment = {
Function getModeStyles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getModeStyles(mode, display) {
const modeStyles = {}
// simulate a segment w/ the specified style
const segment = {
- 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 (
mode === 'WALK' ||
mode === 'BICYCLE' ||
mode === 'BICYCLE_RENT' ||
mode === 'CAR' ||
Function load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
load(styles) {
for (const i in types) {
const type = types[i]
if (styles[type]) {
for (const key in styles[type]) {
- 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 reset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
reset() {
for (const i in types) {
const type = types[i]
this[type] = Object.assign({}, styles[type] || {})
for (const key in this[type]) {
- 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 compute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
compute(rules, display, data, index) {
let computed
for (const i in rules) {
const rule = rules[i]
const val =
- 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 compute2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
compute2(type, attr, data, index) {
let computed
const rules = this[type][attr]
if (!rules) return null
for (const rule of rules) {
- 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"