qlik-oss/picasso.js

View on GitHub
plugins/q/src/formatter/timeFormat.js

Summary

Maintainability
A
2 hrs
Test Coverage
B
84%

Showing 2 of 2 total issues

Function formatter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function formatter(pattern, qtype = 'TS', localeInfo = null) {
let qformat = dateFormatFactory(localeInfo, pattern, qtype);
let memoized = memoize(qformat.format.bind(qformat), {
toKey: (date) => (typeof date === 'object' && typeof date.getTime === 'function' ? date.getTime() : date),
});
Severity: Minor
Found in plugins/q/src/formatter/timeFormat.js - About 1 hr to fix

    Function formatter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function formatter(pattern, qtype = 'TS', localeInfo = null) {
    let qformat = dateFormatFactory(localeInfo, pattern, qtype);
    let memoized = memoize(qformat.format.bind(qformat), {
    toKey: (date) => (typeof date === 'object' && typeof date.getTime === 'function' ? date.getTime() : date),
    });
    Severity: Minor
    Found in plugins/q/src/formatter/timeFormat.js - About 1 hr to fix

    There are no issues that match your filters.

    Category
    Status