Showing 94 of 144 total issues
Avoid deeply nested control flow statements. Open
if (isOpen) {
nextListItem(target);
}
Function isDateAfter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_time.isDateAfter = function(date, maxDate) {
let isAfter = false;
if (!isNone(maxDate)) {
if (typeof maxDate === 'number' && !isNaN(maxDate)) {
maxDate = _time(maxDate);
- 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 unselectPlot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
unselectPlot(value) {
const { text, arm, plot } = this.at(value);
let next, prev;
if (this.has('plot', value - this.selectRounder)) {
prev = this.at(value - this.selectRounder);
- 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 deeply nested control flow statements. Open
if (!isNone(maxDate)) { max = _time.utcToLocal(maxDate).timestamp(); }
Function isDateBefore
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_time.isDateBefore = function(date, minDate) {
let isBefore = false;
if (!isNone(minDate)) {
if (typeof minDate === 'number' && !isNaN(minDate)) {
minDate = _time(minDate);
- 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 deeply nested control flow statements. Open
} else if (handler.keyName === 'ArrowUp') {
if (isOpen) {
prevListItem(target);
}
} else if (handler.keyName === 'Enter') {
Function getInBoundsDate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getInBoundsDate(date, min, max) {
const adjustTime = (d1, d2) => {
if (d1.hours() < d2.hours()) d2.hours(d1.hours());
if (d1.minutes() < d2.minutes()) d2.minutes(d1.minutes());
if (d1.seconds() < d2.seconds()) d2.seconds(d1.seconds());
- 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 onMove
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function onMove(angleStart, cx, cy, x, y, cb=function(){}) {
Function setSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setSelected(id) {
// reset selected list
get(this, '__actionList').forEach(item => set(item, 'selected', false));
let selected;
- 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 deeply nested control flow statements. Open
if (!isOpen) {
target.send('selectCustom');
}
Avoid deeply nested control flow statements. Open
if (start < __start) {
__start = _time(__start).subtract(7, 'days').valueOf();
}
Avoid deeply nested control flow statements. Open
if (!isNone(minDate)) { min = _time.utcToLocal(minDate).timestamp(); }
Function getCursorPosition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function getCursorPosition(format, value, index, isAdd=false, isSub=false) {
Function setListener
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function setListener(type, namespace, listener, capture=false, passive=false) {
Function bind
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function bind(target, type, namespace, listener, { capture=false, rebind=false, passive=false, once=false }) {
Function setDateSection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
setDateSection(valueSection, position) {
let { sectionFormat, start, end } = getMeta(this);
let { min, max } = sectionBounds(this);
// moves the start ahead on position when the valueSection
- 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 getDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getDate(type, value, timestamp) {
const time = _time(timestamp);
if (type === HOUR_FLAG) {
if (value === 12) {
value = 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 createPoints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function createPoints(start, end, rounder, selectRounder) {
if (selectRounder <= 0) {
selectRounder = 1;
}
- 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 this.sendAction('ontabkey', event, handler);
Avoid too many return
statements within this function. Open
return i18n('last_week');