Showing 94 of 144 total issues
File ember-date-range-picker.js
has 718 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module Components
*
*/
import $ from 'jquery';
File date-input.js
has 699 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module components
*
*/
import $ from 'jquery';
Function setupTime
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
setupTime() {
let timestamp = get(this, 'timestamp');
let unix = get(this, 'unix');
let minDate = get(this, 'minDate');
let maxDate = get(this, '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 upDownArrows
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
upDownArrows(keyName) {
const { sectionFormat, start, end } = getMeta(this);
const type = sectionFormatType(this);
let _date = get(this, '_date');
- 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 getInterval
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
getInterval(direction=0) {
let { span, type } = get(this, 'selected');
let start, end;
if (!isEmpty(type) && !isNone(span)) {
start = _time(getStart(this)).valueOf();
- 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 buildDaysArrayForMonth
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
buildDaysArrayForMonth: function() {
const calendarDate = get(this, 'calendarDate');
const minDate = get(this, 'stateManager.minDate');
const maxDate = get(this, 'stateManager.maxDate');
let [ startRange, endRange ] = (get(this, 'stateManager.range') || []);
- 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 setup
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
setup: on('init', function() {
const isUnix = !isNone(get(this, 'startUnix')) || !isNone(get(this, 'endUnix'));
set(this, '_isUnix', isUnix);
// get locale converted format str
- 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 setup
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: on('init', function() {
const isUnix = !isNone(get(this, 'startUnix')) || !isNone(get(this, 'endUnix'));
set(this, '_isUnix', isUnix);
// get locale converted format str
Function selectedDateRange
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
selectedDateRange: computed('selected', '_start', '_end', 'format', function() {
const { id } = get(this, 'selected');
const start = _time(getStart(this));
const end = _time(getEnd(this));
let isCurrent = false;
- 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
File ember-date-time-picker.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module Components
*
*/
import $ from 'jquery';
`` has 24 functions (exceeds 20 allowed). Consider refactoring. Open
export default Component.extend({
/**
* @private
* @property classNames
* @type String
Function upDownArrows
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
upDownArrows(keyName) {
const { sectionFormat, start, end } = getMeta(this);
const type = sectionFormatType(this);
let _date = get(this, '_date');
`` has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export default TextField.extend({
classNames: ['busyweb', 'emberdatetime', 'p-date-input'],
classNameBindings: ['isDateInRange::invalid', 'active'],
type: 'text',
Function setActiveState
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
setActiveState(options={}) {
if (isNone(get(this, 'stateManager'))) {
this.setState();
}
- 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 keyDown
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
keyDown(event) {
if (isModifierKeyActive(this, event)) {
return true;
}
- 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 handleAltKeys
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function handleAltKeys(target, keyName, isOpen) {
if (keyName === '/') {
target.send('toggleList');
} else {
let selectedId = get(target, 'selected.id');
- 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
`` has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export default Component.extend({
classNames: ['busyweb', 'emberdatetime', 'p-time-picker'],
layout: layout,
stateManager: null,
Function buildDaysArrayForMonth
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildDaysArrayForMonth: function() {
const calendarDate = get(this, 'calendarDate');
const minDate = get(this, 'stateManager.minDate');
const maxDate = get(this, 'stateManager.maxDate');
let [ startRange, endRange ] = (get(this, 'stateManager.range') || []);
Function selectedDateRange
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectedDateRange: computed('selected', '_start', '_end', 'format', function() {
const { id } = get(this, 'selected');
const start = _time(getStart(this));
const end = _time(getEnd(this));
let isCurrent = false;
Function updateDates
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
updateDates(type, time, calendar, singleSet=false) {
let isStart = get(this, 'isStart');
if (!get(this, 'allowCustom')) {
isStart = true;
}
- 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"