Showing 94 of 144 total issues
Function getInterval
has 43 lines of code (exceeds 25 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();
Function keyDownEventHandler
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function keyDownEventHandler(target) {
return function(event) {
let isOpen = get(target, 'isListOpen');
let handler = keyEvent({ event });
if (event.altKey) {
Function handleCursor
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function handleCursor(target, action='', triggerChange=true) {
return new EmberPromise(resolve => {
later(() => {
const { format, selection } = getMeta(target);
const value = getValue(target);
Function setActiveState
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
setActiveState(options={}) {
if (isNone(get(this, 'stateManager'))) {
this.setState();
}
Function importTransforms
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
importTransforms() {
return {
'global': {
transform: (tree, options) => {
let amdTransform = stew.map(tree, (content, relativePath) => {
Function importTransforms
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
importTransforms() {
return {
'global': {
transform: (tree, options) => {
let amdTransform = stew.map(tree, (content, relativePath) => {
- 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 sectionBounds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function sectionBounds(target) {
let type = sectionFormatType(target);
let max, min = 1;
if (type === DAY_FLAG) {
const date = _time(get(target, '_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 setupTime
has 31 lines of code (exceeds 25 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');
Function didInsertElement
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
didInsertElement(...args) {
this._super(...args);
const target = this.$().get(0);
Function setBounds
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
setBounds(minX, minY, width, height) {
// hide box until calculations have been made
// safari fix
this.svg.__el.style.display = "none";
this.svg.snap.attr({ viewBox: `${minX} ${minY} ${width} ${height}` });
Function updateDates
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateDates(type, time, calendar, singleSet=false) {
let isStart = get(this, 'isStart');
if (!get(this, 'allowCustom')) {
isStart = true;
}
Function handleDrag
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleDrag(num, cb) {
const faceAttrs = getAttrs(this.svg.face, ['cx', 'cy']);
const angle = getSliceDegree(this.points.length, num);
const { plot, arm, text } = this.svg.at(num);
Function setState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setState() {
let start = getStart(this);
let end = getEnd(this);
let timestamp = start;
Function formatStringType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_time.formatStringType = function(fmt) {
if (/^D(o|D)?$/.test(fmt)) {
return DAY_FLAG;
} else if (/^d(o|d|dd|ddd)?$/.test(fmt)) {
return WEEKDAY_FLAG;
- 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 getDefaultAction
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDefaultAction() {
if (get(this, 'isCustom')) {
const span = _time.daysApart(getStart(this), getEnd(this)) + 1;
return EmberObject.create({name: loc('Custom'), span, type: 'days'});
} else if (!isEmpty(get(this, 'defaultAction'))) {
Function keyDown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
keyDown(event) {
if (isModifierKeyActive(this, event)) {
return true;
}
Function createMetaFor
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createMetaFor(component, key, start, end, min, max, rounder, selectRounder) {
Function getHourMinute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function getHourMinute(type, timestamp, selectRounder) {
if (type === HOUR_FLAG) {
let hour = parseInt(_time(timestamp).format('H'), 10);
if (hour <= 0) { hour = 12; } // enforce hour is not set to 0
if (hour > 12) { hour = hour - 12; } // enforce hour is 12 hour format
- 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 typeExp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_time.typeExp = function(type) {
if (type === DAY_FLAG) {
return /D(o|D)?/;
} else if (type === WEEKDAY_FLAG) {
return /d(o|d|dd|ddd)?/;
- 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 createSVGPath
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createSVGPath(totalSlices, degree, x, y, start, end) {