Showing 9 of 25 total issues
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
var configuration = {
browsers: [
'Chrome'
],
- Create a ticketCreate a ticket
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(el, fetch, opts = {}) {
const currentLocationText = opts.currentLocationText || 'Use my current location';
const showLoaderOnCurrentLocation = opts.showLoaderOnCurrentLocation || false;
// define the "current location" icon DOM fragment
- Create a ticketCreate a ticket
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(el, opts = {}) {
super(el, {
parentElement: opts.parentElement,
preserveChildElements: true
});
- Create a ticketCreate a ticket
Function selectByIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
selectByIndex() {
if (!this.active()) {
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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 constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(el, onScrollToBottom, opts = {}) {
super(el, {
preserveChildElements: true
});
- Create a ticketCreate a ticket
Function set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set(v) {
// If the textInput contains location data
if (typeof v === 'object') {
this.value = v;
- Read upRead up
- Create a ticketCreate a ticket
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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(el, content, opts = {}) {
if (typeof content === 'string') {
super(el, {preserveChildElements: true});
Object.assign(this, {
closeButton: opts.closeButton || 'X',
- Read upRead up
- Create a ticketCreate a ticket
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 getDisplayValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getDisplayValue() {
let display;
for (const opt of this.options) {
if (opt.selected) {
- Read upRead up
- Create a ticketCreate a ticket
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 setOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
setOptions(options) {
const selection = this.get();
this.options = options.map((opt) => {
if (typeof opt !== 'object') {
opt = {
- Read upRead up
- Create a ticketCreate a ticket
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"