Function format
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
format(date, pattern) {
if (!pattern) {
pattern = this.pattern ? this.pattern : 'YYYY-MM-DD hh:mm:ss';
}
File qs-date-formatter.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring.
import { TYPES } from '../constants';
const DAYS = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
const DAYS_ABBR = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
const MONTHS = [
Function getMasks
has 70 lines of code (exceeds 25 allowed). Consider refactoring.
function getMasks(inst, d) {
return {
'Y+|y+': {
Y: `${Number(`${d.year}`.slice(-2))}`,
YY: pad(`${d.year}`.slice(-2), 2),
Function format
has 56 lines of code (exceeds 25 allowed). Consider refactoring.
format(date, pattern) {
if (!pattern) {
pattern = this.pattern ? this.pattern : 'YYYY-MM-DD hh:mm:ss';
}
Function parseInterval
has 46 lines of code (exceeds 25 allowed). Consider refactoring.
function parseInterval(days, pattern) {
let units = parseIntervalDays(days),
d = units.d,
h = units.h,
m = units.m,
Function parseInterval
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
function parseInterval(days, pattern) {
let units = parseIntervalDays(days),
d = units.d,
h = units.h,
m = units.m,
Function result
has 30 lines of code (exceeds 25 allowed). Consider refactoring.
const result = pattern.replace(dateTimeRegex, (m) => {
let r;
let mask;
for (mask in masks) {
if (Object.prototype.hasOwnProperty.call(masks, mask)) {
Function getMasks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
function getMasks(inst, d) {
return {
'Y+|y+': {
Y: `${Number(`${d.year}`.slice(-2))}`,
YY: pad(`${d.year}`.slice(-2), 2),
Similar blocks of code found in 4 locations. Consider refactoring.
'm+': {
m: d.m,
def(m) {
return pad(`${d.m}`, m.length);
},
Similar blocks of code found in 4 locations. Consider refactoring.
'D+|d+': {
D: d.date,
def(m) {
return pad(`${d.date}`, m.length);
},
Similar blocks of code found in 4 locations. Consider refactoring.
's+|S+': {
s: d.s,
def(m) {
return pad(`${d.s}`, m.length);
},
Similar blocks of code found in 4 locations. Consider refactoring.
'h+|H+': {
h: d.h,
def(m) {
return pad(`${d.h}`, m.length);
},
There are no issues that match your filters.